# Cubic function

{{#invoke:Hatnote|hatnote}}

Graph of a cubic function with 3 real roots (where the curve crosses the horizontal axis—where y = 0). It has 2 critical points. Here the function is ƒ(x) = (x3 + 3x2 − 6x − 8) / 4.

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

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

where a is nonzero. In other words, a cubic function is defined by a polynomial of degree three.

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

${\displaystyle ax^{3}+bx^{2}+cx+d=0.\,}$

Usually, the coefficients a, b, c, d are real numbers. However much of the theory of cubic equations for real coefficients applies to other types of coefficients (such as complex ones).[1]

Solving the cubic equation is equivalent to finding the particular value (or values) of x for which ƒ(x) = 0. There are various methods to solve cubic equations. The solutions, also called roots, of a cubic equation can always be found algebraically. (This is also true of a quadratic or quartic (fourth degree) equation but no higher degree equation by the Abel–Ruffini theorem). The roots can also be found trigonometrically. Alternatively, one can find a numerical approximation of the roots in the field of the real or complex numbers such as by using root-finding algorithms like Newton's method.

## History

Cubic equations were known to the ancient Babylonians, Greeks, Chinese, Indians, and Egyptians.[2][3][4] Babylonian (20th to 16th centuries BC) cuneiform tablets have been found with tables for calculating cubes and cube roots.[5][6] The Babylonians could have used the tables to solve cubic equations, but no evidence exists to confirm that they did.[7] 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.[8] 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,[9] 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.[3] In the 3rd century, the ancient Greek mathematician Diophantus found integer or rational solutions for some bivariate cubic equations (Diophantine equations).[4][10] Hippocrates, Menaechmus and Archimedes are believed to have come close to solving the problem of doubling the cube using intersecting conic sections,[9] 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 cones, but also discussed the conditions where the roots are 0, 1 or 2.[11]

Two-dimensional graph of a cubic, the polynomial ƒ(x) = 2x3 − 3x2 − 3x + 2.

In the 7th century, the Tang dynasty astronomer mathematician Wang Xiaotong in his mathematical treatise titled Jigu Suanjing systematically established and solved 25 cubic equations of the form ${\displaystyle x^{3}+px^{2}+qx=N}$, 23 of them with ${\displaystyle p,q\neq 0}$, and two of them with ${\displaystyle q=0}$.[12]

In the 11th century, the Persian poet-mathematician, Omar Khayyám (1048–1131), made significant progress in the theory of cubic equations. In an early paper he wrote regarding cubic equations, 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.[13][14] 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.[15][16]

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:[17]

${\displaystyle x^{3}+12x=6x^{2}+35\,}$

In the 12th century, another Persian mathematician, Sharaf al-Dīn al-Tūsī (1135–1213), wrote the Al-Mu'adalat (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 developed the concepts of a derivative function and the maxima and minima of curves in order to solve cubic equations which may not have positive solutions.[18] He understood the importance of the discriminant of the cubic equation to find algebraic solutions to certain types of cubic equations.[19]

Leonardo de Pisa, also known as Fibonacci (1170–1250), was able to find the positive solution to the cubic equation x3 + 2x2 + 10x = 20, using the 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),[20] which differs from the correct value by only about three trillionths.

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.

Niccolò Fontana Tartaglia

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 reveal a book about cubics, that 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 6 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.[21]

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.[22]

## Critical points of a cubic function

Template:Cubic graph special points.svg The critical points of a cubic equation are those values of x where the slope of the cubic function is zero. They are found by setting derivative of the cubic equation equal to zero obtaining: f ′(x) = 3ax2 + 2bx + c = 0. The solutions of that equation are the critical points of the cubic equation and are given by: (using the quadratic formula)

${\displaystyle x={\frac {-b\pm {\sqrt {b^{2}-3ac}}}{3a}}.}$

If b2 − 3ac > 0, then the cubic function has a local maximum and a local minimum. If b2 − 3ac = 0, then the cubic's inflection point is the only critical point. If b2 − 3ac < 0, then there are no critical points. In the cases where b2 − 3ac ≤ 0, the cubic function is strictly monotonic.

## Roots of a cubic function

The general cubic equation has the form

${\displaystyle ax^{3}+bx^{2}+cx+d=0\qquad (1)}$

This section describes how the roots of such an equation may be computed. The coefficients a, b, c, d are generally assumed to be real numbers, but most of the results apply when they belong to any field of characteristic not 2 or 3.

### The nature of the roots

Every cubic equation (1) with real coefficients has at least one solution x among the real numbers; this is a consequence of the intermediate value theorem. We can distinguish several possible cases using the discriminant,

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

The following cases need to be considered: [23]

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

For information about the location in the complex plane of the roots of a polynomial of any degree, including degree three, see Properties of polynomial roots and Routh–Hurwitz stability criterion

### General formula for roots

For the general cubic equation

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

the general formula for the roots, in terms of the coefficients, is as follows:[24]

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

where

${\displaystyle u_{1}=1\ ,\qquad u_{2}={-1+i{\sqrt {3}} \over 2}\ ,\qquad u_{3}={-1-i{\sqrt {3}} \over 2}}$

are the three cube roots of unity, and where

${\displaystyle C={\sqrt[{3}]{\frac {\Delta _{1}+{\sqrt {\Delta _{1}^{2}-4\Delta _{0}^{3}}}}{2}}}\qquad \qquad {\color {white}.}}$ (see below for special cases)

with

{\displaystyle {\begin{aligned}\Delta _{0}&=b^{2}-3ac\\\Delta _{1}&=2b^{3}-9abc+27a^{2}d\end{aligned}}}

and

${\displaystyle \Delta _{1}^{2}-4\Delta _{0}^{3}=-27\,a^{2}\,\Delta \ ,}$ where ${\displaystyle \Delta }$ is the discriminant discussed above.

In these formulae, ${\displaystyle {\sqrt {~~}}}$ and ${\displaystyle {\sqrt[{3}]{~~}}}$ denote any choice for the square or cube roots. Changing of choice for the square root amounts to exchanging ${\displaystyle x_{2}}$ and ${\displaystyle x_{3}}$. Changing of choice for the cube root amounts to circularly permuting the roots. Thus the freeness of choosing a determination of the square or cube roots corresponds exactly to the freeness for numbering the roots of the equation.

Four centuries ago, Gerolamo Cardano proposed a similar formula (see below), which still appears in many textbooks:

${\displaystyle x_{k}=-{\frac {1}{3a}}\left(b\ +\ u_{k}C\ +\ {\bar {u}}_{k}{\bar {C}}\right)}$

where

${\displaystyle {\bar {C}}={\sqrt[{3}]{\frac {\Delta _{1}-{\sqrt {\Delta _{1}^{2}-4\Delta _{0}^{3}}}}{2}}}}$

However, this formula is applicable without further explanation only when a, b, c, d are real numbers and the operand of the square root, ie, ${\displaystyle \Delta _{1}^{2}-4\Delta _{0}^{3}}$, is non-negative. When this operand is real and non-negative, the square root refers to the principal (positive) square root and the cube roots in the formula are to be interpreted as the real ones. Otherwise, there is no real square root and one can arbitrarily choose one of the imaginary square roots (the same one everywhere in the solution). For extracting the complex cube roots of the resulting complex expression, we have also to choose among three cube roots in each part of each solution, giving nine possible combinations of one of three cube roots for the first part of the expression and one of three for the second. The correct combination is such that the two cube roots chosen for the two terms in a given solution expression are complex conjugates of each other (whereby the two imaginary terms in each solution cancel out).

The next sections describe how these formulas may be obtained.

#### Special cases

${\displaystyle x_{1}=x_{2}=x_{3}=-{\frac {b}{3a}}.}$

If ${\displaystyle \Delta =0}$ and ${\displaystyle \Delta _{0}\neq 0,}$ the above expression for the roots is correct but misleading, hiding the fact that no radical is needed to represent the roots. In fact, in this case, there is a double root,

${\displaystyle x_{1}=x_{2}={\frac {9ad-bc}{2\Delta _{0}}},}$

and a simple root

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

### Reduction to a depressed cubic

Dividing Equation (1) by ${\displaystyle a}$ and substituting ${\displaystyle x}$ by ${\displaystyle t-{\frac {b}{3a}}}$ (the Tschirnhaus transformation) we get the equation

${\displaystyle t^{3}+pt+q=0\qquad (2)}$

where

{\displaystyle {\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.

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 ${\displaystyle p}$ and ${\displaystyle q}$ and using the relation ${\displaystyle x=t-{\frac {b}{3a}}}$.

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

### 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.[25]

This method applies to the depressed cubic

${\displaystyle t^{3}+pt+q=0\,.\qquad (2)}$

We introduce two variables u and v linked by the condition

${\displaystyle u+v=t\,}$

and substitute this in the depressed cubic (2), giving

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

At this point Cardano imposed a second condition for the variables u and v:

${\displaystyle 3uv+p=0\,}$.

As the first parenthesis vanishes in (3), we get ${\displaystyle u^{3}+v^{3}=-q}$ and ${\displaystyle u^{3}v^{3}=-p^{3}/27}$. Thus ${\displaystyle u^{3}}$ and ${\displaystyle v^{3}}$ are the two roots of the equation

${\displaystyle z^{2}+qz-{p^{3} \over 27}=0\,.}$

At this point, Cardano, who did not know complex numbers, supposed that the roots of this equation were real, that is that ${\displaystyle {\frac {q^{2}}{4}}+{\frac {p^{3}}{27}}>0\,.}$

Solving this equation and using the fact that ${\displaystyle u}$ and ${\displaystyle v}$ may be exchanged, we find

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

As these expressions are real, their cube roots are well defined and, like Cardano, we get

${\displaystyle t_{1}=u+v={\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}}}}}}$

The two complex roots are obtained by considering the complex cube roots; the fact ${\displaystyle uv}$ is real implies that they are obtained by multiplying one of the above cube roots by ${\displaystyle \,{\tfrac {-1}{2}}+i{\tfrac {\sqrt {3}}{2}}\,}$ and the other by ${\displaystyle \,{\tfrac {-1}{2}}-i{\tfrac {\sqrt {3}}{2}}\,}$.

If ${\displaystyle {\frac {q^{2}}{4}}+{\frac {p^{3}}{27}}\,}$ is not necessarily positive, we have to choose a cube root of ${\displaystyle u^{3}}$. As there is no direct way to choose the corresponding cube root of ${\displaystyle v^{3}}$, one has to use the relation ${\displaystyle v=-{\frac {p}{3u}}}$, which gives

${\displaystyle u={\sqrt[{3}]{-{q \over 2}-{\sqrt {{q^{2} \over 4}+{p^{3} \over 27}}}}}\qquad (4)}$

and

${\displaystyle t=u-{\frac {p}{3u}}\,.}$

Note that the sign of the square root does not affect the resulting ${\displaystyle t}$, because changing it amounts to exchanging ${\displaystyle u}$ and ${\displaystyle v}$. We have chosen the minus sign to have ${\displaystyle u\neq 0}$ when ${\displaystyle p=0}$ and ${\displaystyle q\neq 0}$, in order to avoid a division by zero. With this choice, the above expression for ${\displaystyle t}$ always works, except when ${\displaystyle p=q=0}$, where the second term becomes 0/0. In this case there is a triple root ${\displaystyle t=0}$.

Note also that in several cases the solutions are expressed with fewer square or cube roots

If ${\displaystyle p=q=0}$ then we have the triple real root
${\displaystyle t=0.\,}$
If ${\displaystyle p=0}$ and ${\displaystyle q\neq 0}$ then
${\displaystyle u=-{\sqrt[{3}]{q}}{\text{ and }}v=0}$
and the three roots are the three cube roots of ${\displaystyle -q}$.
If ${\displaystyle p\neq 0}$ and ${\displaystyle q=0}$ then
${\displaystyle u={\sqrt {p \over 3}}\qquad {\text{and}}\qquad v=-{\sqrt {p \over 3}},}$
in which case the three roots are
${\displaystyle t=u+v=0,\qquad t=\omega _{1}u-{p \over 3\omega _{1}u}={\sqrt {-p}},\qquad t={u \over \omega _{1}}-{\omega _{1}p \over 3u}=-{\sqrt {-p}},}$
where
${\displaystyle \omega _{1}=e^{i{\frac {2\pi }{3}}}=-{\tfrac {1}{2}}+{\tfrac {\sqrt {3}}{2}}i.}$
Finally if ${\displaystyle 4p^{3}+27q^{2}=0{\text{ and }}p\neq 0}$, there is a double root and a simple root which may be expressed rationally in term of ${\displaystyle p{\text{ and }}q}$, but this expression may not be immediately deduced from the general expression of the roots:
${\displaystyle t_{1}=t_{2}=-{\frac {3q}{2p}}\quad {\text{and}}\quad t_{3}={\frac {3q}{p}}\,.}$

To pass from these roots of ${\displaystyle t}$ in Equation (2) to the general formulas for roots of ${\displaystyle x}$ in Equation (1), subtract ${\displaystyle {\frac {b}{3a}}}$ and replace ${\displaystyle p}$ and ${\displaystyle q}$ by their expressions in terms of ${\displaystyle a,b,c,d}$.

### Vieta's substitution

Starting from the depressed cubic

${\displaystyle t^{3}+pt+q=0,}$

we make the following substitution, known as Vieta's substitution:

${\displaystyle t=w-{\frac {p}{3w}}}$

This results in the equation

${\displaystyle 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:

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

The quadratic formula allows to solve it in 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

${\displaystyle t_{1}=w_{1}-{\frac {p}{3w_{1}}},\quad t_{2}=w_{2}-{\frac {p}{3w_{2}}}\quad {\text{and}}\quad t_{3}=w_{3}-{\frac {p}{3w_{3}}}.}$

### 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.[26][27][28] 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.[28]

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) without using the reduction to the depressed cubic equation (2). 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 ${\displaystyle \zeta =-{\tfrac {1}{2}}+{\tfrac {\sqrt {3}}{2}}i}$ (a complex cube root of 1, i.e. a primitive third root of unity) which satisfies the relation ${\displaystyle \zeta ^{2}+\zeta +1=0}$. We now set

${\displaystyle s_{0}=x_{0}+x_{1}+x_{2},\,}$
${\displaystyle s_{1}=x_{0}+\zeta x_{1}+\zeta ^{2}x_{2},\,}$
${\displaystyle s_{2}=x_{0}+\zeta ^{2}x_{1}+\zeta 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

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

The polynomial ${\displaystyle s_{0}}$ is an elementary symmetric polynomial and is thus equal to ${\displaystyle -b/a}$ in case of Equation (1) and to zero in case of Equation (2), so we only need to seek values for the other two.

The polynomials ${\displaystyle s_{1}}$ and ${\displaystyle s_{2}}$ are not symmetric functions of the roots: ${\displaystyle s_{0}}$ is invariant, while the two non-trivial cyclic permutations of the roots send ${\displaystyle s_{1}}$ to ${\displaystyle \zeta s_{1}}$ and ${\displaystyle s_{2}}$ to ${\displaystyle \zeta ^{2}s_{2}}$, or ${\displaystyle s_{1}}$ to ${\displaystyle \zeta ^{2}s_{1}}$ and ${\displaystyle s_{2}}$ to ${\displaystyle \zeta s_{2}}$ (depending on which permutation), while transposing ${\displaystyle x_{1}}$ and ${\displaystyle x_{2}}$ switches ${\displaystyle s_{1}}$ and ${\displaystyle s_{2}}$; other transpositions switch these roots and multiply them by a power of ${\displaystyle \zeta .}$

Thus, ${\displaystyle s_{1}^{3}}$, ${\displaystyle s_{2}^{3}}$ and ${\displaystyle s_{1}s_{2}}$ are left invariant by the cyclic permutations of the roots, which multiply them by ${\displaystyle \zeta ^{3}=1}$. Also ${\displaystyle s_{1}s_{2}}$ and ${\displaystyle s_{1}^{3}+s_{2}^{3}}$ are left invariant by the transposition of ${\displaystyle x_{1}}$ and ${\displaystyle x_{2}}$ which exchanges ${\displaystyle s_{1}}$ and ${\displaystyle s_{2}}$. As the permutation group ${\displaystyle S_{3}}$ of the roots is generated by these permutations, it follows that ${\displaystyle s_{1}^{3}+s_{2}^{3}}$ and ${\displaystyle s_{1}s_{2}}$ 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 ${\displaystyle s_{1}^{3}+s_{2}^{3}=A}$ and ${\displaystyle s_{1}s_{2}=B}$ in these expressions, which will be explicitly computed below.

We have that ${\displaystyle s_{1}^{3}}$ and ${\displaystyle s_{2}^{3}}$ are the two roots of the quadratic equation

${\displaystyle z^{2}-Az+B^{3}=0\,.}$

Thus the resolution of the equation may be finished exactly as described for Cardano's method, with ${\displaystyle s_{1}}$ and ${\displaystyle s_{2}}$ in place of ${\displaystyle u}$ and ${\displaystyle v}$.

#### Computation of A and B

${\displaystyle s_{1}^{3}=x_{0}^{3}+x_{1}^{3}+x_{2}^{3}+3\zeta (x_{0}^{2}x_{1}+x_{1}^{2}x_{2}+x_{2}^{2}x_{0})+3\zeta ^{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 ${\displaystyle s_{2}^{3}}$ is the same with ${\displaystyle \zeta }$ and ${\displaystyle \zeta ^{2}}$ exchanged. Thus, using ${\displaystyle \zeta ^{2}+\zeta =-1}$ we get

${\displaystyle 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

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

Similarly we have

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

When solving Equation (1) we have

${\displaystyle E_{1}=-b/a}$, ${\displaystyle E_{2}=c/a}$ and ${\displaystyle E_{3}=-d/a}$
${\displaystyle A=-27q}$ and ${\displaystyle B=-3p}$.

Note that with Equation (2), we have ${\displaystyle x_{0}={\tfrac {1}{3}}(s_{1}+s_{2})}$ and ${\displaystyle s_{1}s_{2}=-3p}$, while in Cardano's method we have set ${\displaystyle x_{0}=u+v}$ and ${\displaystyle uv=-{\frac {1}{3}}p\,.}$ Thus we have, up to the exchange of ${\displaystyle u}$ and ${\displaystyle v}$:

${\displaystyle s_{1}=3u}$ and ${\displaystyle s_{2}=3v}$.

In other words, in this case, Cardano's 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.

### Trigonometric (and hyperbolic) method

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,[29] 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,[22] are true in general (except when p = 0), 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), ${\displaystyle t^{3}+pt+q=0}$, let us set ${\displaystyle t=u\cos \theta \,.}$ The idea is to choose ${\displaystyle u}$ to make Equation (2) coincide with the identity

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

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

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

Combining with the above identity, we get

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

and thus the roots are[30]

${\displaystyle 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 ${\displaystyle p<0}$ and the argument of the arccosine is between −1 and 1. The last condition is equivalent to ${\displaystyle 4p^{3}+27q^{2}\leq 0\,,}$ which implies also ${\displaystyle p<0}$. Thus the above formula for the roots involves only real terms if and only if the three roots are real.

Denoting by ${\displaystyle C(p,q)}$ the above value of t0, and using the inequality ${\displaystyle -\pi \leq \arccos(u)\leq \pi }$ for a real number u such that ${\displaystyle -1\leq u\leq 1\,,}$ the three roots may also be expressed as

${\displaystyle 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

${\displaystyle t_{0}\geq t_{1}\geq t_{2}\,.}$

All these formulas may be straightforwardly transformed into formulas for the roots of the general cubic equation (1), using the back substitution described in Section Reduction to a depressed cubic.

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

${\displaystyle 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\,,}$
${\displaystyle 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\,.}$

If p ≠ 0 and the inequalities on the right are not satisfied the formulas remain valid but involve complex quantities.

When ${\displaystyle p=\pm 3}$, the above values of ${\displaystyle t_{0}}$ are sometimes called the Chebyshev cube root.[33] More precisely, the values involving cosines and hyperbolic cosines define, when ${\displaystyle p=-3}$, the same analytic function denoted ${\displaystyle C_{\frac {1}{3}}(q)}$, which is the proper Chebyshev cube root. The value involving hyperbolic sines is similarly denoted ${\displaystyle S_{\frac {1}{3}}(q),}$ when ${\displaystyle p=3}$.

### Factorization

If the cubic equation ${\displaystyle ax^{3}+bx^{2}+cx+d=0}$ with integer coefficients has a rational real root, it can be found using the rational root test: If the root is r = m / n 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 can be checked for whether they satisfy the cubic equation.

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. The rational root test is also helpful in the presence of one real and two complex roots because 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

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

Hence if we know one root we can find the other two by using the quadratic formula to solve the quadratic ${\displaystyle ax^{2}+(b+ar)x+c+br+ar^{2}}$, giving

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

for the other two roots.

### Geometric interpretation of the roots

#### Three real roots

For the cubic ${\displaystyle \scriptstyle x^{3}+bx^{2}+cx+d=0}$ with three real roots, the roots form an equilateral triangle with vertices A, B, and C in the circle.

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.[22][34] When the cubic is written in depressed form as above as ${\displaystyle t^{3}+pt+q=0}$, as shown above the solution can be expressed as

${\displaystyle 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 ${\displaystyle \arccos \left({\frac {3q}{2p}}{\sqrt {\frac {-3}{p}}}\right)}$ is an angle in the unit circle; taking ${\displaystyle {\tfrac {1}{3}}}$ of that angle corresponds to taking a cube root of a complex number; adding ${\displaystyle -k{\frac {2\pi }{3}}}$ for k = 1, 2 finds the other cube roots; and multiplying the cosines of these resulting angles by ${\displaystyle 2{\sqrt {-{\frac {p}{3}}}}}$ corrects for scale.

For the non-depressed case ${\displaystyle x^{3}+bx^{2}+cx+d=0}$ (shown in the accompanying graph), the depressed case as indicated previously is obtained by defining t such that ${\displaystyle x=t-{\tfrac {b}{3}}}$ so ${\displaystyle t=x+{\tfrac {b}{3}}}$. Graphically this corresponds to simply shifting the graph horizontally when changing between the variables t and x, without changing the angle relationships.

#### One real and two complex roots

##### In the Cartesian plane

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,[35][36][37] 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 ${\displaystyle {\tfrac {\pi }{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 ${\displaystyle {\tfrac {\pi }{3}}}$, the major axis is vertical and its foci, the roots of the derivative, are complex. And if that angle is ${\displaystyle {\tfrac {\pi }{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.

#### Omar Khayyám's solution

Omar Khayyám's geometric solution of a cubic equation, for the case a=2, b=16, giving the root 2. The fact that the vertical line intersects the x-axis at the center of the circle is specific to this particular example

As shown in this graph, to solve the third-degree equation ${\displaystyle x^{3}+a^{2}x=b}$ where ${\displaystyle b>0,}$ Omar Khayyám constructed the parabola ${\displaystyle y=x^{2}/a,}$ the circle which has as a diameter the line segment ${\displaystyle [0,b/a^{2}]}$ of 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 by x the equation, and regrouping the terms gives

${\displaystyle {\frac {x^{4}}{a^{2}}}=x\,({\frac {b}{a^{2}}}-x)\,.}$

The left-hand side is the value of y2 on the parabola. The equation of the circle being ${\displaystyle y^{2}+x\,(x-{\frac {b}{a^{2}}})=0,}$ the right hand side is the value of y2 on the circle.

## Collinearities

The tangent lines to a cubic at three collinear points intercept the cubic again at collinear points.[38]:p. 425,#290

## Notes

1. Exceptions include fields of characteristic 2 and 3.
2. British Museum BM 85200
3. {{#invoke:citation/CS1|citation |CitationClass=book }}
4. Van der Waerden, Geometry and Algebra of Ancient Civilizations, chapter 4, Zurich 1983 ISBN 0-387-12159-5
5. {{#invoke:citation/CS1|citation |CitationClass=book }}
6. {{#invoke:citation/CS1|citation |CitationClass=book }}
7. {{#invoke:citation/CS1|citation |CitationClass=book }}
8. Template:Harvtxt states that "the Egyptians considered the solution impossible, but the Greeks came nearer to a solution."
9. Template:Harvtxt
10. {{#invoke:citation/CS1|citation |CitationClass=book }}
11. {{#invoke:citation/CS1|citation |CitationClass=book }}
12. {{#invoke:citation/CS1|citation |CitationClass=citation }}
13. A paper of Omar Khayyam, Scripta Math. 26 (1963), pages 323–337
14. In {{#invoke:citation/CS1|citation |CitationClass=citation }}. one may read This problem in turn led Khayyam to solve the cubic equation x3 + 200x = 20x2 + 2000 and he found a positive root of this cubic by considering the intersection of a rectangular hyperbola and a circle. An approximate numerical solution was then found by interpolation in trigonometric tables. The then in the last assertion is erroneous and should, at least, be replaced by also. The geometric construction was perfectly suitable for Omar Khayyam, as it occurs for solving a problem of geometric construction. At the end of his article he says only that, for this geometrical problem, if approximations are sufficient, then a simpler solution may be obtained by consulting trigonometric tables. Textually: If the seeker is satisfied with an estimate, it is up to him to look into the table of chords of Almagest, or the table of sines and versed sines of Mothmed Observatory. This is followed by a short description of this alternate method (seven lines).
15. J. J. O'Connor and E. F. Robertson (1999), Omar Khayyam, MacTutor History of Mathematics archive, states, "Khayyam himself seems to have been the first to conceive a general theory of cubic equations."
16. Template:Harvtxt states, "Omar Al Hay of Chorassan, about 1079 AD did most to elevate to a method the solution of the algebraic equations by intersecting conics."
17. Datta and Singh, History of Hindu Mathematics, p. 76,Equation of Higher Degree; Bharattya Kala Prakashan, Delhi, India 2004 ISBN 81-86050-86-8
18. {{#invoke:citation/CS1|citation |CitationClass=citation }}.
19. {{#invoke:citation/CS1|citation |CitationClass=citation }}
20. {{#invoke:citation/CS1|citation |CitationClass=citation }}
21. {{#invoke:citation/CS1|citation |CitationClass=book }}
22. {{#invoke:citation/CS1|citation |CitationClass=citation }}
23. {{#invoke:citation/CS1|citation |CitationClass=citation }}, Chapter 10 ex 10.14.4 and 10.17.4, pp. 154–156
24. {{#invoke:citation/CS1|citation |CitationClass=book }}, Extract of page 179
25. Template:Harvnb
26. {{#invoke:citation/CS1|citation |CitationClass=citation }}, §6.2, p. 134
27. {{#invoke:citation/CS1|citation |CitationClass=citation }}, Algebra in the Eighteenth Century: The Theory of Equations
28. Daniel Lazard, "Solving quintics in radicals", in Olav Arnfinn Laudal, Ragni Piene, The Legacy of Niels Henrik Abel, pp. 207–225, Berlin, 2004,. ISBN 3-540-43826-2
29. Zucker, I. J., "The cubic equation — a new look at the irreducible case", Mathematical Gazette 92, July 2008, 264–268.
30. {{#invoke:citation/CS1|citation |CitationClass=citation }}
31. These are Formulas (80) and (83) of Weisstein, Eric W. 'Cubic Formula'. From MathWorld—A Wolfram Web Resource. http://mathworld.wolfram.com/CubicFormula.html, rewritten for having a coherent notation.
32. Holmes, G. C., "The use of hyperbolic cosines in solving cubic polynomials", Mathematical Gazette 86. November 2002, 473–477.
33. Abramowitz, Milton; Stegun, Irene A., eds. Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables, Dover (1965), chap. 22 p. 773
34. {{#invoke:citation/CS1|citation |CitationClass=citation }} See esp. Fig. 2.
35. {{#invoke:citation/CS1|citation |CitationClass=citation }}
36. {{#invoke:citation/CS1|citation |CitationClass=citation }}
37. {{#invoke:citation/CS1|citation |CitationClass=citation }}
38. Whitworth, William Allen. Trilinear Coordinates and Other Methods of Modern Analytical Geometry of Two Dimensions, Forgotten Books, 2012 (orig. Deighton, Bell, and Co., 1866). http://www.forgottenbooks.com/search?q=Trilinear+coordinates&t=books

## References

• {{#invoke:citation/CS1|citation

|CitationClass=citation }} Ch. 24.

• {{#invoke:citation/CS1|citation

|CitationClass=citation }}

• {{#invoke:citation/CS1|citation

|CitationClass=citation }}

• {{#invoke:citation/CS1|citation

|CitationClass=citation }}

• {{#invoke:citation/CS1|citation

|CitationClass=citation }}

• {{#invoke:citation/CS1|citation

|CitationClass=citation }}

• {{#invoke:citation/CS1|citation

|CitationClass=citation }}

• {{#invoke:citation/CS1|citation

|CitationClass=citation }}

• {{#invoke:citation/CS1|citation

|CitationClass=citation }}

• {{#invoke:citation/CS1|citation

|CitationClass=citation }}