MathsAdvanced Equations

Quartic Equation
solver.

Find all four roots of a degree 4 polynomial, real or complex, exact where possible.

How it's worked out

A quartic is a polynomial whose highest power is x to the fourth. Over the complex numbers it always has four roots if you count repeats, so it can be written as a times four factors.

f(x)\displaystyle f(x)=ax4+bx3+cx2+dx+e\displaystyle {}= ax^4 + bx^3 + cx^2 + dx + e
f(x)\displaystyle f(x)=a(x−r1)(x−r2)(x−r3)(x−r4)\displaystyle {}= a(x - r_1)(x - r_2)(x - r_3)(x - r_4)

A general formula exists, but it runs through a cubic and is far too long to use by hand. So the tool works the way a careful student would. First it tests the shortcuts, then it falls back on numbers.

  • Rational roots. With whole-number coefficients, any fraction root is p over q, where p divides e and q divides a. Each one found is divided out, and the polynomial left is one degree lower.
  • Two quadratics. If no fraction root exists, the tool tries to split the quartic into two whole-number quadratics. The quadratic formula then gives each pair, as square roots or as a complex pair.
  • Biquadratic. With no x cubed or x term, the swap u = x² turns it into a quadratic in u. Each u gives two roots, plus and minus its square root.
  • Numbers. If none of these works, the roots are found numerically and polished. Then the answer is shown in decimals only.

The last step of the working is a check. Each root goes back into the polynomial and should leave about 0. The four roots should also add up to b over a with its sign flipped, and multiply to e over a.

r1+r2+r3+r4\displaystyle r_1 + r_2 + r_3 + r_4=−ba\displaystyle {}= -\frac{b}{a}
r1r2r3r4\displaystyle r_1 r_2 r_3 r_4=ea\displaystyle {}= \frac{e}{a}

Worked examples

Priya factors her homework quartic

x4−2x3−7x2+8x+12\displaystyle x^4 - 2x^3 - 7x^2 + 8x + 12=0\displaystyle {}= 0

Here a is 1, so every fraction root would be a whole number that divides 12. Trying them finds four: −2, −1, 2, 3. That uses up all four roots, so the factored form is (x + 2)(x + 1)(x − 2)(x − 3).

The check agrees. The roots add to 2, which is minus b over a, and multiply to 12, which is e over a. The graph crosses the x-axis four times, with low points at a height of −4 and a high point at 14.0625.

Those heights tell Priya what would change the answer. Raise the constant from 12 to 16 and the low points just touch the axis, leaving 2 double roots. Raise it to 17 and 0 real roots are left. Drop it to −3.0625 and only 2 survive.

Open this example in the tool

A biquadratic with no fraction roots

x4−4x2+2\displaystyle x^4 - 4x^2 + 2=0\displaystyle {}= 0

No whole number divides 2 and works, and it does not split into whole-number quadratics. But it has no x cubed or x term, so put u = x². That gives u² − 4u + 2 = 0, with a discriminant of 8.

u\displaystyle u=2±2\displaystyle {}= 2 \pm \sqrt{2}
x\displaystyle x=±2±2\displaystyle {}= \pm\sqrt{2 \pm \sqrt{2}}

Both values of u are positive, so all 4 roots are real. In decimals they are −1.8478, −0.7654, 0.7654, 1.8478.

Open this example in the tool

Two real roots and a complex pair

x4−x2−2\displaystyle x^4 - x^2 - 2=(x2+1)(x2−2)\displaystyle {}= (x^2 + 1)(x^2 - 2)

This one splits into 2 whole-number quadratics. The factor x² − 2 gives the real roots plus and minus the square root of 2, about 1.4142. The factor x² + 1 never reaches 0 for a real x, so it gives the complex pair i and −i.

So the graph crosses the axis only twice, and the discriminant is −2,592. A negative discriminant always means exactly two real roots, as long as no root repeats.

Open this example in the tool

Reading your result

Real roots come in 4, 2 or 0. A polynomial with real coefficients has complex roots in conjugate pairs, a + bi with a − bi. So a quartic cannot have one or three real roots once repeats are counted.

Touching and crossing. At a root that repeats an even number of times, the graph touches the x-axis and turns back. At an odd one it crosses. The equation x⁴ − 4x² + 4 has 2 double roots, so its graph only touches the axis.

The discriminant is a to the sixth times the product of every squared difference of two roots (MathWorld). It is 0 when a root repeats. With distinct roots, a negative value means two real roots. A positive value means four or none: x⁴ + 1 has a positive discriminant of 256 and 0 real roots.

Turning points. A degree 4 curve has at most three turning points. They decide the pattern: if the low points sit above the axis, there are no real roots.

Common mistakes

  • Dropping a zero coefficient. For x⁴ − 5x² + 4, b and d are 0. Leaving them out of the boxes shifts every number into the wrong power.
  • Stopping at whole numbers. The rational root test includes fractions. For 2x⁴ − 3x³ − 3x² + 2x, one root is 1 over 2, and it shows up as the factor 2x − 1.
  • Taking only the positive square root. In a biquadratic each u gives two roots, plus and minus its square root, and a negative u gives an imaginary pair.
  • Trusting a repeated irrational root to many digits. The double roots of (x² − 2)² can only be pinned down to about seven or eight digits, so the last digits shown are less sure than for a single root.

Questions people ask

Not when repeats are counted. Complex roots come in pairs, so the real count is 4, 2 or 0. It can look like one real root when that root repeats, as in (x − 1)² times (x² + 1).

Sources