Pertaining to cubing, or being of the third power. In mathematics, it is notated as a superscript three (x³). Use this tag for programming-relevant questions that involves cubic equations and similar concepts, which have applications such as computational complexity, and cubic spline interpolation. This tag is not to be confused with the "cube" tag, which refers to the *OLAP cube*.
Cubic means of degree three. Variables raised to the third variable are called cubes in algebra, and a cubic polynomial is a third-degree polynomial.
Cubic polynomials are polynomials whose highest degree is three. All cubic polynomials of one variable are of the form A*x^3 + B*x^2 + C*x + D
where leading coefficient A
is nonzero. The graph of a cubic function rises for positive A
, and falls for negative A
, but it is described as "bendy" and that it has an inflection point.
All cubic polynomials have three complex roots, where one to three of the roots are real. Therefore, all cubic polynomials may be factored as (x-p)*(x-q)*(x-r)
where p, q, r
are complex and potentially real roots. All three complex roots of every cubic polynomial can be solved in terms of radicals, this is known as the Cardano formula.
The first derivative of a cubic polynomial is a quadratic polynomial, which is 3*A*x^2 + 2*B*x + C
Here are the graphs of five cubic polynomials.
Cubic Spline Interpolation is a process where a shape or curve is approximated or interpolated by piecewise cubic functions. This is useful for extrapolating sets of points or data with a smooth curve, as well as approximating shapes and fonts.
Here is an example of a cubic spline interpolating a series of five points.
Cubic Complexity means having an asymptotic complexity of O(x^3)
. That means, it grows similar to a positive cubic function A*x^3 + B*x^2 + C*x + D
as x
grows, or in calculus terms, f(x) == O(x^3)
if the limit as x
grows to positive infinity, f(x)/x^3
is a constant.
There are two forms of cubic complexity: cubic space and cubic time, indicating that this program or algorithm asymptotically requires extra memory space or took time equal or less than the cube of the size of the input n
respectively. It is worse than quadratic complexity, but it is still considered efficient as it is in polynomial complexity. Matrix multiplication between m×k and k×n matrices is a cubic-time algorithm of time O(m*k*n)
, whereas the best square matrix multiplication can be done faster than cubic time but still slower than quadratic time; matrix multiplication is therefore a cubic time algorithm.
Related tags
polynomials: Generalization of 'cubic' and 'quadratic' by having any (constant) degree.
complexity-theory, time-complexity, space-complexity: Tags relating to complexity, including the famous polynomial time such as linear time, quadratic time, and cubic time.
cubic-spline: Applications of cubic polynomials where a curve or point set is approximated by piecewise cubic polynomials.
cube: Do not confuse between "cubic" and "cube" tags. Here, the "cube" tag refers to the OLAP cube datastructure.
Read More: