# Quartic equation

In mathematics, a quartic equation is the result of setting a quartic function equal to zero. An example of a quartic equation is the equation

[itex]2x^4+4x^3-26x^2-28x+48=0;[itex]

the general form is

[itex]a_0x^4+a_1x^3+a_2x^2+a_3x+a_4=0,[itex] where [itex]a_0\ne 0[itex].
 Contents

## Solving the quartic equation

As the fundamental theorem of algebra tells us, a quartic equation always has four solutions (roots). They may be complex and there may be duplicate solutions.

Naturally, much effort has been turned to finding these roots. As with other polynomials, it is sometimes possible to factor a quartic equation directly; but more often such a feat is Herculean, especially when the roots are irrational or complex. Hence it would be useful to have a general formula or algorithm (such as the quadratic equation which solves all quadratics). After much effort, such a formula was indeed found for quartics — but since then it has been proven (by Evariste Galois) that such an approach dead-ends with quartics; they are the highest-degree polynomial equations whose roots can be expressed in a formula using a finite number of arithmetic operators and n-th roots. From quintics on up, one requires more powerful methods if a general algebraic solution is sought, as explained under quintic equations.

Given the complexity of the quartic formulae (see below), they are not often used. If only the real rational roots are needed, they can be found (as is true for polynomials of any degree) via trial and error, using Ruffini's rule (so long as all the polynomial coefficients are rational). In the modern age of computers, furthermore, good numerical approximations for the roots are rapidly obtainable via Newton's method. But if the quartic must be solved entirely and precisely, the procedures are outlined below.

### Special cases

#### Quartics in name only

If a4 = 0, then one of the roots is x = 0, and the other roots can be found by dividing by x, and solving the resulting cubic equation,

[itex]a_0x^3+a_1x^2+a_2x+a_3=0.[itex]

A quartic equation where a3 and a1 are equal to 0 takes the form

[itex]a_0x^4+a_2x^2+a_4=0\,\![itex]

and thus is a biquadratic equation, very easy to solve. Let [itex]z=x^2[itex], so our equation turns to

[itex]a_0z^2+a_2z+a_4=0\,\![itex]

which is a simple quadratic equation, whose solutions are easily found using the quadratic formula:

[itex]z={{-a_2\pm\sqrt{a_2^2-4a_0a_4}} \over {2a_0}}\,\![itex]

When we've solved it (i.e. found these two z values), we can extract x from them

[itex]x_1=+\sqrt{z_1}\,\![itex]
[itex]x_2=-\sqrt{z_1}\,\![itex]
[itex]x_3=+\sqrt{z_2}\,\![itex]
[itex]x_4=-\sqrt{z_2}\,\![itex]

If any of the z solutions were negative or complex numbers, some of the x solutions are complex numbers.

### The general case, along Ferrari's lines

To begin, the quartic must first be converted to a depressed quartic.

#### Converting to a depressed quartic

Let

[itex] A x^4 + B x^3 + C x^2 + D x + E = 0 \qquad\qquad(1')[itex]

be the general quartic equation which it is desired to solve. Divide both sides by A,

[itex] x^4 + {B \over A} x^3 + {C \over A} x^2 + {D \over A} x + {E \over A} = 0. [itex]

The first step should be to eliminate the x3 term. To do this, change variables from x to u, such that

[itex] x = u - {B \over 4 A} [itex].

Then

[itex] \left( u - {B \over 4 A} \right)^4 + {B \over A} \left( u - {B \over 4 A} \right)^3 + {C \over A} \left( u - {B \over 4 A} \right)^2 + {D \over A} \left( u - {B \over 4 A} \right) + {E \over A} = 0. [itex]

Expanding the powers of the binomials produces

[itex] \left( u^4 - {B \over A} u^3 + {6 u^2 B^2 \over 16 A^2} - {4 u B^3 \over 64 A^3} + {B^4 \over 256 A^4} \right)

+ {B \over A} \left( u^3 - {3 u^2 B \over 4 A} + {3 u B^2 \over 16 A^2} - {B^3 \over 64 A^3} \right) + {C \over A} \left( u^2 - {u B \over 2 A} + {B^2 \over 16 A^2} \right) + {D \over A} \left( u - {B \over 4 A} \right) + {E \over A}. [itex] Collecting the same powers of u yields

[itex] u^4 + \left( {-3 B^2 \over 8 A^2} + {C \over A} \right) u^2 + \left( {B^3 \over 8 A^3} - {B C \over 2 A^2} + {D \over A} \right) u + \left( {-3 B^4 \over 256 A^4} + {C B^2 \over 16 A^3} - {B D \over 4 A^2} + {E \over A} \right) = 0. [itex]

Now rename the coefficients of u. Let

[itex] \alpha = {-3 B^2 \over 8 A^2} + {C \over A}, [itex]
[itex] \beta = {B^3 \over 8 A^3} - {B C \over 2 A^2} + {D \over A}, [itex]
[itex] \gamma = {-3 B^4 \over 256 A^4} + {C B^2 \over 16 A^3} - {B D \over 4 A^2} + {E \over A}. [itex]

The resulting equation is

[itex] u^4 + \alpha u^2 + \beta u + \gamma = 0 \qquad \qquad (1) [itex]

which is a depressed quartic equation.

If [itex]\beta=0[itex] then we have a Biquadratic equation, which (as explained above) is easily solved; using reverse substitution we can find our values for [itex]x[itex].

#### Ferrari's solution

Otherwise, the depressed quartic can be solved by means of a method discovered by Ferrari. Once the depressed quartic has been obtained, the next step is to add the valid identity

[itex] (u^2 + \alpha)^2 - u^4 - 2 \alpha u^2 = \alpha^2 [itex]

to equation (1), yielding

[itex] (u^2 + \alpha)^2 + \beta u + \gamma = \alpha u^2 + \alpha^2. \qquad \qquad (2) [itex]

The effect has been to fold up the u4 term into a perfect square: (u2 + α)2. The second term, α u2 did not disappear, but its sign has changed and it has been moved to the right side.

The next step is to insert a variable y into the perfect square on the left side of equation (2), and a corresponding 2y into the coefficient of u2 in the right side. To accomplish these insertions, the following valid formulas will be added to equation (2),

[itex]
 \begin{matrix}
(u^2+\alpha+y)^2-(u^2+\alpha)^2 & = & 2y(u^2+\alpha)+ y^2\ \
\\
& = & 2yu^2+2y\alpha+y^2,
\end{matrix}
[itex]


and

[itex] 0 = (\alpha + 2 y) u^2 - 2 y u^2 - \alpha u^2 [itex]

These two formulas, added together, produce

[itex] (u^2 + \alpha + y)^2 - (u^2 + \alpha)^2 = (\alpha + 2 y) u^2 - \alpha u^2 + 2 y \alpha + y^2 \qquad \qquad (y-\hbox{insertion}) [itex]

which added to equation (2) produces

[itex] (u^2 + \alpha + y)^2 + \beta u + \gamma = (\alpha + 2 y) u^2 + (2 y \alpha + y^2 + \alpha^2). [itex]

This is equivalent to

[itex] (u^2 + \alpha + y)^2 = (\alpha + 2 y) u^2 - \beta u + (y^2 + 2 y \alpha + \alpha^2 - \gamma). \qquad \qquad (3) [itex]

The objective now is to choose a value for y such that the right side of equation (3) becomes a perfect square. This can be done by letting the discriminant of the quadratic function become zero. To explain this, first expand a perfect square so that it equals a quadratic function:

[itex] (s u + t)^2 = (s^2) u^2 + (2 s t) u + (t^2).[itex]

The quadratic function on the right side has three coefficients. It can be verified that squaring the second coefficient and then subtracting four times the product of the first and third coefficients yields zero:

[itex] (2 s t)^2 - 4 (s^2) (t^2) = 0. [itex]

Therefore to make the right side of equation (3) into a perfect square, the following equation must be solved:

[itex] (-\beta)^2 - 4 (2 y + \alpha) (y^2 + 2 y \alpha + \alpha^2 - \gamma) = 0. [itex]

Multiply the binomial with the polynomial,

[itex] \beta^2 - 4 (2 y^3 + 5 \alpha y^2 + (4 \alpha^2 - 2 \gamma) y + (\alpha^3 - \alpha \gamma)) = 0 [itex]

Divide both sides by −4, and move the −β2/4 to the right,

[itex] 2 y^3

+ 5 \alpha y^2 + ( 4 \alpha^2 - 2 \gamma ) y + \left( \alpha^3 - \alpha \gamma - {\beta^2 \over 4} \right) = 0 \qquad \qquad [itex] This is a cubic equation for y. Divide both sides by 2,

[itex] y^3 + {5 \over 2} \alpha y^2 + (2 \alpha^2 - \gamma) y + \left( {\alpha^3 \over 2} - {\alpha \gamma \over 2} - {\beta^2 \over 8} \right) = 0. \qquad \qquad (4) [itex]
##### Conversion of the nested cubic into a depressed cubic

Equation (4) is a cubic equation nested within the quartic equation. It must be solved in order to solve the quartic. To solve the cubic, first transform it into a depressed cubic by means of the substitution

[itex] y = v - {5 \over 6} \alpha. [itex]

Equation (4) becomes

[itex] \left( v - {5 \over 6} \alpha \right)^3 + {5 \over 2} \alpha \left( v - {5 \over 6} \alpha \right)^2 + (2 \alpha^2 - \gamma) \left( v - {5 \over 6} \alpha \right) + \left( {\alpha^3 \over 2} - {\alpha \gamma \over 2} - {\beta^2 \over 8} \right) = 0. [itex]

Expand the powers of the binomials,

[itex] \left( v^3 - {5 \over 2} \alpha v^2 + {25 \over 12} \alpha^2 v - {125 \over 216} \alpha^3 \right) + {5 \over 2} \alpha \left( v^2 - {5 \over 3} \alpha v + {25 \over 36} \alpha^2 \right) + (2 \alpha^2 - \gamma) v - {5 \over 6} \alpha (2 \alpha^2 - \gamma ) + \left( {\alpha^3 \over 2} - {\alpha \gamma \over 2} - {\beta^2 \over 8} \right) = 0. [itex]

Distribute, collect like powers of v, and cancel out the pair of v2 terms,

[itex] v^3 + \left( - {\alpha^2 \over 12} - \gamma \right) v + \left( - {\alpha^3 \over 108} + {\alpha \gamma \over 3} - {\beta^2 \over 8} \right) = 0. [itex]

This is a depressed cubic equation.

Relabel its coefficients,

[itex] P = - {\alpha^2 \over 12} - \gamma, [itex]
[itex] Q = - {\alpha^3 \over 108} + {\alpha \gamma \over 3} - {\beta^2 \over 8}. [itex]

The depressed cubic now is

[itex] v^3 + P v + Q = 0. \qquad \qquad (5)[itex]
##### Solving the nested depressed cubic

The solutions (any solution will do, so pick any of the three complex roots) of equation (5) are

let [itex]U=\sqrt{{Q\over 2}\pm \sqrt{{Q^{2}\over 4}+{P^{3}\over 27}}}[itex]
(taken from Cubic equation)
[itex]v = {P\over 3U} - U[itex]

therefore the solution of the original nested cubic is

[itex]y = - {5 \over 6} \alpha + {P\over 3U} - U \qquad \qquad (6)[itex]
Remember 1: [itex]P=0 \Longleftarrow {Q\over 2} + \sqrt{{Q^{2}\over 4}+{P^{3}\over 27}}=0[itex]
Remember 2: [itex]\lim_{P\to 0}{P \over \sqrt{{Q\over 2} + \sqrt{{Q^{2}\over 4}+{P^{3}\over 27}}}}=0[itex]
##### Folding the second perfect square

With the value for y given by equation (6), it is now known that the right side of equation (3) is a perfect square of the form

[itex](s^2)u^2+(2st)u+(t^2) = \left(\left(\sqrt{(s^2)}\right)u + {(2st) \over 2\sqrt{(s^2)}}\right)^2[itex]
This is correct for both signs of square root, as long as the same sign is taken for both square roots. A ± is redundant, as it would be absorbed by another ± a few equations further down this page.

so that it can be folded:

[itex] (\alpha + 2 y) u^2 + (- \beta) u + (y^2 + 2 y \alpha + \alpha^2 - \gamma ) = \left( \left(\sqrt{(\alpha + 2y)}\right)u + {(-\beta) \over 2\sqrt{(\alpha + 2 y)}} \right)^2[itex].
Note: If β ≠ 0 then α + 2y ≠ 0. If β = 0 then this would be a biquadratic equation, which we solved earlier.

Therefore equation (3) becomes

[itex](u^2 + \alpha + y)^2 = \left( \left(\sqrt{\alpha + 2 y}\right)u - {\beta \over 2\sqrt{\alpha + 2 y}} \right)^2 \qquad\qquad (7)[itex].

Equation (7) has a pair of folded perfect squares, one on each side of the equation. The two perfect squares balance each other.

If two squares are equal, then the sides of the two squares are also equal, as shown by:

[itex](u^2 + \alpha + y) = \pm\left( \left(\sqrt{\alpha + 2 y}\right)u - {\beta \over 2\sqrt{\alpha + 2 y}} \right) \qquad\qquad (7')[itex].

Collecting like powers of u produces

[itex]u^2 + \left(\mp_s \sqrt{\alpha + 2 y}\right)u + \left( \alpha + y \pm_s {\beta \over 2\sqrt{\alpha + 2 y}} \right) = 0 \qquad\qquad (8)[itex].
Note: The subscript s of [itex]\pm_s[itex] and [itex]\mp_s[itex] is to note that they are dependent.

Equation (8) is a quadratic equation for u. Its solution is

[itex]u={\pm_s\sqrt{\alpha + 2 y} \pm_t \sqrt{(\alpha + 2y) - 4(\alpha + y \pm_s {\beta \over 2\sqrt{\alpha + 2 y}})} \over 2}.[itex]

Simplifying, one gets

[itex]u={\pm_s\sqrt{\alpha + 2 y} \pm_t \sqrt{-\left(3\alpha + 2y \pm_s {2\beta \over \sqrt{\alpha + 2 y}} \right)} \over 2}.[itex]

This is the solution of the depressed quartic, therefore the solutions of the original quartic equation are

[itex]x=-{B \over 4A} + {\pm_s\sqrt{\alpha + 2 y} \pm_t \sqrt{-\left(3\alpha + 2y \pm_s {2\beta \over \sqrt{\alpha + 2 y}} \right)} \over 2}. \qquad\qquad (8')[itex]
Remember: The two [itex]\pm_s[itex] come from the same place in equation (7'), and should both have the same sign, while the sign of [itex]\pm_t[itex] is independent.
##### Summary of Ferrari's method

Given the quartic equation

[itex] A x^4 + B x^3 + C x^2 + D x + E = 0, [itex]

its solution can be found by means of the following calculations:

[itex] \alpha = - {3 B^2 \over 8 A^2} + {C \over A}, [itex]
[itex] \beta = {B^3 \over 8 A^3} - {B C \over 2 A^2} + {D \over A}, [itex]
[itex] \gamma = {-3 B^4 \over 256 A^4} + {C B^2 \over 16 A^3} - {B D \over 4 A^2} + {E \over A}, [itex]
if [itex]\beta=0[itex] solve [itex]u^4+\alpha u^2 + \gamma = 0[itex] and substitute [itex]x=u-{B\over 4A}[itex] finding the roots
[itex] P = - {\alpha^2 \over 12} - \gamma, [itex]
[itex] Q = - {\alpha^3 \over 108} + {\alpha \gamma \over 3} - {\beta^2 \over 8}, [itex]
[itex] R = {Q\over 2} \pm \sqrt{{Q^{2}\over 4}+{P^{3}\over 27}}[itex], (either sign of the square root will do, as long as [itex]R[itex] does not disappear unnecessarily; in the case of [itex]P=0[itex] we want [itex]R=Q[itex])
[itex] U = \sqrt{R}[itex], (there are 3 complex roots, any one of them will do)
[itex] y = - {5 \over 6} \alpha -U + \begin{cases}U=0 &\to 0\\U\ne 0 &\to {P\over 3U}\end{cases}, [itex]
[itex] x = - {B \over 4 A} + { \pm_s \sqrt{ \alpha + 2 y} \pm_t \sqrt{-\left(3\alpha + 2 y \pm_s {2\beta\over\sqrt{\alpha +2y}} \right) }\over 2 }.[itex]
The two ±s must have the same sign, the ±t is independent. To get all roots, find x for ±st = +,+ and for +,− and for −,+ and for −,−. Double roots will be given twice, triple roots 3 times and quadruple roots would be given 4 times (although then β = 0, which is a special case). The order of the roots depends on which cubic root U one chose. (see note for (8) vis-à-vis (8'))

Quod Erat Faciendum.

There are other methods of solving the quartic equations, perhaps more optimal. Ferrari was the first to discover one of these labyrinthine solutions. The equation which he solved was

[itex] x^4 + 6 x^2 - 60 x + 36 = 0 [itex]

which was already in depressed form. It has a pair of solutions which can be found with the set of formulas shown above.

#### Obtaining alternative solutions the hard way

It could happen that one only obtained one solution through the seven formulae above, because one doesn't like trying all four sign patterns to get all four solutions, and the solution one obtained is complex. It may also be the case that one is only looking for a real solution. Let x1 denote the complex solution. If all the original coefficients A, B, C, D and E are real -- which should be the case when one desires only real solutions -- then there is another complex solution x2 which is the complex conjugate of x1. If the other two roots are denoted as x3 and x4 then the quartic equation can be expressed as

[itex] (x - x_1) (x - x_2) (x - x_3) (x - x_4) = 0, [itex]

but this quartic equation is equivalent to the product of two quadratic equations:

[itex] (x - x_1) (x - x_2) = 0 \qquad \qquad (9) [itex]

and

[itex] (x - x_3) (x - x_4) = 0. \qquad \qquad (10) [itex]

Since

[itex] x_2 = x_1^\star [itex]

then

[itex]
 \begin{matrix}
\\
&=&x^2-2\,\mathrm{Re}(x_1)x+[\mathrm{Re}(x_1)]^2+[\mathrm{Im}(x_1)]^2.
\end{matrix}
[itex]


Let

[itex] a = - 2 \, \mathrm{Re}(x_1), [itex]
[itex] b = [ \mathrm{Re}( x_1) ]^2 + [ \mathrm{Im}(x_1) ]^2 [itex]

so that equation (9) becomes

[itex] x^2 + a x + b = 0. \qquad \qquad (11) [itex]

Also let there be (unknown) variables w and v such that equation (10) becomes

[itex] x^2 + w x + v = 0. \qquad \qquad (12) [itex]

Multiplying equations (11) and (12) produces

[itex] x^4 + (a + w) x^3 + (b + w a + v) x^2 + (w b + v a) x + v b = 0. \qquad \qquad (13) [itex]

Comparing equation (13) to the original quartic equation, it can be seen that

[itex] a + w = {B \over A}, [itex]
[itex] b + w a + v = {C \over A}, [itex]
[itex] w b + v a = {D \over A}, [itex]

and

[itex] v b = {E \over A}. [itex]

Therefore

[itex] w = {B \over A} - a = {B \over A} + 2 \mathrm{Re}(x_1), [itex]
[itex] v = {E \over A b} = {E \over A \left(

[ \mathrm{Re}(x_1) ]^2 + [ \mathrm{Im}(x_1) ]^2 \right) }. [itex] Equation (12) can be solved for x yielding

[itex] x_3 = {-w + \sqrt{w^2 - 4 v} \over 2}, [itex]
[itex] x_4 = {-w - \sqrt{w^2 - 4 v} \over 2}. [itex]

One of these two solutions should be the desired real solution.

### Alternative methods

We may find the roots of

[itex]x^4 + cx^2 + dx + e = 0 \qquad\qquad (1)[itex] (see Quartic equation#Converting to a depressed quartic)

by converting it to a biquadratic equation by means of a Tschirnhaus transformation.

If [itex]y = x^2 + px + q[itex], we may set [itex]p[itex] to be a root of

[itex]dp^3 + (4e-c^2)p^2 - 2cdp-d^2 = 0[itex] (see Cubic equation)

and

[itex]q[itex] to be [itex]c\over 2[itex].

This transforms the equation to

[itex]y^4+(-c^2/2+3pd+2e+p^2c)y^2+[itex]
[itex](48p^2ced^2-128pce^2d-4c^3p^2d^2+32pc^3ed-128p^2c^2e^2+[itex]
[itex]d^2c^4-12pd^3c^2+8d^2ec^2+16p^2c^4e+256p^2e^3-48d^2e^2+d^2c^4)/(16d^2)[itex]

which is biquadratic and can be solved using square roots. Solving for [itex]x[itex] in terms of [itex]y[itex] entails solving a quadratic equation, also via square roots.

Hence we have a solution in terms of square roots and a root of a cubic polynomial.

This can result in four [itex]y[itex]'s and consequently in eight [itex]x[itex]'s; the four roots of (1) can then be determined by trial and error.

#### Galois theory and factorization

The symmetric group S4 on four elements has the Klein four-group as a normal subgroup. This suggests using a resolvent whose roots may be variously described as a discrete Fourier transform or a Hadamard matrix transform of the roots. Suppose ri for i from 0 to 3 are roots of

[itex]x^4 + bx^3 + cx^2 + dx + e = 0\,\, (1)[itex]

If we now set

[itex]s_0 = (r_0 + r_1 + r_2 + r_3)/2[itex]
[itex]s_1 = (r_0 - r_1 + r_2 - r_3)/2[itex]
[itex]s_2 = (r_0 + r_1 - r_2 - r_3)/2[itex]
[itex]s_3 = (r_0 - r_1 - r_2 + r_3)/2[itex]

then since the transformation is an involution we may express the roots in terms of the four si in exactly the same way. Since we know the value s0 = -b, we really only need the values for s1, s2 and s3. These we may find by expanding out the polynomial

[itex](z^2 - s_1^2)(z^2-s_2^2)(z_3-s_3^2)\,\, (2)[itex]

which if we make the simplifying assumption that b=0, is equal to

[itex]{z}^{6}+2\,{z}^{4}c+{z}^{2}{c}^{2}-{d}^{2}-4\,{z}^{2}e\,\,(3)[itex]

This polynomial is of degree six, but only of degree three in z2, and so the corresponding equation is solvable. By trial we can determine which three roots are the correct ones, and hence find the solutions of the quartic.

We can remove any requirement for trial by using a root of the same resolvent polynomial for factoring; if w is any root of (3), and if [itex]F_1 = {x}^{2}+wx+1/2\,{w}^{2}+1/2\,c-1/2\,{\frac {{c}^{2}w}{d}}-1/2\,{\frac {{w}^{5}}{d}}-{\frac {c{w}^{3}}{d}}+2\,{\frac {ew}{d}}[itex] [itex]F_2 = {x}^{2}-wx+1/2\,{w}^{2}+1/2\,c+1/2\,{\frac {{w}^{5}}{d}}+{\frac {c{w}^{3}}{d}}-2\,{\frac {ew}{d}}+1/2\,{\frac {{c}^{2}w}{d}}[itex] then

[itex]F_1 F_2 = x^4 + cx^2 + dx + e\,\,(4)[itex]

We therefore can solve the quartic by solving for w and then solving for the roots of the two factors using the quadratic formula.

## Reference

• Art and Cultures
• Countries of the World (http://www.academickids.com/encyclopedia/index.php/Countries)
• Space and Astronomy