Cubic Equation Solver

Find all roots (real and complex) of cubic equations.

Equation: ax³ + bx² + cx + d = 0

Equation
Enter coefficients
Root x₁
Root x₂
Root x₃
Discriminant (Δ)
Real Roots
Complex Roots
Depressed Form
Nature

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:

x(ax² + bx + c) = 0

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):

t = ³√(−q/2 + √((q/2)² + (p/3)³)) + ³√(−q/2 − √((q/2)² + (p/3)³))

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:

DiscriminantNature of Roots
Δ > 0Three distinct real roots
Δ = 0Repeated root; at least two roots are equal (all real)
Δ < 0One real root and two complex conjugate roots

How to Solve a Cubic Equation Step by Step

  1. Write in standard form: Arrange as ax³ + bx² + cx + d = 0 and identify a, b, c, d.
  2. Check for d = 0: If d = 0, factor out x and solve the resulting quadratic.
  3. Try the Rational Root Theorem: Test ±(factors of d)/(factors of a). Substitute each candidate into the equation.
  4. Divide out known roots: Use synthetic division or polynomial long division to reduce the cubic to a quadratic.
  5. Solve the quadratic: Apply the quadratic formula to find the remaining two roots.
  6. 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

Frequently Asked Questions

How do I solve a cubic equation by hand?
Start by checking if d = 0 (factor out x) or testing rational roots using the Rational Root Theorem. If a root r is found, divide the cubic by (x − r) to get a quadratic, then solve that with the quadratic formula. If no rational root exists, use Cardano's formula with the depressed cubic substitution.
How do I find a cubic equation when roots are given?
If the roots are r₁, r₂, r₃, the equation is a(x − r₁)(x − r₂)(x − r₃) = 0. Expanding gives ax³ − a(r₁+r₂+r₃)x² + a(r₁r₂+r₁r₃+r₂r₃)x − ar₁r₂r₃ = 0. Choose a = 1 for the monic form.
How do I solve a cubic equation using synthetic division?
Once you identify a root r (by testing or inspection), set up synthetic division with the coefficients a, b, c, d and divisor r. Bring down a, multiply by r, add to b, repeat. The result gives the three coefficients of the quotient quadratic, which you then solve normally.
How do I factorize cubic equations?
Factor out any common terms first, then find one root (rational root test or inspection). Use that root to divide the cubic into a linear factor (x − r) and a quadratic. Factor the quadratic further if its discriminant ≥ 0, or leave it in quadratic form if it yields complex roots.
How do I write a cubic equation from a graph?
Read the three x-intercepts r₁, r₂, r₃ from the graph. Write y = a(x − r₁)(x − r₂)(x − r₃). Substitute any other known point (e.g., the y-intercept) to solve for a. If the graph has a repeated root at r₁, write y = a(x − r₁)²(x − r₂).
What are common mistakes when solving cubic equations?
The most frequent errors include: forgetting that d = 0 means x = 0 is always a root; not testing all rational root candidates before switching to Cardano's formula; sign errors when computing p and q in the depressed form; and assuming there are always three real roots when the discriminant may be negative (giving one real and two complex roots).