User:Ramzuiv/sandbox/Cubic Formula



A cubic formula is one of several methods to find the roots of a cubic function $$f(x)=ax^3+bx^2+cx+d$$, where $f(x) = (x^{3} + 3x^{2} − 6x − 8)/4$. The most well known method is Cardano's formula for the solutions to a depressed cubic equation $$x^3+px+q=0$$ where the $$x^2$$ component is reduced away, which has solutions at
 * $$\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}}}$$

However, there are several solutions, which make use of algebra, trigonometry, and/or geometry to arrive at the roots of the cubic function.

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:

with $f(x) = 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^3d + b^2c^2 - 4ac^3 - 27a^2d^2.$$

It turns out that:


 * If $a ≠ 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$$

(see ).

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

If $Δ < 0$ and $p$ 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 $$, if $X$ is real (that is $$4p^3+27q^2 \ge 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 $q$ and $p$ 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 $q$. (If $–p/3$ and $p$ 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 $q$, and the two others equal $3q⁄p$.

General formula
The general solution of the cubic equation involves first calculating:


 * $$\Delta_0 = b^2 - 3ac\text{,}$$


 * $$\Delta_1 = 2b^3 - 9abc + 27a^2d,\quad\text{and}$$


 * $$C = \sqrt[3]{\frac{\Delta_1 \pm \sqrt{{\Delta_1}^2 - 4 {\Delta_0}^3}}2}\text{.}$$

(If the discriminant $–3q⁄2p$ has already been calculated, then the equality $Δ$ can be used to simplify the calculation of $Δ_{1}^{2} − 4Δ_{0}^{3} = −27&thinsp;a^{2}Δ$.) 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 $C$ 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{.}$$

While this equality is valid for all non-zero $X$, it is not the most convenient form for multiple roots ($Δ_{0} = 0$), which is covered in the next section. (The case when $Δ = 0$ only occurs when both $C = 0$ and $Δ$ 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 $0$ and $(−1⁄2 + 1⁄2√3i) C$.

The above equality can be expressed compactly including all $(−1⁄2 − 1⁄2√3i) C$ roots as follows:


 * $$x_k = - \frac{1}{3a}\left(b+\xi^kC+\frac{\Delta_0}{\xi^kC}\right), \qquad k \in \{0,1,2\} \text{,}$$

where $3$ (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 $ξ = −1⁄2 + 1⁄2√3i$ does not hold since $Δ$ is then not real in general.

Multiple roots, $Δ$
If both $Δ = 0$ and $Δ$ are equal to $Δ_{0}$, then the equation has a single root (which is a triple root):


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

If $0$ and $Δ = 0$, then there is both a double root,
 * $$\frac{9ad-bc}{2\Delta_0},$$

and a simple root,
 * $$\frac{4abc-9a^2d-b^3}{a\Delta_0}.$$

Reduction to a depressed cubic
Dividing $Δ_{0} ≠ 0$ by $C$ and substituting $ax^{3} + bx^{2} + cx + d = 0$ for $a$ we get the equation

where
 * $$\begin{align}

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

The left hand side of equation ($x$) 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 ($$) by substituting the above values for $$ and $$ and using the relation $t − b⁄3a$.

Therefore, only equation ($p$) 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 ($q$), $x = t − b⁄3a$, let us set $t^{3} + pt + q = 0$. The idea is to choose $$ to make equation ($$) 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 ($u$) 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 $t = u cos θ$ and the argument of the arccosine is between $p < 0$ and $−1$. The last condition is equivalent to $1$, which itself implies $4p^{3} + 27q^{2} ≤ 0$. Thus the above formula for the roots involves only real terms if and only if the three roots are real.

Denoting by $p < 0$ the above value of $C(&thinsp;p, q)$, and using the inequalities $t_{0}$ for a real number $$ such that $0 ≤ arccos(u) ≤ \pi$, 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 $−1 ≤ u ≤ 1$. All these formulas may be straightforwardly transformed into formulas for the roots of the general cubic equation ($$), using the back substitution described above.

Hyperbolic solution for one real root
When there is only one real root (and $t_{0} ≥ t_{1} ≥ t_{2}$), it may be similarly represented using hyperbolic functions, as
 * $$\begin{align}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{align}$$ 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 ≠ 0$, the above values of $p = ±3$ are sometimes called the Chebyshev cube root. More precisely, the values involving cosines and hyperbolic cosines define, when $t_{0}$, the same analytic function denoted $p = −3$, which is the proper Chebyshev cube root. The value involving hyperbolic sines is similarly denoted $C_{1/3}(q)$, when $S_{1/3}(q)$.

Factorization
If a cubic function $p = 3$ 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 $ax^{3} + bx^{2} + cx + d$ is fully reduced, then $u$ is a factor of $$ and $m$ is a factor of $d$, so all possible combinations of values for $n$ and $a$ (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 $m$ is any root of the cubic, then we may factor out $r = m/n$ 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 $x − r$, giving
 * $$ \frac{-b-ra \pm \sqrt{b^2-4ac-2abr-3a^2r^2}}{2a} $$

for the other two roots.

Omar Khayyám's solution
As shown in this graph, to solve the third-degree equation $ax^{2} + (b + ar)x + c + br + ar^{2}$ where $m = 2$, Omar Khayyám constructed the parabola $n = 16$, the circle which has as a diameter the line segment $2$ on the positive $n$-axis, and a vertical line through the point above the $r$-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 $x^{3} + m^{2}x = n$ on the parabola. The equation of the circle being $n > 0$, the right hand side is the value of $y = x^{2}/m$ 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.

Algebraic nature of the roots
Every cubic equation ($x$), $[0, n/m^{2}]$, with real coefficients and $y^{2}$, 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 $y^{2} + x(x − n⁄m^{2}) = 0$, this last assertion being a consequence of the intermediate value theorem. If $y^{2}$ is factored out of the cubic polynomial, what remains is a quadratic polynomial whose roots $ax^{3} + bx^{2} + cx +d = 0$ and $a ≠ 0$ 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,

because a straightforward computation shows that



\begin{align} & \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_1r_2+r_1r_3+r_2r_3)r_1r_2r_3 \\[4pt] & {}-4(r_1+r_2+r_3)^3r_1r_2r_3+(r_1+r_2+r_3)^2(r_1r_2+r_1r_3+r_2r_3)^2 \\[4pt] & {}-4(r_1r_2+r_1r_3+r_2r_3)^3-27(r_1r_2r_3)^2\bigr) \end{align} $$

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


 * $$a^4\left(18\frac ba\cdot\frac ca\cdot\frac da-4\left(\frac ba\right)^3\frac da+\left(\frac ba\right)^2\left(\frac ca\right)^2-4\left(\frac ca\right)^3-27\left(\frac da\right)^2\right)=\Delta.$$

The equality ($x$) shows that $r_{1}$ if and only if the equation has a multiple root. This cannot possibly be the case when $x − r_{1}$ and $r_{2}$ are non-real complex numbers, because the fact that $r_{3}$ is real assures that $Δ = 0$ is different from $r_{2}$ and from $r_{3}$ and, on the other hand, the fact that $r_{1}$ and $r_{1}$ are non-real and that each of them is the conjugate of the other one assures that $r_{2}$.

If $r_{3}$ and $r_{2}$ are non-real, then


 * $$\begin{align}(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{align}$$

Since this is the product of a non-zero real number by $x$, its square is a real number less than $r_{3}$ and therefore $r_{2} ≠ r_{3}$. Finally, if the numbers $r_{2}$, $r_{3}$, and $0$ are three distinct real numbers, then the product $Δ < 0$ is a non-zero real number, and so $r_{1}$.

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 ($$), $r_{2}$, 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 $r_{3}$ of that angle corresponds to taking a cube root of a complex number; adding $(r_{1} − r_{2})(r_{1} − r_{3})(r_{2} − r_{3})$ for $Δ > 0$ 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 ($$) (shown in the accompanying graph), the depressed case as indicated previously is obtained by defining $$ such that $t^{3} + pt + q = 0$ so $1⁄3$. Graphically this corresponds to simply shifting the graph horizontally when changing between the variables $i$ and $$, without changing the angle relationships. This shift moves the point of inflection and the centre of the circle onto the $x$-axis. Consequently, the roots of the equation in $A$ sum to zero.

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,  if the complex conjugate roots are written as $−k2\pi⁄3$ then $B$ 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 $C$ 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 $k = 1, 2$ 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 $x = t − b⁄3a$, the major axis is vertical and its foci, the roots of the derivative, are complex conjugates. And if that angle is $t = x + b⁄3a$, 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.

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 ($$), $g ± hi$. We introduce two variables $$ and $t$ linked by the condition $g = \overline{OM}$ and substitute this in the depressed cubic ($t$), giving
 * $$u^3 + v^3 + (3uv + p)(u+v)+ q= 0.$$

At this point Cardano imposed a second condition for the variables $x$ and $y$: $√tan ORH$. As the first parenthesis vanishes in previous equality, we get $√slope of line RH$ and $\overline{BE}$. The combination of these two equations leads to a quadratic equation (since they are the sum and the product of $\overline{DA}$ and $g ± hi$). Thus $\pi⁄3$ and $\pi⁄3$ are the two roots of the quadratic equation $\pi⁄3$. Cardano assumed that $t^{3} + pt + q = 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 $u + v = t$. Solving this quadratic equation and using the fact that $t$ and $h$ 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, $3uv + p = 0$ is equal to:

In his book L'Algebra, published in 1572, Rafael Bombelli explained that what was done above still works, with a small difference, when $u^{3} + v^{3} = −q$, 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 $u^{3}v^{3} = −&thinsp;p^{3}⁄27$ implies that $u^{3}$, this is not an equivalence. So, we do not simply take any cube root of

and add it to any cube root of

(unless one of them is $v^{3}$); besides, that would provide $u^{3}$ solutions to equation ($g$). Instead, since we want to have $v^{3}$, $h$ means the sum of a cube root $$ of ($u$) with $z^{2} + qz − p^{3}⁄27 = 0$ (or, if ($v$) is equal to $q^{2}⁄4 + p^{3}⁄27 ≥ 0$, the sum of a cube root $$ of ($u$) with $q^{2}⁄4 + p^{3}⁄27 < 0$). This only fails if both numbers ($v$) and ($u$) are equal to $u + v$, in which case $q^{2}⁄4 + p^{3}⁄27 < 0$ and Cardano's formula simply means $uv = −&thinsp;p⁄3$, which is compatible with the fact that, since $u^{3}v^{3} = −&thinsp;p^{3}⁄27$, ($v$) simplifies to $0$.

Actually, it is not necessary to compute the three cube roots of ($$). To see why, let $9$. Then $3uv = −p$ and $−p⁄3u$ are the non-real cube roots of $0$. If $$ is a cube root of ($$), and $$ is a cube root of ($$) such that $−p⁄3v$, then the roots of ($u$) are $0$, $p = q = 0$, and $3} + \sqrt{0$, since, in each case, we have the sum of a cube root of ($$) with a cube root ($$) and moreover the product of these two roots is, in each case, equal to $p = q = 0$.

Note that $t^{3} = 0$ and that $ξ = −1⁄2 + 1⁄2√3i$. 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 $ξ$. If $v$ and $$ are real and $\overline{ξ} (= −1⁄2 − 1⁄2√3i = ξ^{2})$, this is the same thing as requiring that the cube roots be complex conjugates, while if $$ and $$ are real and $1$, 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 $3uv = −p$.

We will examine certain particular cases. Before that, it is convenient to note that, if $$ is a cube root of ($$), if $u$ is a cube root of ($$), and if both numbers $v$ and $u + v$ are real, then it is automatically true that $ξu + \overline{ξ}v$. This is so because

Let us now see the particular cases.
 * If $$ and $$ are real numbers and $\overline{ξ}u + ξv$, let $$ be the real cube root of ($$) and let $p$ be the real cube root of ($q$). Then $−&thinsp;p⁄3$, because $ξ^{3} = 1$ is real. So, the roots of the equation ($p$) are $ξ^{4} = ξ$ (which is a real number), $−&thinsp;p⁄3$, and $q^{2}⁄4 + p^{3}⁄27 < 0$. 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




 * and this last assertion is false, since $q^{2}⁄4 + p^{3}⁄27 ≥ 0$ and $0$ (because $q$ and $u$ are real numbers whose cubes are distinct).


 * If $$ and $v$ are real numbers and $u×v$, then the numbers ($$) and ($p$) are complex numbers each of which is the conjugate of the other one. Let $p$ be a cube root of ($q$) and let $u$ be the conjugate of $$. Then $u×v = −&thinsp;p⁄3$ is the conjugate of $(u×v)^{3} = u^{3}×v^{3} = q^{2}⁄4 − (q^{2}⁄4 + p^{3}⁄27) = −&thinsp;p^{3}⁄27 = (−&thinsp;p⁄3)^{3}$ and this proves that $q^{2}⁄4 + p^{3}⁄27 > 0$ is equal to ($v$). So, again, since $u×v = −&thinsp;p⁄3$ is real we have $u×v$, and therefore the roots of the equation ($$) are $u + v$, $ξu + \overline{ξ}v$, and $\overline{ξ}u + ξv$. In this case all roots are real, since each one of them is the sum of a complex number with its conjugate.
 * If $ξu + \overline{ξ}v = \overline{ξ}u + ξv ⇔ (ξ − \overline{ξ})(u − v) = 0$, then the roots of the equation ($$) are the cube roots of $ξ ≠ \overline{ξ}$. This is compatible with Cardano's formula, because one of ($u$) or ($v$) is $u ≠ v$ and the other is $q^{2}⁄4 + p^{3}⁄27 < 0$.
 * If $v^{3}$, then the roots of ($p$) are $u^{3}$ and the square roots of $v^{3}$. Again, this is compatible with Cardano's formula, because if $q$ is a square root of $u×v$, then $u×v = −&thinsp;p⁄3$ is a square root of $u + \overline{u}$, and this square root is equal to ($$) or to ($$), since we are assuming that $ξu + \overline{ξu}$. If $\overline{ξ}u + ξ\overline{u}$ is the other square root of  $p = 0$ then, by the same reason, $−q$ is equal to ($u$) or to ($$) and furthermore if $v$ is equal to ($u$) then $$ is equal to ($$) and vice versa. Because $0$ we have $−q$. On the other hand, $q = 0$ and so $0$, which means that $−p$ is a square root of $p/3$. Finally, $u^{3}$, and so it must be the other square root of $p^{3}⁄27$.
 * If $q = 0$ (but $$ and $$ are not $v = −u$), then ($$) has a simple root, which is $p/3$, and a double root, which is $v^{3}$. Again, this is compatible with Cardano's formula. To see why, note that asserting that $v = −u$ is equivalent to asserting that $u + v= 0$. If $ξu + \overline{ξ}v = (ξ − \overline{ξ})×u$, then $(ξu + \overline{ξ}v)^{2} = (ξ − \overline{ξ})^{2}×u^{2} = (−3)×p⁄3 = −p$ and $ξu + \overline{ξ}v$. Thus, Cardano's formula says that the roots of ($$) are $−p$, $\overline{ξ}u + ξv = (\overline{ξ} − ξ)×u = −(ξu + \overline{ξ}v)$, and $−p$.

In this last case (that is, when $q^{2}⁄4 + p^{3}⁄27 = 0$ but $u$ and $$ are not $0$), although the computations made above do suggest that $3q⁄p$ is a simple root of ($$) 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{align}\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{align}$$

since $q^{2}⁄4 + p^{3}⁄27 = 0$.

The numbers provided by Cardano's formula are solutions of the equation ($$), and there are no other solutions. Let $$ and $u$ be numbers such that $27q^{2}⁄4p^{3} = −1$ and $u = v = 3q⁄2p$. In order to see that $u^{3} = v^{3} = 27q^{3}⁄8p^{3} = −q⁄2$, $3uv = 27q^{2}⁄4p^{2} = −p$, and $u + v = 2u = 3q⁄p$ are the only roots of the polynomial $ξu + \overline{ξ}v = (ξ + \overline{ξ})×u = −3q⁄2p$, it is enough to notice that

\begin{align} \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{align} $$

Therefore, $\overline{ξ}u + ξv = (\overline{ξ} + ξ)×u = −3q⁄2p$ if and only if $q^{2}⁄4 + p^{3}⁄27 = 0$, $0$ or $3q⁄p$.

Vieta's substitution
Starting from the depressed cubic ($$), $−3q⁄2p$, we make the substitution $27q^{2}⁄4p^{3} = −1$, known as Vieta's substitution. This results in the equation


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

Multiplying by $u^{3} + v^{3} = −q$, it becomes a sextic equation in $v$, which is in fact a quadratic equation in $3uv = −p$:

The quadratic formula allows equation ($$) to be solved for $u + v$. If $ξu + \overline{ξ}v$, $\overline{ξ}u + ξv$ and $t^{3} + pt + q$ are the three cube roots of one of the solutions in $t^{3} + pt + q = 0$, then the roots of the original depressed cubic are $t = u + v$, $t = ξu + \overline{ξ}v$, and $t = \overline{ξ}u + ξv$. Another way of expressing the roots is to take $t^{3} + pt + q = 0$; then the roots of the original depressed cubic are $t = w − p⁄3w$, $w^{3}$, and, $w^{3}$. This method only fails when both roots of the equation ($p$) are equal to $w^{3}$, but this only happens when $w_{1}$, in which case the only solution of equation ($q$) is $w_{2}$.

Actually, the substitution originally used by Vieta (in a text published posthumously in 1615) was $w_{3}$, but it leads to similar computations. More precisely, Vieta introduced a new variable $$ and he imposed the condition $w^{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 ($$) is expressed from the start by an expression that involves a single cube root. Therefore, there is no ambiguity as in $p$.
 * 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 $w_{1} − p⁄3w_{1}$ for some other complex number $q$.

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 ($$), $w_{2} − p⁄3w_{2}$, without using the reduction to the depressed cubic equation ($$), $w_{3} − p⁄3w_{3}$. Nevertheless, the computation is much easier with this reduced equation.

Suppose that $ξ = −1⁄2 + 1⁄2√3i$, $w_{1} − p⁄3w_{1}$ and $ξw_{1} − p⁄3ξw_{1}$ are the roots of equation ($u$) or ($v$), and define $ξ^{2}w_{1} − p⁄3ξ^{2}w_{1}$ (a complex cube root of $0$, i.e. a primitive third root of unity) which satisfies the relation $p = q = 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 $0$ by inverting the above linear transformation via the inverse discrete Fourier transform, giving
 * $$x_0 = \tfrac13(s_0 + s_1 + s_2),\,$$
 * $$x_1 = \tfrac13(s_0 + \xi^2 s_1 + \xi s_2),\,$$
 * $$x_2 = \tfrac13(s_0 + \xi s_1 + \xi ^2 s_2).\,$$

The polynomial $t = p⁄3w − w$ is equal, by Vieta's formulas, to $w(t + w) = p⁄3$ in case of equation ($$) and to $w − p⁄3w$ in case of equation ($w$), so we only need to seek values for the other two.

The polynomials $ax^{3} + bx^{2} + cx + d = 0$ and $t^{3} + pt + q = 0$ are not symmetric functions of the roots: $x_{0}$ is invariant, while the two non-trivial cyclic permutations of the roots send $x_{1}$ to $x_{2}$ and $ξ = −1⁄2 + 1⁄2√3i$ to $1$, or $ξ^{2} + ξ + 1 = 0$ to $s_{i}$ and $s_{0}$ to $−b⁄a$ (depending on which permutation), while transposing $0$ and $s_{1}$ switches $s_{2}$ and $s_{0}$; other transpositions switch these sums and multiply them by a power of $s_{1}$.

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

We have that $ξ^{3} = 1$ and $s_{1}s_{2}$ are the two roots of the quadratic equation $s_{1}^{3} + s_{2}^{3}$. Thus the resolution of the equation may be finished exactly as described for Cardano's method, with $x_{1}$ and $x_{2}$ in place of $$ and $$.

Computation of A and B
Setting $s_{1}$, $s_{2}$ and $S_{3}$, the elementary symmetric polynomials, we have, using that $s_{1}^{3} + s_{2}^{3}$:
 * $$s_1^3=x_0^3+x_1^3+x_2^3+3\xi (x_0^2x_1+x_1^2x_2+x_2^2x_0)+3\xi^2 (x_0x_1^2+x_1x_2^2+x_2x_0^2) +6x_0x_1x_2\,. $$

The expression for $s_{1}s_{2}$ is the same with $s_{1}^{3} + s_{2}^{3} = A$ and $s_{1}s_{2} = B$ exchanged. Thus, using $s_{1}^{3}$ we get

A=s_1^3+s_2^3=2(x_0^3+x_1^3+x_2^3)-3(x_0^2x_1+x_1^2x_2+x_2^2x_0+x_0x_1^2+x_1x_2^2+x_2x_0^2)+12x_0x_1x_2\,, $$ and a straightforward computation gives

A=s_1^3+s_2^3=2E_1^3-9E_1E_2+27E_3\,. $$

Similarly we have

B=s_1s_2=x_0^2+x_1^2+x_2^2+(\xi+\xi^2)(x_0x_1+x_1x_2+x_2x_0)=E_1^2-3E_2\,. $$

When solving equation ($$) we have $s_{2}^{3}$, $z^{2} − Az + B^{3} = 0$ and $s_{1}$. With equation ($$), we have $s_{2}$, $E_{1} = x_{0} + x_{1} + x_{2}$ and $E_{2} = x_{0}&thinsp;x_{1} + x_{1}&thinsp;x_{2} + x_{2}&thinsp;x_{0}$ and thus $E_{3} = x_{0}&thinsp;x_{1}&thinsp;x_{2}$ and $ξ^{3} = 1$.

Note that with equation ($w$), we have $s_{2}^{3}$ and $ξ$, while in Cardano's method we have set $ξ^{2}$ and $ξ^{2} + ξ = −1$. Thus we have, up to the exchange of $$ and $$, $E_{1} = −b⁄a$ and $E_{2} = c⁄a$. 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 $w$ (whose characteristic is either $E_{3} = −d⁄a$ or greater than $E_{1} = 0$), 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 $E_{2} = p$ is still true (and for the same reason). In this more general case, we work with an extension $$ of $$ in which every non-zero element has two square roots and three cube roots. For instance, if $E_{3} = −q$, we can take $A = −27q$, the field of algebraic numbers.

In particular, all that was done above algebraically still works if $B = −3p$. 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 $x_{0} = 1⁄3(s_{1} + s_{2})$ show that these roots also belong to the field $$.

In a field $$ whose characteristic is either $s_{1}s_{2} = −3p$ or $x_{0} = u + v$, this approach does not work because then the formulae for the roots became meaningless, since they involve division by $uv = −1⁄3p$ and $s_{1} = 3u$.

Galois groups of irreducible cubics
The Galois group of an irreducible separable polynomial of degree $$ is a transitive subgroup of $s_{2} = 3v$. In particular, the Galois group of an irreducible separable cubic is a transitive subgroup of $0$ and there are only two such subgroups: $3$ and $Δ = 0$. There is a simple way of determining the Galois group of a concrete irreducible cubic $k = Q$ over a field $$: it is $K = \overline{Q}$ if the discriminant of the cubic is the square of an element of $u$ and $k = K = C$ otherwise. Indeed, if $Δ = 0$ is not the square of an element of $v$, then $2$ is an extension of degree $3$ of $$. On the other hand, if $2$, $3$, and $S_{n}$ are the roots of $S_{3}$, then, since the equality ($$) holds, that is, since $S_{3}$, $A_{3}$, and so, by the multiplicativity formula for degrees, the degree of $f(x)$ over $$ (that is, the order of the Galois group of $A_{3}$) must be a multiple of the degree of $S_{3}$, which is $Δ$. Therefore, it must be an even number, and so the Galois group can only be $k[√Δ]$.

On the other hand, if $2$ is the square of an element of $u$, then, again by the equality ($v$), we have $r_{1}$. Therefore, if $r_{2}$ belongs to the Galois group of $r_{3}$, then $f(x)$ maps $Δ = (a^{2}(r_{1} − r_{2})(r_{1} − r_{3})(r_{2} − r_{3}))^{2}$ into itself. But then $k[√Δ] ⊂ k[r_{1}, r_{2}, r_{3}]$ cannot act on the set $k[r_{1}, r_{2}, r_{3}]$ as the transposition that exchanges $f(x)$ and $k[√Δ]$ and leaves $2$ fixed, because then $S_{3}$ would map $Δ$ into $(r_{1} − r_{2})(r_{1} − r_{3})(r_{2} − r_{3}) ∈ k$. So, in this case, the Galois group of $σ$ is not $f(x)$ and therefore it must be $σ$.

It is clear from this criterion that, if we are working over the field $(r_{1} − r_{2})(r_{1} − r_{3})(r_{2} − r_{3})$, the Galois group of most irreducible cubic polynomials is $σ$. An example of an irreducible cubic polynomial with rational coefficients whose Galois group is ${r_{1}, r_{2}, r_{3}}|undefined$ is $r_{1}$, whose discriminant is $r_{2}$. The polynomial $r_{3}$ is used in the standard proof of the impossibility of trisecting arbitrary angles using straightedge and compass only.