QuadraticCalc

Cubic / Quartic Solver

Find all real and complex roots of a cubic or quartic polynomial, shown on the graph and on the complex plane.

Your Values

Degree 3 or 4, for example x^4 - 5x^2 + 4

Try an example

Visualization

Results

Step-by-Step Solution

    How Cubic / Quartic Solver Works?

    The cubic / quartic solver checks the degree, lists the rational root candidates, finds every root at once with the Durand–Kerner method, and refines each root with Newton’s method.

    1. Type a degree 3 or 4 polynomial
    2. Check the degree
    3. List rational candidates ±p/q
    4. Iterate Durand–Kerner on all roots
    5. Polish each root with Newton’s method
    6. Verify with Vieta’s sum of roots

    The top chart shows the real roots as x-intercepts. The complex plane below it shows every root, real roots on the horizontal axis and complex roots as mirrored pairs.

    Cubic / Quartic Formula

    The cubic formula solves ax³ + bx² + cx + d = 0 through the depressed cubic t³ + pt + q = 0, and the cubic discriminant Δ = 18abcd − 4b³d + b²c² − 4ac³ − 27a²d² decides the type of roots.

    t = ∛(−q/2 + √(q²/4 + p³/27)) + ∛(−q/2 − √(q²/4 + p³/27))
    p
    (3ac − b²) / 3a²
    q
    (2b³ − 9abc + 27a²d) / 27a³
    x
    t − b / 3a
    Δ > 0
    3 distinct real roots
    Δ < 0
    1 real and 2 complex roots
    EquationRootsFactored form
    x³ − 6x² + 11x − 6 = 01, 2, 3(x − 1)(x − 2)(x − 3)
    x⁴ − 5x² + 4 = 0−2, −1, 1, 2(x² − 1)(x² − 4)
    x³ + x + 1 = 0−0.6823 and 0.3412 ± 1.1615i1 real, 2 complex
    x⁴ + 1 = 0±0.7071 ± 0.7071i4 complex roots

    Gerolamo Cardano published the cubic formula in Ars Magna in 1545, and the same book contained Lodovico Ferrari’s solution of the quartic.

    Cubic / Quartic Solver FAQ

    How Many Roots Does a Cubic Equation Have?

    A cubic equation has exactly 3 roots counted with multiplicity, and at least 1 of them is real when the coefficients are real.

    Is There a Formula for Quartic Equations?

    Yes, Lodovico Ferrari found a general quartic formula in about 1540, which reduces the quartic to a cubic.

    Is There a Formula for Degree 5 Equations?

    No, the Abel–Ruffini theorem (1824) proves that no general formula in radicals solves degree 5 equations, so numerical methods are used instead.

    Can a Cubic Have No Real Roots?

    No, a cubic with real coefficients always crosses the x-axis at least once, so it has at least 1 real root.

    How Accurate Are the Roots From the Cubic / Quartic Solver?

    The roots are accurate to about 9 decimal places after Newton refinement, and the results show 6 decimal places.