🔢 Quartic Equation Solver – Find All Roots of ax⁴+bx³+cx²+dx+e=0
A quartic equation is a polynomial equation of degree four, written in the standard form ax⁴ + bx³ + cx² + dx + e = 0 where a ≠ 0. Every quartic with real coefficients has exactly four roots (counting multiplicity), though some may be complex numbers. Quartics show up in beam-deflection and lens-design problems, orbital mechanics, ray-surface intersection tests in computer graphics, and advanced algebra coursework. This tool solves any quartic instantly — returning all four roots, a discriminant, a factored form, and an optional step-by-step derivation.
📐 How Quartic Equations Are Solved
The classical approach follows three stages: normalization, depression, and Ferrari's factorization.
Stage 1 — Normalize and Depress
Divide every term by the leading coefficient a, then substitute x = t − b/4a to eliminate the cubic term. This yields the depressed quartic:
t⁴ + pt² + qt + r = 0
p = C − 3B²/8, q = D − BC/2 + B³/8, r = E − BD/4 + B²C/16 − 3B⁴/256where B, C, D, E are the coefficients after dividing by a. The depressed form has only three parameters and is the foundation of every classical quartic method.
Stage 2 — Biquadratic Fast Path
When b = 0 and d = 0 in the original equation (equivalently, when the depressed q ≈ 0), the quartic reduces to ax⁴ + cx² + e = 0. Substituting u = x² turns this into an ordinary quadratic in u, solved with the quadratic formula, then x = ±√u for each solution — no resolvent cubic required.
Stage 3 — Ferrari's Method
For the general case, Ferrari's method introduces an auxiliary parameter y and forms the resolvent cubic:
y³ − p·y² − 4r·y + (4pr − q²) = 0This tool solves the resolvent cubic by reusing the same trigonometric and Cardano-formula logic that powers the Cubic Equation Solver, then picks a real root y that keeps the arithmetic well-conditioned. With s = √(y − p), the depressed quartic factors into two quadratics:
t² − s·t + (y/2 + q/2s) = 0
t² + s·t + (y/2 − q/2s) = 0Each quadratic is solved with the standard quadratic formula (allowing complex coefficients), giving four values of t, which are then shifted back via x = t − b/4a to recover the roots of the original quartic.
| Root Nature | Description |
|---|---|
| Four distinct real roots | The curve crosses the x-axis four times |
| Two real + two complex | The curve crosses the x-axis twice, plus one complex conjugate pair |
| Four complex roots | No real crossings — two distinct conjugate pairs |
| Repeated / multiple root | Two or more roots coincide (double, triple, or quadruple) |
📊 What the Graph Shows
The interactive graph plots y = ax⁴ + bx³ + cx² + dx + e over an auto-scaled range. Green dots mark real roots, the orange dot marks the y-intercept (x = 0, equal to e), and red/blue dots mark local maxima and minima, found by solving the derivative cubic f′(x) = 4ax³ + 3bx² + 2cx + d = 0 — again reusing the cubic solver rather than duplicating the logic.
Every computed root is substituted back into the original equation, and the residual is checked against a tolerance scaled to the size of the coefficients. If the residual is unexpectedly large, the tool flags the result so you know to treat it as approximate rather than exact.
📋 Worked Example
x⁴ − 10x² + 9 = 0 (a=1, b=0, c=−10, d=0, e=9)
Biquadratic (b = d = 0): let u = x², then u² − 10u + 9 = 0 → u = 1 or 9
Roots: x = −3, −1, 1, 3
Factored: (x+3)(x+1)(x−1)(x−3)🎓 Applications of Quartic Equations
- Engineering: beam deflection under load and lens curvature calculations in optics
- Physics: orbital mechanics problems and certain wave equation solutions
- Computer graphics: ray-surface intersection tests and Bézier/parametric curve analysis
- Algebra coursework: factoring, the rational root theorem, and polynomial division practice
⚠️ Accuracy and Limitations
This solver uses 64-bit floating-point arithmetic and is accurate to roughly 10–12 significant digits for well-conditioned coefficients. Very large coefficient magnitudes (beyond about 10¹⁵) or nearly repeated roots can introduce rounding error, which is why every root is re-verified by substitution before being displayed. The repeated-root detector compares roots pairwise with a small numeric tolerance, so near-but-not-exact repeated roots are reported as distinct.