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
—

Quick Examples

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

Special Cubic Forms Worth Recognizing

Before reaching for Cardano's formula, check whether your cubic matches one of these special forms — they factor in one step:

FormFactorizationRoots
x3 = a—x = ³√a (one real root; two complex)
(x + a)3 = 0 (perfect cube)(x + a)(x + a)(x + a) = 0x = −a (triple root)
x3 − a3 = 0 (difference of cubes)(x − a)(x2 + ax + a2) = 0x = a, plus two complex roots
x3 + a3 = 0 (sum of cubes)(x + a)(x2 − ax + a2) = 0x = −a, plus two complex roots
ax3 + bx2 + cx = 0 (no constant)x(ax2 + bx + c) = 0x = 0 and the two quadratic roots

Worked example: Solve x3 − 8 = 0. This is a difference of cubes with a = 2: (x − 2)(x2 + 2x + 4) = 0. The linear factor gives x = 2. The quadratic has discriminant 4 − 16 = −12, giving x = −1 ± i√3. Recognizing the form saved all the Cardano arithmetic.

The Depressed Cubic and the Trigonometric Method

Every cubic ax3 + bx2 + cx + d = 0 becomes a depressed cubic t3 + pt + q = 0 (no t2 term) with the substitution x = t − b/(3a), where:

p = (3ac − b2) / (3a2)    q = (2b3 − 9abc + 27a2d) / (27a3)

When the discriminant is positive (three real roots), Cardano's formula forces square roots of negative numbers — the casus irreducibilis. The trigonometric method avoids this entirely:

tk = 2√(−p/3) · cos( (1/3) arccos( (3q/2p)√(−3/p) ) − 2πk/3 ),  k = 0, 1, 2

Worked example: Solve x3 − 3x + 1 = 0 (already depressed, p = −3, q = 1). Then 2√(−p/3) = 2 and (3q/2p)√(−3/p) = −1/2, so arccos(−1/2) = 120°. The three roots are 2cos(40°) ≈ 1.532089, 2cos(40° − 120°) ≈ 0.347296, and 2cos(40° − 240°) ≈ −1.879385 — all real, no complex intermediates.

A Short History of the Cubic Formula

The cubic formula is one of algebra's great stories. Scipione del Ferro solved the depressed cubic around 1515 but kept it secret. Niccolò Tartaglia independently found the method and shared it with Gerolamo Cardano under an oath of secrecy — which Cardano broke, publishing the formula in his 1545 book Ars Magna. The solution is still called Cardano's formula today. The work also forced mathematicians to take square roots of negative numbers seriously, planting the seeds of complex numbers.

Reading a Cubic from Its Graph

The graph of y = ax3 + bx2 + cx + d is an S-shaped curve (or an inverted S when a < 0):

  • End behavior: When a > 0, the curve falls from the lower left and rises to the upper right; when a < 0, the reverse. This is why a cubic always crosses the x-axis at least once — it must travel from −∞ to +∞.
  • x-intercepts are the real roots: a crossing is a single root, a touch-and-turn is a double root, a flat pass through the axis is a triple root.
  • Turning points (local maximum and minimum) sit where the derivative 3ax2 + 2bx + c = 0. There are two when b2 − 3ac > 0, one flat point when it equals 0, and none when it is negative.
  • Inflection point: The curve's center of symmetry, where concavity changes, is at x = −b/(3a) — always exactly halfway between the two turning points.
  • y-intercept is simply d, the constant term.

Real-World Applications of Cubic Equations

FieldWhere Cubics Appear
PhysicsProjectile motion with air resistance; the range equation becomes cubic
EngineeringBeam deflection and structural analysis under distributed loads
EconomicsCubic cost and revenue models for finding optimal production levels
ChemistryReaction kinetics and equilibrium concentration calculations
Computer graphicsBézier curves and spline interpolation are built from cubic polynomials
Volume problemsDesigning boxes and containers: volume as a function of one dimension is often cubic

Common Mistakes to Avoid

  • Stopping after one root: A cubic has three roots. Always divide out each root you find and solve the remaining quadratic.
  • Skipping the rational root test: Jumping straight to Cardano's formula hides simple integer roots inside nested radicals.
  • Forgetting negative and fractional candidates: When the leading coefficient is not 1, candidates are ±p/q, not just factors of d.
  • Assuming "no real roots": Every cubic has at least one real root. A negative discriminant means two complex roots — not zero roots.
  • Entering a = 0: That makes the equation quadratic, not cubic; the cubic formula divides by a and fails.

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