Cubic Equation Solver
Find all roots (real and complex) of cubic equations.
What is a Cubic Equation?
A cubic equation is a polynomial equation of degree three, written in the standard form ax³ + bx² + cx + d = 0, where a ≠ 0. The highest power of the variable is 3, which is why it is called "cubic" (from the Latin cubus, meaning cube). By the Fundamental Theorem of Algebra, every cubic equation has exactly three roots — real or complex — counting multiplicity.
How to Solve a Cubic Equation
The approach depends on whether the constant term d is zero or not. Both cases ultimately aim to factor or reduce the equation to simpler forms.
Methods to Solve Cubic Equations That Do Not Have a Constant (d = 0)
When d = 0, the equation becomes ax³ + bx² + cx = 0. Factor out x:
This immediately gives x = 0 as one root. The remaining two roots come from solving the quadratic ax² + bx + c = 0 using the quadratic formula. This is the simplest case and requires no advanced techniques.
Methods to Solve Cubic Equations That Have a Constant (d ≠ 0)
When a constant term is present, the following methods apply:
- Rational Root Theorem: Test candidate roots of the form ±(factor of d) / (factor of a). If a rational root is found, divide it out and solve the remaining quadratic.
- Cardano's Formula: A general algebraic formula valid for all cubics. Substitute x = t − b/(3a) to eliminate the x² term, then apply the depressed cubic formula.
- Trigonometric Method: When the discriminant is positive (three real roots), express the roots using cosine to avoid complex intermediate values.
- Numerical Methods: Newton-Raphson iteration locates roots to any desired precision when exact forms are impractical.
What is the Cubic Equation Formula?
Cardano's formula solves the depressed cubic t³ + pt + q = 0 (obtained after eliminating the x² term):
Where p = (3ac − b²) / (3a²) and q = (2b³ − 9abc + 27a²d) / (27a³). Back-substitute x = t − b/(3a) to recover the roots of the original equation.
Discriminant of a Cubic Equation
The discriminant Δ = 18abcd − 4b³d + b²c² − 4ac³ − 27a²d² reveals the nature of the roots without solving the equation:
| Discriminant | Nature of Roots |
|---|---|
| Δ > 0 | Three distinct real roots |
| Δ = 0 | Repeated root; at least two roots are equal (all real) |
| Δ < 0 | One real root and two complex conjugate roots |
How to Solve a Cubic Equation Step by Step
- Write in standard form: Arrange as ax³ + bx² + cx + d = 0 and identify a, b, c, d.
- Check for d = 0: If d = 0, factor out x and solve the resulting quadratic.
- Try the Rational Root Theorem: Test ±(factors of d)/(factors of a). Substitute each candidate into the equation.
- Divide out known roots: Use synthetic division or polynomial long division to reduce the cubic to a quadratic.
- Solve the quadratic: Apply the quadratic formula to find the remaining two roots.
- Apply Cardano's formula if no rational root exists: Compute p and q, evaluate the formula, then back-substitute.
What are the Roots of a Cubic Equation?
The three roots of ax³ + bx² + cx + d = 0 satisfy Vieta's formulas:
- x₁ + x₂ + x₃ = −b/a
- x₁x₂ + x₁x₃ + x₂x₃ = c/a
- x₁ · x₂ · x₃ = −d/a
These relationships are useful for checking solutions and constructing equations when roots are known. A cubic always has at least one real root because its graph must cross the x-axis (it extends to +∞ and −∞).
Cubic Equation — Examples
Example 1 (d = 0): Solve 2x³ − 8x² + 6x = 0
Factor: 2x(x² − 4x + 3) = 0 → 2x(x − 1)(x − 3) = 0
Roots: x = 0, x = 1, x = 3
Example 2 (rational root): Solve x³ − 6x² + 11x − 6 = 0
Test x = 1: 1 − 6 + 11 − 6 = 0 ✓. Divide: (x − 1)(x² − 5x + 6) = (x − 1)(x − 2)(x − 3)
Roots: x = 1, x = 2, x = 3
Example 3 (one real root): Solve x³ + x + 2 = 0
Test x = −1: −1 − 1 + 2 = 0 ✓. Divide: (x + 1)(x² − x + 2) = 0
Quadratic discriminant = 1 − 8 = −7 < 0
Roots: x = −1 and two complex roots x = (1 ± i√7)/2