# Cubic function

(Redirected from Cubic equation) Graph of a cubic function with 3 real roots (where the curve crosses the horizontal axis—where y = 0). The case shown has two critical points. Here the function is f(x) = (x3 + 3x2 − 6x − 8)/4.

In algebra, a cubic function is a function of the form

$f(x)=ax^{3}+bx^{2}+cx+d$ in which a is nonzero.

Setting f(x) = 0 produces a cubic equation of the form

$ax^{3}+bx^{2}+cx+d=0.\,$ The solutions of this equation are called roots of the polynomial f(x). If all of the coefficients a, b, c, and d of the cubic equation are real numbers, then it has at least one real root (this is true for all odd degree polynomials). All of the roots of the cubic equation can be found algebraically. (This is also true of quadratic (second degree) or quartic (fourth degree) equations, but not of higher-degree equations, by the Abel–Ruffini theorem.) The roots can also be found trigonometrically. Alternatively, numerical approximations of the roots can be found using root-finding algorithms such as Newton's method.

The coefficients do not need to be complex numbers. Much of what is covered below is valid for coefficients of any field with characteristic 0 or greater than 3. The solutions of the cubic equation do not necessarily belong to the same field as the coefficients. For example, some cubic equations with rational coefficients have roots that are non-rational (and even non-real) complex numbers.

## History

Cubic equations were known to the ancient Babylonians, Greeks, Chinese, Indians, and Egyptians. Babylonian (20th to 16th centuries BC) cuneiform tablets have been found with tables for calculating cubes and cube roots. The Babylonians could have used the tables to solve cubic equations, but no evidence exists to confirm that they did. The problem of doubling the cube involves the simplest and oldest studied cubic equation, and one for which the ancient Egyptians did not believe a solution existed. In the 5th century BC, Hippocrates reduced this problem to that of finding two mean proportionals between one line and another of twice its length, but could not solve this with a compass and straightedge construction, a task which is now known to be impossible. Methods for solving cubic equations appear in The Nine Chapters on the Mathematical Art, a Chinese mathematical text compiled around the 2nd century BC and commented on by Liu Hui in the 3rd century. In the 3rd century AD, the Greek mathematician Diophantus found integer or rational solutions for some bivariate cubic equations (Diophantine equations). Hippocrates, Menaechmus and Archimedes are believed to have come close to solving the problem of doubling the cube using intersecting conic sections, though historians such as Reviel Netz dispute whether the Greeks were thinking about cubic equations or just problems that can lead to cubic equations. Some others like T. L. Heath, who translated all Archimedes' works, disagree, putting forward evidence that Archimedes really solved cubic equations using intersections of two conics, but also discussed the conditions where the roots are 0, 1 or 2.

In the 7th century, the Tang dynasty astronomer mathematician Wang Xiaotong in his mathematical treatise titled Jigu Suanjing systematically established and solved numerically 25 cubic equations of the form x3 + px2 + qx = N, 23 of them with p, q ≠ 0, and two of them with q = 0.

In the 11th century, the Persian poet-mathematician, Omar Khayyam (1048–1131), made significant progress in the theory of cubic equations. In an early paper, he discovered that a cubic equation can have more than one solution and stated that it cannot be solved using compass and straightedge constructions. He also found a geometric solution. In his later work, the Treatise on Demonstration of Problems of Algebra, he wrote a complete classification of cubic equations with general geometric solutions found by means of intersecting conic sections.

In the 12th century, the Indian mathematician Bhaskara II attempted the solution of cubic equations without general success. However, he gave one example of a cubic equation: x3 + 12x = 6x2 + 35. In the 12th century, another Persian mathematician, Sharaf al-Dīn al-Tūsī (1135–1213), wrote the Al-Muʿādalāt (Treatise on Equations), which dealt with eight types of cubic equations with positive solutions and five types of cubic equations which may not have positive solutions. He used what would later be known as the "Ruffini-Horner method" to numerically approximate the root of a cubic equation. He also used the concepts of maxima and minima of curves in order to solve cubic equations which may not have positive solutions. He understood the importance of the discriminant of the cubic equation to find algebraic solutions to certain types of cubic equations.

In his book Flos, Leonardo de Pisa, also known as Fibonacci (1170–1250), was able to closely approximate the positive solution to the cubic equation x3 + 2x2 + 10x = 20. Writing in Babylonian numerals he gave the result as 1,22,7,42,33,4,40 (equivalent to 1 + 22/60 + 7/602 + 42/603 + 33/604 + 4/605 + 40/606), which has a relative error of about 10−9.

In the early 16th century, the Italian mathematician Scipione del Ferro (1465–1526) found a method for solving a class of cubic equations, namely those of the form x3 + mx = n. In fact, all cubic equations can be reduced to this form if we allow m and n to be negative, but negative numbers were not known to him at that time. Del Ferro kept his achievement secret until just before his death, when he told his student Antonio Fiore about it.

In 1530, Niccolò Tartaglia (1500–1557) received two problems in cubic equations from Zuanne da Coi and announced that he could solve them. He was soon challenged by Fiore, which led to a famous contest between the two. Each contestant had to put up a certain amount of money and to propose a number of problems for his rival to solve. Whoever solved more problems within 30 days would get all the money. Tartaglia received questions in the form x3 + mx = n, for which he had worked out a general method. Fiore received questions in the form x3 + mx2 = n, which proved to be too difficult for him to solve, and Tartaglia won the contest.

Later, Tartaglia was persuaded by Gerolamo Cardano (1501–1576) to reveal his secret for solving cubic equations. In 1539, Tartaglia did so only on the condition that Cardano would never reveal it and that if he did write a book about cubics, he would give Tartaglia time to publish. Some years later, Cardano learned about Ferro's prior work and published Ferro's method in his book Ars Magna in 1545, meaning Cardano gave Tartaglia six years to publish his results (with credit given to Tartaglia for an independent solution). Cardano's promise with Tartaglia stated that he not publish Tartaglia's work, and Cardano felt he was publishing del Ferro's, so as to get around the promise. Nevertheless, this led to a challenge to Cardano by Tartaglia, which Cardano denied. The challenge was eventually accepted by Cardano's student Lodovico Ferrari (1522–1565). Ferrari did better than Tartaglia in the competition, and Tartaglia lost both his prestige and income.

Cardano noticed that Tartaglia's method sometimes required him to extract the square root of a negative number. He even included a calculation with these complex numbers in Ars Magna, but he did not really understand it. Rafael Bombelli studied this issue in detail and is therefore often considered as the discoverer of complex numbers.

François Viète (1540–1603) independently derived the trigonometric solution for the cubic with three real roots, and René Descartes (1596–1650) extended the work of Viète.

## Critical points and inflection point of a cubic function

The critical points of a function are those values of x where the slope of the function is zero. The critical points of a cubic function f defined by f(x) = ax3 + bx2 + cx + d, occur at values of x such that the derivative of the cubic function is zero:

$3ax^{2}+2bx+c=0.$

The solutions of that equation are the critical points of the cubic equation and are given, using the quadratic formula, by

$x_{\text{critical}}={\frac {-b\pm {\sqrt {b^{2}-3ac}}}{3a}}.$

The expression inside of the square root,

$\Delta _{0}=b^{2}-3ac,$

determines what type of critical points the function has. If Δ0 > 0, then the cubic function has a local maximum and a local minimum. If Δ0 = 0, then the cubic's inflection point is the only critical point. If Δ0 < 0, then there are no critical points. In cases where Δ0 ≤ 0, the cubic function is strictly monotonic. The adjacent diagram is an example of the case where Δ0 > 0. The other two cases do not have the local maximum or the local minimum but still have an inflection point.

The value of Δ0 also plays an important role in determining the nature of the roots of the cubic equation and in the calculation of those roots; see below.

The inflection point of a function is where that function changes concavity. The inflection point of our cubic function occurs at:

$x_{\text{inflection}}=-{\frac {b}{3a}},$

a value that is also important in solving the cubic equation. The cubic function has point symmetry about its inflection point.

All of the above assumes that the coefficients are real as well as the variable x.

## General solution to the cubic equation with real coefficients

This section is about how to solve the cubic equation using various methods. For details and proofs see below. The general cubic equation has the form:

$ax^{3}+bx^{2}+cx+d=0$

(1)

with a ≠ 0.

### Algebraic solution

The algebraic solution of the cubic equation can be derived in a number of different ways. (See for example Cardano's method and Vieta's method below.)

#### The discriminant

The numbers of real and complex roots are determined by the discriminant of the cubic equation,

$\Delta =18abcd-4b^{3}d+b^{2}c^{2}-4ac^{3}-27a^{2}d^{2}.$

It turns out that:

• If Δ > 0, then the equation has three distinct real roots.
• If Δ = 0, then the equation has a multiple root and all of its roots are real.
• If Δ < 0, then the equation has one real root and two non-real complex conjugate roots.

#### Cardano formula

The solution of the general cubic equation may be deduced from that of the depressed cubic

$x^{3}+px+q=0$

The Cardano formula is the following expression of the solutions of this equation.

If p and q are real numbers, a real solution of the equation is given by

${\sqrt[{3}]{-{q \over 2}+{\sqrt {{q^{2} \over 4}+{p^{3} \over 27}}}}}+{\sqrt[{3}]{-{q \over 2}-{\sqrt {{q^{2} \over 4}+{p^{3} \over 27}}}}},$

where ${\sqrt[{3}]{X}}$  denotes either the real cube root of X, if X is real (that is $4p^{3}+27q^{2}\geq 0$ ), or, in the other case, the principal value of the cube root function, that is the cube root with the maximal real part.

The two other solutions are obtained by multiplying one of the cube roots by ${\frac {-1+i{\sqrt {3}}}{2}},$  and the other by ${\frac {-1-i{\sqrt {3}}}{2}}.$

If p and q are not both real, the same formulas remain correct if, in the formula for the first root, one chooses the cube roots in order that their product is –p/3. (If p and q are both real, the above choices for the cube roots satisfy this property).

In the special case $4p^{3}+27q^{2}=0,$  these formulas remain correct, but a simpler formula is available, where one solution is 3q/p, and the two others equal –3q/2p.

#### General formula

The general solution of the cubic equation involves first calculating:

$\Delta _{0}=b^{2}-3ac{\text{,}}$
$\Delta _{1}=2b^{3}-9abc+27a^{2}d,\quad {\text{and}}$
$C={\sqrt[{3}]{\frac {\Delta _{1}\pm {\sqrt {{\Delta _{1}}^{2}-4{\Delta _{0}}^{3}}}}{2}}}{\text{.}}$

(If the discriminant Δ has already been calculated, then the equality Δ12 − 4Δ03 = −27 a2Δ can be used to simplify the calculation of C.) There are three possible cube roots implied by the expression, of which at least two are non-real complex numbers; any of these may be chosen when defining C. (In addition either sign in front of the square root may be chosen unless Δ0 = 0 in which case the sign must be chosen so that the two terms inside the cube root do not cancel.)

The general formula for one of the roots, in terms of the coefficients, is as follows:

$x=-{\frac {1}{3a}}\left(b+C+{\frac {\Delta _{0}}{C}}\right){\text{.}}$

Note that, while this equality is valid for all non-zero C, it is not the most convenient form for multiple roots (Δ = 0), which is covered in the next section. (The case when C = 0 only occurs when both Δ and Δ0 are equal to 0 and is also covered in the next section.)

The other two roots of the cubic equation can be determined using the same equality, using the other two choices for the cube root in the equation for C: denoting the first choice simply as C, the others can be written as (−1/2 + 1/23i) C and (−1/21/23i) C.

The above equality can be expressed compactly including all 3 roots as follows:

$x_{k}=-{\frac {1}{3a}}\left(b+\xi ^{k}C+{\frac {\Delta _{0}}{\xi ^{k}C}}\right),\qquad k\in \{0,1,2\}{\text{,}}$

where ξ = −1/2 + 1/23i (which is a cube root of unity). In the case of three real roots, this solution expresses them in terms of non-real complex terms (since any choice of C is non-real) whose imaginary components offset each other but cannot be eliminated from the formula.

This formula for the three roots applies even when the coefficients in the cubic are non-real, although the analysis of the sign of Δ does not hold since Δ is then not real in general.

#### Multiple roots, Δ = 0

If both Δ and Δ0 are equal to 0, then the equation has a single root (which is a triple root):

$-{\frac {b}{3a}}{\text{.}}$

If Δ = 0 and Δ0 ≠ 0, then there are both a double root,

${\frac {9ad-bc}{2\Delta _{0}}},$

and a simple root,

${\frac {4abc-9a^{2}d-b^{3}}{a\Delta _{0}}}.$

### Trigonometric and hyperbolic solutions

#### Reduction to a depressed cubic

Dividing ax3 + bx2 + cx + d = 0 by a and substituting tb/3a for x we get the equation

$t^{3}+pt+q=0$

(2)

where

{\begin{aligned}p=&{\frac {3ac-b^{2}}{3a^{2}}},\\q=&{\frac {2b^{3}-9abc+27a^{2}d}{27a^{3}}}.\end{aligned}}

The left hand side of equation (2) is a monic trinomial called a depressed cubic, because the quadratic term has coefficient 0.

Any formula for the roots of a depressed cubic may be transformed into a formula for the roots of equation (1) by substituting the above values for p and q and using the relation x = tb/3a.

Therefore, only equation (2) is considered in the following.

#### Trigonometric solution for three real roots

When a cubic equation has three real roots, the formulas expressing these roots in terms of radicals involve complex numbers. It has been proved that when none of the three real roots is rational—the casus irreducibilis— one cannot express the roots in terms of real radicals. Nevertheless, purely real expressions of the solutions may be obtained using hypergeometric functions, or more elementarily in terms of trigonometric functions, specifically in terms of the cosine and arccosine functions.

The formulas which follow, due to François Viète, are true in general (except when p = 0), and are purely real when the equation has three real roots, but involve complex cosines and arccosines when there is only one real root.

Starting from equation (2), t3 + pt + q = 0, let us set t = u cos θ. The idea is to choose u to make equation (2) coincide with the identity

$4\cos ^{3}\theta -3\cos \theta -\cos(3\theta )=0\,.$

In fact, choosing $u=2{\sqrt {-{\frac {p}{3}}}}$  and dividing equation (2) by ${\frac {u^{3}}{4}}$  we get

$4\cos ^{3}\theta -3\cos \theta -{\frac {3q}{2p}}{\sqrt {\frac {-3}{p}}}=0\,.$

Combining with the above identity, we get

$\cos(3\theta )={\frac {3q}{2p}}{\sqrt {\frac {-3}{p}}}$

and thus the roots are

$t_{k}=2{\sqrt {-{\frac {p}{3}}}}\cos \left({\frac {1}{3}}\arccos \left({\frac {3q}{2p}}{\sqrt {\frac {-3}{p}}}\right)-{\frac {2\pi k}{3}}\right)\quad {\text{for}}\quad k=0,1,2\,.$

This formula involves only real terms if p < 0 and the argument of the arccosine is between −1 and 1. The last condition is equivalent to 4p3 + 27q2 ≤ 0, which itself implies p < 0. Thus the above formula for the roots involves only real terms if and only if the three roots are real.

Denoting by C( p, q) the above value of t0, and using the inequalities 0 ≤ arccos(u) ≤ π for a real number u such that −1 ≤ u ≤ 1, the three roots may also be expressed as

$t_{0}=C(p,q),\qquad t_{2}=-C(p,-q),\qquad t_{1}=-t_{0}-t_{2}\,.$

If the three roots are real, we have t0t1t2. All these formulas may be straightforwardly transformed into formulas for the roots of the general cubic equation (1), using the back substitution described above.

#### Hyperbolic solution for one real root

When there is only one real root (and p ≠ 0), it may be similarly represented using hyperbolic functions, as

{\begin{aligned}t_{0}&=-2{\frac {|q|}{q}}{\sqrt {-{\frac {p}{3}}}}\cosh \left({\frac {1}{3}}\operatorname {arcosh} \left({\frac {-3|q|}{2p}}{\sqrt {\frac {-3}{p}}}\right)\right)\quad {\text{if }}\quad 4p^{3}+27q^{2}>0{\text{ and }}p<0\,,\\t_{0}&=-2{\sqrt {\frac {p}{3}}}\sinh \left({\frac {1}{3}}\operatorname {arsinh} \left({\frac {3q}{2p}}{\sqrt {\frac {3}{p}}}\right)\right)\quad {\text{if }}\quad p>0\,.\end{aligned}}

If p ≠ 0 and the inequalities on the right are not satisfied (the case of three real roots), the formulas remain valid but involve complex quantities.

When p = ±3, the above values of t0 are sometimes called the Chebyshev cube root. More precisely, the values involving cosines and hyperbolic cosines define, when p = −3, the same analytic function denoted C1/3(q), which is the proper Chebyshev cube root. The value involving hyperbolic sines is similarly denoted S1/3(q), when p = 3.

### Factorization

If a cubic function ax3 + bx2 + cx + d with integer coefficients is reducible over the rationals, meaning that it can be factored into lower-degree polynomials with rational coefficients, then it has a rational root, which can be found using the rational root test: If the root r = ​mn is fully reduced, then m is a factor of d and n is a factor of a, so all possible combinations of values for m and n (both positive and negative for one of them) can be checked for whether they are roots of the cubic.

The rational root test may also be used for a cubic equation with rational coefficients: by multiplication by the lowest common denominator of the coefficients, one gets an equation with integer coefficients which has exactly the same roots.

The rational root test is particularly useful when there are three real roots because the algebraic solution unhelpfully expresses the real roots in terms of complex entities; if the test yields a rational root, it can be factored out and the remaining roots can be found by solving a quadratic. The rational root test is also helpful in the presence of one real and two complex roots because again, if it yields a rational root, it allows all of the roots to be written without the use of cube roots: If r is any root of the cubic, then we may factor out xr using polynomial long division to obtain

$ax^{3}+bx^{2}+cx+d=\left(x-r\right)\left(ax^{2}+(b+ar)x+c+br+ar^{2}\right).$

Hence if we know one root, perhaps from the rational root test, we can find the other two by using the quadratic formula to find the roots of the quadratic ax2 + (b + ar)x + c + br + ar2, giving

${\frac {-b-ra\pm {\sqrt {b^{2}-4ac-2abr-3a^{2}r^{2}}}}{2a}}$

for the other two roots.

### Geometric solutions

#### Omar Khayyám's solution

Omar Khayyám's geometric solution of a cubic equation, for the case m = 2, n = 16, giving the root 2. The intersection of the vertical line on the x-axis at the center of the circle is happenstance of the example illustrated.

As shown in this graph, to solve the third-degree equation x3 + m2x = n where n > 0, Omar Khayyám constructed the parabola y = x2/m, the circle which has as a diameter the line segment [0, n/m2] on the positive x-axis, and a vertical line through the point above the x-axis where the circle and parabola intersect. The solution is given by the length of the horizontal line segment from the origin to the intersection of the vertical line and the x-axis.

A simple modern proof of the method is the following: multiplying the equation by x and regrouping the terms gives

${\frac {x^{4}}{m^{2}}}=x\left({\frac {n}{m^{2}}}-x\right).$

The left-hand side is the value of y2 on the parabola. The equation of the circle being y2 + x(xn/m2) = 0, the right hand side is the value of y2 on the circle.

#### Solution with angle trisector

A cubic equation with real coefficients can be solved geometrically using compass, straightedge, and an angle trisector if and only if it has three real roots.:Thm. 1

## Nature of the roots in the case of real coefficients

### Algebraic nature of the roots

Every cubic equation (1), ax3 + bx2 + cx +d = 0, with real coefficients and a ≠ 0, has three solutions (some of which may equal each other if they are real, and two of which may be complex non-real numbers) and at least one real solution r1, this last assertion being a consequence of the intermediate value theorem. If xr1 is factored out of the cubic polynomial, what remains is a quadratic polynomial whose roots r2 and r3 are roots of the cubic; by the quadratic formula, these roots are either both real (giving a total of three real roots for the cubic) or are complex conjugates, in which case the cubic has one real and two non-real roots.

It was explained above how to use the sign of the discriminant in order to distinguish between these cases. In fact,

$\Delta ={\bigl (}a^{2}(r_{1}-r_{2})(r_{1}-r_{3})(r_{2}-r_{3}){\bigr )}^{2},$

(3)

because a straightforward computation shows that

{\begin{aligned}&{\bigl (}a^{2}(r_{1}-r_{2})(r_{1}-r_{3})(r_{2}-r_{3}){\bigr )}^{2}\\[6pt]={}&a^{4}{\bigl (}18(r_{1}+r_{2}+r_{3})(r_{1}r_{2}+r_{1}r_{3}+r_{2}r_{3})r_{1}r_{2}r_{3}\\[4pt]&{}-4(r_{1}+r_{2}+r_{3})^{3}r_{1}r_{2}r_{3}+(r_{1}+r_{2}+r_{3})^{2}(r_{1}r_{2}+r_{1}r_{3}+r_{2}r_{3})^{2}\\[4pt]&{}-4(r_{1}r_{2}+r_{1}r_{3}+r_{2}r_{3})^{3}-27(r_{1}r_{2}r_{3})^{2}{\bigr )}\end{aligned}}

and, by Vieta's formulas, the right hand side of this equality is equal to

$a^{4}\left(18{\frac {b}{a}}\cdot {\frac {c}{a}}\cdot {\frac {d}{a}}-4\left({\frac {b}{a}}\right)^{3}{\frac {d}{a}}+\left({\frac {b}{a}}\right)^{2}\left({\frac {c}{a}}\right)^{2}-4\left({\frac {c}{a}}\right)^{3}-27\left({\frac {d}{a}}\right)^{2}\right)=\Delta .$

The equality (3) shows that Δ = 0 if and only if the equation has a multiple root. This cannot possibly be the case when r2 and r3 are non-real complex numbers, because the fact that r1 is real assures that r1 is different from r2 and from r3 and, on the other hand, the fact that r2 and r3 are non-real and that each of them is the conjugate of the other one assures that r2r3.

If r2 and r3 are non-real, then

{\begin{aligned}(r_{1}-r_{2})(r_{1}-r_{3})(r_{2}-r_{3})&=(r_{1}-r_{2}){\bigl (}r_{1}-{\overline {r_{2}}}{\bigr )}{\bigl (}r_{2}-{\overline {r_{2}}}{\bigr )}\\[4pt]&=(r_{1}-r_{2}){\overline {(r_{1}-r_{2})}}2\operatorname {Im} (r_{2})i\\[4pt]&=2|r_{1}-r_{2}|^{2}\operatorname {Im} (r_{2})i\end{aligned}}

Since this is the product of a non-zero real number by i, its square is a real number less than 0 and therefore Δ < 0. Finally, if the numbers r1, r2, and r3 are three distinct real numbers, then the product (r1r2)(r1r3)(r2r3) is a non-zero real number, and so Δ > 0.

### Geometric interpretation of the roots

#### Three real roots

Viète's trigonometric expression of the roots in the three-real-roots case lends itself to a geometric interpretation in terms of a circle. When the cubic is written in depressed form (2), t3 + pt + q = 0, as shown above, the solution can be expressed as

$t_{k}=2{\sqrt {-{\frac {p}{3}}}}\cos \left({\frac {1}{3}}\arccos \left({\frac {3q}{2p}}{\sqrt {\frac {-3}{p}}}\right)-k{\frac {2\pi }{3}}\right)\quad {\text{for}}\quad k=0,1,2\,.$

Here $\arccos \left({\frac {3q}{2p}}{\sqrt {\frac {-3}{p}}}\right)$  is an angle in the unit circle; taking 1/3 of that angle corresponds to taking a cube root of a complex number; adding k2π/3 for k = 1, 2 finds the other cube roots; and multiplying the cosines of these resulting angles by $2{\sqrt {-{\frac {p}{3}}}}$  corrects for scale.

For the non-depressed case (1) (shown in the accompanying graph), the depressed case as indicated previously is obtained by defining t such that x = tb/3a so t = x + b/3a. Graphically this corresponds to simply shifting the graph horizontally when changing between the variables t and x, without changing the angle relationships. This shift moves the point of inflection and the centre of the circle onto the y-axis. Consequently, the roots of the equation in t sum to zero.

#### One real and two complex roots

##### In the Cartesian plane

The slope of line RA is twice that of RH. Denoting the complex roots of the cubic as g ± hi, g = OM (negative here) and h = tan ORH = slope of line RH = BE = DA.

If a cubic is plotted in the Cartesian plane, the real root can be seen graphically as the horizontal intercept of the curve. But further, if the complex conjugate roots are written as g ± hi then g is the abscissa (the positive or negative horizontal distance from the origin) of the tangency point of a line that is tangent to the cubic curve and intersects the horizontal axis at the same place as does the cubic curve; and h is the square root of the tangent of the angle between this line and the horizontal axis.

##### In the complex plane

With one real and two complex roots, the three roots can be represented as points in the complex plane, as can the two roots of the cubic's derivative. There is an interesting geometrical relationship among all these roots.

The points in the complex plane representing the three roots serve as the vertices of an isosceles triangle. (The triangle is isosceles because one root is on the horizontal (real) axis and the other two roots, being complex conjugates, appear symmetrically above and below the real axis.) Marden's theorem says that the points representing the roots of the derivative of the cubic are the foci of the Steiner inellipse of the triangle—the unique ellipse that is tangent to the triangle at the midpoints of its sides. If the angle at the vertex on the real axis is less than π/3 then the major axis of the ellipse lies on the real axis, as do its foci and hence the roots of the derivative. If that angle is greater than π/3, the major axis is vertical and its foci, the roots of the derivative, are complex conjugates. And if that angle is π/3, the triangle is equilateral, the Steiner inellipse is simply the triangle's incircle, its foci coincide with each other at the incenter, which lies on the real axis, and hence the derivative has duplicate real roots.

## Derivation of the roots

### Cardano's method

The solutions can be found with the following method due to Scipione del Ferro and Tartaglia, published by Gerolamo Cardano in 1545 in his book Ars Magna. This method applies to the depressed cubic (2), t3 + pt + q = 0. We introduce two variables u and v linked by the condition u + v = t and substitute this in the depressed cubic (2), giving

$u^{3}+v^{3}+(3uv+p)(u+v)+q=0.$

At this point Cardano imposed a second condition for the variables u and v: 3uv + p = 0. As the first parenthesis vanishes in previous equality, we get u3 + v3 = −q and u3v3 = − p3/27. The combination of these two equations leads to a quadratic equation (since they are the sum and the product of u3 and v3). Thus u3 and v3 are the two roots of the quadratic equation z2 + qzp3/27 = 0. Cardano assumed that q2/4 + p3/27 ≥ 0. He suggested that his readers consult another of his books, De Regula Aliza, which was published only in 1570, for the case in which q2/4 + p3/27 < 0. Solving this quadratic equation and using the fact that u and v may be exchanged, we find

$u^{3}=-{q \over 2}+{\sqrt {{q^{2} \over 4}+{p^{3} \over 27}}}\,\,\,$  and $\,\,\,v^{3}=-{q \over 2}-{\sqrt {{q^{2} \over 4}+{p^{3} \over 27}}}.$

Therefore, u + v is equal to:

$t={\sqrt[{3}]{-{q \over 2}+{\sqrt {{q^{2} \over 4}+{p^{3} \over 27}}}}}+{\sqrt[{3}]{-{q \over 2}-{\sqrt {{q^{2} \over 4}+{p^{3} \over 27}}}}}.$

(Cardano's formula)

In his book L'Algebra, published in 1572, Rafael Bombelli explained that what was done above still works, with a small difference, when q2/4 + p3/27 < 0, as long as one knows how to use complex numbers. The small difference is due to the fact that a non-zero complex number has three cube roots and not just one. Therefore, although the equality uv = − p/3 implies that u3v3 = − p3/27, this is not an equivalence. So, we do not simply take any cube root of

$-{\frac {q}{2}}+{\sqrt {{\frac {q^{2}}{4}}+{\frac {p^{3}}{27}}}}$

(4)

and add it to any cube root of

$-{\frac {q}{2}}-{\sqrt {{\frac {q^{2}}{4}}+{\frac {p^{3}}{27}}}}$

(5)

(unless one of them is 0); besides, that would provide 9 solutions to equation (2). Instead, since we want to have 3uv = −p, Cardano's formula means the sum of a cube root u of (4) with p/3u (or, if (4) is equal to 0, the sum of a cube root v of (5) with p/3v). This only fails if both numbers (4) and (5) are equal to 0, in which case p = q = 0 and Cardano's formula simply means t = 30 + 30 (= 0), which is compatible with the fact that, since p = q = 0, (2) simplifies to t3 = 0.

Actually, it is not necessary to compute the three cube roots of (4). To see why, let ξ = −1/2 + 1/23i. Then ξ and ξ (= −1/21/23i = ξ2) are the non-real cube roots of 1. If u is a cube root of (4), and v is a cube root of (5) such that 3uv = −p, then the roots of (2) are u + v, ξu + ξv, and ξu + ξv, since, in each case, we have the sum of a cube root of (4) with a cube root (5) and moreover the product of these two roots is, in each case, equal to − p/3.

Note that ξ3 = 1 and that ξ4 = ξ. Thus Cardano's formula, written unambiguously to give the three roots, is

$t_{k}=\xi ^{k}{\sqrt[{3}]{-{q \over 2}+{\sqrt {{q^{2} \over 4}+{p^{3} \over 27}}}}}+\xi ^{2k}{\sqrt[{3}]{-{q \over 2}-{\sqrt {{q^{2} \over 4}+{p^{3} \over 27}}}}},\quad k=0,1,2,$

where the cube roots expressed as radicals are defined to be any pair of cube roots whose product is − p/3. If p and q are real and q2/4 + p3/27 < 0, this is the same thing as requiring that the cube roots be complex conjugates, while if p and q are real and q2/4 + p3/27 ≥ 0, the real cube roots can be chosen.

Cardano's formula, interpreted in this way, is equivalent to the general solution given earlier when the coefficient of the quadratic term is 0.

We will examine certain particular cases. Before that, it is convenient to note that, if u is a cube root of (4), if v is a cube root of (5), and if both numbers p and u×v are real, then it is automatically true that u×v = − p/3. This is so because

(u×v)3 = u3×v3 = q2/4 − (q2/4 + p3/27) = − p3/27 = (− p/3)3.

Let us now see the particular cases.

• If p and q are real numbers and q2/4 + p3/27 > 0, let u be the real cube root of (4) and let v be the real cube root of (5). Then u×v = − p/3, because u×v is real. So, the roots of the equation (2) are u + v (which is a real number), ξu + ξv, and ξu + ξv. Each of the second and the third roots is the conjugate of the other one. This can be used to prove that they are non-real. Indeed, two real numbers are the conjugates of each other if and only if they are the same real number. But
ξu + ξv = ξu + ξv ⇔ (ξξ)(uv) = 0,
and this last assertion is false, since ξξ and uv (because u and v are real numbers whose cubes are distinct).
• If p and q are real numbers and q2/4 + p3/27 < 0, then the numbers (4) and (5) are complex numbers each of which is the conjugate of the other one. Let u be a cube root of (4) and let v be the conjugate of u. Then v3 is the conjugate of u3 and this proves that v3 is equal to (5). So, again, since u×v is real we have u×v = − p/3, and therefore the roots of the equation (2) are u + u, ξu + ξu, and ξu + ξu. In this case all roots are real, since each one of them is the sum of a complex number with its conjugate.
• If p = 0, then the roots of the equation (2) are the cube roots of q. This is compatible with Cardano's formula, because one of (4) or (5) is 0 and the other is q.
• If q = 0, then the roots of (2) are 0 and the square roots of p. Again, this is compatible with Cardano's formula, because if u is a square root of p3, then u3 is a square root of p3/27, and this square root is equal to (4) or to (5), since we are assuming that q = 0. If v = −u is the other square root of p3 then, by the same reason, v3 is equal to (4) or to (5) and furthermore if u is equal to (4) then v is equal to (5) and vice versa. Because v = −u we have u + v= 0. On the other hand, ξu + ξv = (ξξu and so (ξu + ξv)2 = (ξξ)2×u2 = (−3)×p/3 = −p, which means that ξu + ξv is a square root of p. Finally, ξu + ξv = (ξξu = −(ξu + ξv), and so it must be the other square root of p.
• If q2/4 + p3/27 = 0 (but p and q are not 0), then (2) has a simple root, which is 3q/p, and a double root, which is 3q/2p. Again, this is compatible with Cardano's formula. To see why, note that asserting that q2/4 + p3/27 = 0 is equivalent to asserting that 27q2/4p3 = −1. If u = v = 3q/2p, then u3 = v3 = 27q3/8p3 = −q/2 and 3uv = 27q2/4p2 = −p. Thus, Cardano's formula says that the roots of (2) are u + v = 2u = 3q/p, ξu + ξv = (ξ + ξu = −3q/2p, and ξu + ξv = (ξ + ξu = −3q/2p.

In this last case (that is, when q2/4 + p3/27 = 0 but p and q are not 0), although the computations made above do suggest that 3q/p is a simple root of (2) whereas 3q/2p is a double root (having been obtained in two different ways), they don't really prove it. However, this can be easily confirmed. Just note that

{\begin{aligned}\left(x-{\frac {3q}{p}}\right)\left(x+{\frac {3q}{2p}}\right)^{2}&=x^{3}-{\frac {27q^{2}}{4p^{2}}}x-{\frac {27q^{3}}{4p^{3}}}\\&=x^{3}-{\frac {27q^{2}}{4p^{3}}}px-{\frac {27q^{2}}{4p^{3}}}q\\&=x^{3}+px+q{\text{,}}\end{aligned}}

since 27q2/4p3 = −1.

The numbers provided by Cardano's formula are solutions of the equation (2), and there are no other solutions. Let u and v be numbers such that u3 + v3 = −q and 3uv = −p. In order to see that u + v, ξu + ξv, and ξu + ξv are the only roots of the polynomial t3 + pt + q, it is enough to notice that

{\begin{aligned}{\bigl (}t-{\bigl (}u+v{\bigr )}{\bigr )}{\bigl (}t-{\bigl (}\xi u+{\overline {\xi }}v{\bigr )}{\bigr )}{\bigl (}t-{\bigl (}{\overline {\xi }}u+\xi v{\bigr )}{\bigr )}&=t^{3}-3uvt-u^{3}-v^{3}\\&=t^{3}+pt+q{\text{.}}\end{aligned}}

Therefore, t3 + pt + q = 0 if and only if t = u + v, t = ξu + ξv or t = ξu + ξv.

### Vieta's substitution

Starting from the depressed cubic (2), t3 + pt + q = 0, we make the substitution t = wp/3w, known as Vieta's substitution. This results in the equation

$w^{3}+q-{\frac {p^{3}}{27w^{3}}}=0.$

Multiplying by w3, it becomes a sextic equation in w, which is in fact a quadratic equation in w3:

$w^{6}+qw^{3}-{\frac {p^{3}}{27}}=0.$

(6)

The quadratic formula allows equation (6) to be solved for w3. If w1, w2 and w3 are the three cube roots of one of the solutions in w3, then the roots of the original depressed cubic are w1p/3w1, w2p/3w2, and w3p/3w3. Another way of expressing the roots is to take ξ = −1/2 + 1/23i; then the roots of the original depressed cubic are w1p/3w1, ξw1p/3ξw1, and, ξ2w1p/3ξ2w1. This method only fails when both roots of the equation (6) are equal to 0, but this only happens when p = q = 0, in which case the only solution of equation (2) is 0.

Actually, the substitution originally used by Vieta (in a text published posthumously in 1615) was t = p/3ww, but it leads to similar computations. More precisely, Vieta introduced a new variable w and he imposed the condition w(t + w) = p/3.

As far as formulae are concerned, Vieta's approach leads to the same result as Cardano's method. However, it is theoretically simpler, for two reasons:

• Each root of the equation (2) is expressed from the start by an expression that involves a single cube root. Therefore, there is no ambiguity as in Cardano's formula.
• It is nearly trivial that there are no other roots besides the ones obtained by this method. This follows from the fact that any complex number can be written as wp/3w for some other complex number w.

### Lagrange's method

In his paper Réflexions sur la résolution algébrique des équations ("Thoughts on the algebraic solving of equations"), Joseph Louis Lagrange introduced a new method to solve equations of low degree.

This method works well for cubic and quartic equations, but Lagrange did not succeed in applying it to a quintic equation, because it requires solving a resolvent polynomial of degree at least six. This is explained by the Abel–Ruffini theorem, which proves that such polynomials cannot be solved by radicals. Nevertheless, the modern methods for solving solvable quintic equations are mainly based on Lagrange's method.

In the case of cubic equations, Lagrange's method gives the same solution as Cardano's. By drawing attention to a geometrical problem that involves two cubes of different size Cardano explains in his book Ars Magna how he arrived at the idea of considering the unknown of the cubic equation as a sum of two other quantities. Lagrange's method may also be applied directly to the general cubic equation (1), ax3 + bx2 + cx + d = 0, without using the reduction to the depressed cubic equation (2), t3 + pt + q = 0. Nevertheless, the computation is much easier with this reduced equation.

Suppose that x0, x1 and x2 are the roots of equation (1) or (2), and define ξ = −1/2 + 1/23i (a complex cube root of 1, i.e. a primitive third root of unity) which satisfies the relation ξ2 + ξ + 1 = 0. We now set

$s_{0}=x_{0}+x_{1}+x_{2},\,$
$s_{1}=x_{0}+\xi x_{1}+\xi ^{2}x_{2},\,$
$s_{2}=x_{0}+\xi ^{2}x_{1}+\xi x_{2}.\,$

This is the discrete Fourier transform of the roots: observe that while the coefficients of the polynomial are symmetric in the roots, in this formula an order has been chosen on the roots, so these are not symmetric in the roots. The roots may then be recovered from the three si by inverting the above linear transformation via the inverse discrete Fourier transform, giving

$x_{0}={\tfrac {1}{3}}(s_{0}+s_{1}+s_{2}),\,$
$x_{1}={\tfrac {1}{3}}(s_{0}+\xi ^{2}s_{1}+\xi s_{2}),\,$
$x_{2}={\tfrac {1}{3}}(s_{0}+\xi s_{1}+\xi ^{2}s_{2}).\,$

The polynomial s0 is equal, by Vieta's formulas, to b/a in case of equation (1) and to 0 in case of equation (2), so we only need to seek values for the other two.

The polynomials s1 and s2 are not symmetric functions of the roots: s0 is invariant, while the two non-trivial cyclic permutations of the roots send s1 to ξs1 and s2 to ξ2s2, or s1 to ξ2s1 and s2 to ξs2 (depending on which permutation), while transposing x1 and x2 switches s1 and s2; other transpositions switch these sums and multiply them by a power of ξ.

Thus s13, s23 and s1s2 are left invariant by the cyclic permutations of the roots, which multiply them by ξ3 = 1. Also s1s2 and s13 + s23 are left invariant by the transposition of x1 and x2 which exchanges s1 and s2. As the permutation group S3 of the roots is generated by these permutations, it follows that s13 + s23 and s1s2 are symmetric functions of the roots and may thus be written as polynomials in the elementary symmetric polynomials and thus as rational functions of the coefficients of the equation. Let s13 + s23 = A and s1s2 = B in these expressions, which will be explicitly computed below.

We have that s13 and s23 are the two roots of the quadratic equation z2Az + B3 = 0. Thus the resolution of the equation may be finished exactly as described for Cardano's method, with s1 and s2 in place of u and v.

#### Computation of A and B

Setting E1 = x0 + x1 + x2, E2 = x0x1 + x1x2 + x2x0 and E3 = x0x1x2, the elementary symmetric polynomials, we have, using that ξ3 = 1:

$s_{1}^{3}=x_{0}^{3}+x_{1}^{3}+x_{2}^{3}+3\xi (x_{0}^{2}x_{1}+x_{1}^{2}x_{2}+x_{2}^{2}x_{0})+3\xi ^{2}(x_{0}x_{1}^{2}+x_{1}x_{2}^{2}+x_{2}x_{0}^{2})+6x_{0}x_{1}x_{2}\,.$

The expression for s23 is the same with ξ and ξ2 exchanged. Thus, using ξ2 + ξ = −1 we get

$A=s_{1}^{3}+s_{2}^{3}=2(x_{0}^{3}+x_{1}^{3}+x_{2}^{3})-3(x_{0}^{2}x_{1}+x_{1}^{2}x_{2}+x_{2}^{2}x_{0}+x_{0}x_{1}^{2}+x_{1}x_{2}^{2}+x_{2}x_{0}^{2})+12x_{0}x_{1}x_{2}\,,$

and a straightforward computation gives

$A=s_{1}^{3}+s_{2}^{3}=2E_{1}^{3}-9E_{1}E_{2}+27E_{3}\,.$

Similarly we have

$B=s_{1}s_{2}=x_{0}^{2}+x_{1}^{2}+x_{2}^{2}+(\xi +\xi ^{2})(x_{0}x_{1}+x_{1}x_{2}+x_{2}x_{0})=E_{1}^{2}-3E_{2}\,.$

When solving equation (1) we have E1 = −b/a, E2 = c/a and E3 = −d/a. With equation (2), we have E1 = 0, E2 = p and E3 = −q and thus A = −27q and B = −3p.

Note that with equation (2), we have x0 = 1/3(s1 + s2) and s1s2 = −3p, while in Cardano's method we have set x0 = u + v and uv = −1/3p. Thus we have, up to the exchange of u and v, s1 = 3u and s2 = 3v . In other words, in this case, Cardano's method and Lagrange's method compute exactly the same things, up to a factor of three in the auxiliary variables, the main difference being that Lagrange's method explains why these auxiliary variables appear in the problem.

## General solution to the cubic equation with arbitrary coefficients

If a cubic equation has coefficients belonging to some field k (whose characteristic is either 0 or greater than 3), then what was done above algebraically still works, with one exception: the results concerning the sign of the discriminant, since they make no sense for general fields, although the fact that the equation has a multiple root if and only if Δ = 0 is still true (and for the same reason). In this more general case, we work with an extension K of k in which every non-zero element has two square roots and three cube roots. For instance, if k = Q, we can take K = Q, the field of algebraic numbers.

In particular, all that was done above algebraically still works if k = K = C. Therefore, every cubic equation with complex coefficients has some complex root, which is a particular case of the fundamental theorem of algebra.

In this general context, the formulae for roots in the case in which Δ = 0 show that these roots also belong to the field k.

In a field k whose characteristic is either 2 or 3, this approach does not work because then the formulae for the roots became meaningless, since they involve division by 2 and 3.

## Galois groups of irreducible cubics

The Galois group of an irreducible separable polynomial of degree n is a transitive subgroup of Sn. In particular, the Galois group of an irreducible separable cubic is a transitive subgroup of S3 and there are only two such subgroups: S3 and A3. There is a simple way of determining the Galois group of a concrete irreducible cubic f(x) over a field k: it is A3 if the discriminant of the cubic is the square of an element of k and S3 otherwise. Indeed, if Δ is not the square of an element of k, then k[Δ] is an extension of degree 2 of k. On the other hand, if r1, r2, and r3 are the roots of f(x), then, since the equality (3) holds, that is, since Δ = (a2(r1r2)(r1r3)(r2r3))2, k[Δ] ⊂ k[r1, r2, r3], and so, by the multiplicativity formula for degrees, the degree of k[r1, r2, r3] over k (that is, the order of the Galois group of f(x)) must be a multiple of the degree of k[Δ], which is 2. Therefore, it must be an even number, and so the Galois group can only be S3.

On the other hand, if Δ is the square of an element of k, then, again by the equality (3), we have (r1r2)(r1r3)(r2r3) ∈ k. Therefore, if σ belongs to the Galois group of f(x), then σ maps (r1r2)(r1r3)(r2r3) into itself. But then σ cannot act on the set {r1, r2, r3} as the transposition that exchanges r1 and r2 and leaves r3 fixed, because then σ would map (r1r2)(r1r3)(r2r3) into −(r1r2)(r1r3)(r2r3). So, in this case, the Galois group of f(x) is not S3 and therefore it must be A3.

It is clear from this criterion that, if we are working over the field Q, the Galois group of most irreducible cubic polynomials is S3. An example of an irreducible cubic polynomial with rational coefficients whose Galois group is A3 is p(x) = x3 − 3x − 1, whose discriminant is 81 = 92. The polynomial p(x) is used in the standard proof of the impossibility of trisecting arbitrary angles using straightedge and compass only.

## Collinearities

The points P1, P2, and P3 (in blue) are collinear and belong to the graph of x3 + 3/2x25/2x + 5/4. The points T1, T2, and T3 (in red) are the intersections of the (dotted) tangent lines to the graph at these points with the graph itself. They are collinear too.

The tangent lines to a cubic at three collinear points intercept the cubic again at collinear points. This can be seen as follows. If the cubic is defined by f(x) = ax3 + bx2 + cx + d and if α is a real number, then the tangent to the graph of f at the point (α, f(α)) is the line

{(x, f(α) + (xα)f ′(α)) : xR}.

So, the intersection point between this line and the graph of f can be obtained solving the equation f(x) = f(α) + (xα)f ′(α). This is a cubic equation, but it is clear that α is a root, and in fact a double root, since the line is tangent to the graph. The remaining root is b/a − 2α. So, the other intersection point between the tangent line and the graph of f is the point

{\begin{aligned}&\left(-{\frac {b}{a}}-2\alpha ,f\left(-{\frac {b}{a}}-2\alpha \right)\right)\\[3pt]={}&\left(-{\frac {b}{a}}-2\alpha ,-8a\alpha ^{3}-8b\alpha ^{2}-2\left({\frac {b^{2}}{a}}+c\right)\alpha -{\frac {bc}{a}}+d\right)\\[3pt]={}&\left(-{\frac {b}{a}}-2\alpha ,-{\frac {bc}{a}}+9d+\left(6c-2{\frac {b^{2}}{a}}\right)\alpha -8f(\alpha )\right).\end{aligned}}

Therefore, if P is a point of the graph of f, the other intersection point between the tangent line at P and the graph is the point A(P), where A is the map defined by

{\begin{aligned}A:\mathbb {R} ^{2}&\longrightarrow \mathbb {R} ^{2}\\[4pt](x,y)&\mapsto \left(-{\frac {b}{a}}-2x,-{\frac {bc}{a}}+9d+\left(6c-2{\frac {b^{2}}{a}}\right)x-8y\right).\end{aligned}}

Since A is an affine map, if P1, P2, and P3 are collinear, then so are the points A(P1), A(P2), and A(P3).

## Symmetry

The graph of a cubic function has 180° rotational or point symmetry about its inflection point. The inflection point of a general cubic polynomial,

$f(x)=ax^{3}+bx^{2}+cx+d$

occurs at a point (x0, f(x0)) such that f ′′(x0) = 0. Since f ′′(x) = 6ax + 2b, the inflection point is (−b/3a, 2b3/27a2bc/3a + d ). Translating the function so that the inflection point is at the origin, one obtains the function fT defined by:

{\begin{aligned}f_{T}(x)&=f\left(x+x_{0}\right)-y_{0}\\&=a\left(x-{\frac {b}{3a}}\right)^{3}+\ b\left(x-{\frac {b}{3a}}\right)^{2}+\ c\left(x-{\frac {b}{3a}}\right)+\ d\ -\left({\frac {2b^{3}}{27a^{2}}}-{\frac {bc}{3a}}+d\right)\\&=ax^{3}+\left(c-{\frac {b^{2}}{3a}}\right)x.\end{aligned}}

As all terms are odd powers of x, fT (−x) = −fT (x) proving that all cubic functions are rotationally symmetrical about their inflection points.

## Applications

Cubic equations arise in various other contexts.

Marden's theorem states that the foci of the Steiner inellipse of any triangle can be found by using the cubic function whose roots are the coordinates in the complex plane of the triangle's three vertices. The roots of the first derivative of this cubic are the complex coordinates of those foci.

The area of a regular heptagon can be expressed in terms of the roots of a cubic. Further, the ratios of the long diagonal to the side, the side to the short diagonal, and the negative of the short diagonal to the long diagonal all satisfy a particular cubic equation. In addition, the ratio of the inradius to the circumradius of a heptagonal triangle is one of the solutions of a cubic equation. The values of trigonometric functions of angles related to $2\pi /7$  satisfy cubic equations.

Given the cosine (or other trigonometric function) of an arbitrary angle, the cosine of one-third of that angle is one of the roots of a cubic.

The solution of the general quartic equation relies on the solution of its resolvent cubic.

The eigenvalues of a 3×3 matrix are the roots of a cubic polynomial which is the characteristic polynomial of the matrix.

The characteristic equation of a third-order linear difference equation or differential equation is a cubic equation.

In analytical chemistry, the Charlot equation, which can be used to find the pH of buffer solutions, can be solved using a cubic equation.

In chemical engineering and thermodynamics, cubic equations of state are used to model the PVT (pressure, volume, temperature) behavior of substances.

Kinematic equations involving changing rates of acceleration are cubic.

The speed of seismic Rayleigh waves is a solution of the Rayleigh wave cubic equation.