Logo

MonoCalc

/

Cubic Equation Solver

Math

x³ − 6x² + 11x − 6 = 0

Coefficients

Must be ≠ 0
Three Distinct Real Roots

Roots

x

1

x

2

x

3

Analysis

Discriminant Δ

4

Normalized A

-6

Normalized B

11

Normalized C

-6

Depressed p

-1

Depressed q

0

Y-intercept

-6

Forms & Critical Points

Factored Form

(x − 1)(x − 2)(x − 3)

Critical Points (f′(x) = 0)

Local Max(1.42265, 0.3849)
Local Min(2.57735, -0.3849)

Graph

Real roots

Y-intercept

Local max

Local min

About This Tool

🔢 Cubic Equation Solver – Find All Roots of ax³ + bx² + cx + d = 0

A cubic equation is any polynomial equation of degree three, written in the standard form ax³ + bx² + cx + d = 0 where a ≠ 0. Unlike a quadratic that has at most two roots, every cubic with real coefficients has exactly three roots (counting multiplicity), though some may be complex. This tool solves any cubic instantly — returning all roots, a discriminant, a graph, and an optional step-by-step derivation.

📐 How Are Cubic Equations Solved?

The standard analytical path follows three stages: normalization, depression, and root extraction.

Stage 1 — Normalize

Divide every term by the leading coefficient a to produce:

x³ + Ax² + Bx + C = 0
where A = b/a, B = c/a, C = d/a

Stage 2 — Depress (Eliminate the x² Term)

Substitute x = t − A/3. This eliminates the quadratic term and yields the depressed cubic:

t³ + pt + q = 0
p = B − A²/3
q = 2A³/27 − AB/3 + C

The depressed form has only two parameters and is the foundation of all classical methods.

Stage 3 — Extract Roots

The solving method depends on the sign of the cubic discriminant Δ = 18abcd − 4b³d + b²c² − 4ac³ − 27a²d²:

Discriminant ΔRoot ConfigurationMethod Used
Δ > 0Three distinct real rootsTrigonometric (casus irreducibilis)
Δ = 0Repeated root (double or triple)Simplified Cardano formulas
Δ < 0One real root + two complex conjugatesCardano's formula

🔬 Cardano's Formula

When Δ < 0, Cardano's formula solves the depressed cubic directly. Define the Cardano discriminant:

Δ_c = (q/2)² + (p/3)³

Then compute:

u = ∛(−q/2 + √Δ_c)
v = ∛(−q/2 − √Δ_c)
Real root: t = u + v, so x = t − A/3
Complex roots: x = −(u+v)/2 ± i(√3/2)|u−v| − A/3

🌀 Trigonometric Method (Three Real Roots)

When Δ > 0, all three roots are real. Cardano's formula would involve the cube root of a complex number (the casus irreducibilis), so the elegant trigonometric method is used instead:

m = 2√(−p/3)
θ = (1/3) · arccos(3q / (pm))
x_k = m · cos(θ − 2πk/3) − A/3   for k = 0, 1, 2

📊 What the Graph Shows

The interactive graph plots the cubic curve y = ax³ + bx² + cx + dover an auto-scaled range centered on the roots. Color-coded markers highlight:

  • Green dots — real roots (x-intercepts where y = 0)
  • Orange dot — y-intercept (x = 0, equals d)
  • Red dot — local maximum (where f′(x) = 0, concave down)
  • Blue dot — local minimum (where f′(x) = 0, concave up)

Critical points are found by solving the derivative f′(x) = 3ax² + 2bx + c = 0 as a standard quadratic.

Discriminant sign is everything

The sign of Δclassifies the roots before any calculation. Δ > 0 guarantees three real crossings on the graph. Δ < 0 means the curve crosses the x-axis exactly once. Δ = 0 means the curve touches the x-axis without crossing at the repeated root.

🔁 Root Multiplicity

When Δ = 0 the cubic has a repeated root. If both depressed parameters p and q are zero, the root is a triple root at x = −b/(3a). Otherwise there is one double root and one simple root. The tool labels each root's multiplicity so you know whether the curve touches or crosses the x-axis.

📋 Worked Example: Three Distinct Roots

x³ − 6x² + 11x − 6 = 0  (a=1, b=−6, c=11, d=−6)
Δ = 18(1)(−6)(11)(−6) − 4(−6)³(−6) + ... = 4 > 0
Three distinct real roots: x = 1, x = 2, x = 3
Factored: (x−1)(x−2)(x−3)

📋 Worked Example: Complex Roots

x³ + x + 1 = 0  (a=1, b=0, c=1, d=1)
Δ < 0 → one real root + two complex conjugates
Real root ≈ −0.6824
Complex roots ≈ 0.3412 ± 1.1615i

🎓 Applications of Cubic Equations

Cubic equations appear throughout science, engineering, and mathematics:

  • Physics: van der Waals equation of state for real gases involves a cubic in volume
  • Engineering: beam deflection, structural load calculations, and fluid dynamics often produce cubic polynomials
  • Computer graphics: Bézier curve intersections and parametric surface computations
  • Economics: cubic cost and revenue functions for optimization
  • Algebra coursework: factoring cubics, rational roots, and polynomial long division

⚠️ Accuracy and Limitations

This solver uses 64-bit floating-point arithmetic. Results are accurate to about 12–14 significant digits for well-conditioned inputs. Very large coefficient magnitudes (e.g., |a| > 10¹²) or very close roots may introduce rounding errors. The repeated-root detector uses a tolerance of 1×10⁻⁹, so near-but-not-exact repeated roots are reported as distinct. For exact symbolic results in algebra coursework, verify with rational root theorem or polynomial long division after identifying a rational root numerically.

Frequently Asked Questions

Is the Cubic Equation Solver free?

Yes, Cubic Equation Solver is totally free :)

Can I use the Cubic Equation Solver offline?

Yes, you can install the webapp as PWA.

Is it safe to use Cubic Equation Solver?

Yes, any data related to Cubic Equation Solver only stored in your browser (if storage required). You can simply clear browser cache to clear all the stored data. We do not store any data on server.

What is a cubic equation?

A cubic equation is a polynomial equation of degree three written in the form ax³ + bx² + cx + d = 0, where a, b, c, and d are real numbers and a ≠ 0. Every cubic equation with real coefficients has at least one real root, and the full set of three roots may include one or two complex (imaginary) numbers.

How does the Cubic Equation Solver work?

Enter coefficients a, b, c, and d. The tool normalizes the equation by dividing by a, then shifts the variable to produce a depressed cubic t³ + pt + q = 0. It computes the cubic discriminant Δ to classify the roots, then applies the trigonometric method (three real roots, Δ > 0) or Cardano's formula (one real + two complex, Δ < 0). Repeated-root cases are handled with tolerance-aware detection.

What does the discriminant tell me for a cubic?

The cubic discriminant Δ = 18abcd − 4b³d + b²c² − 4ac³ − 27a²d². If Δ > 0 there are three distinct real roots. If Δ = 0 there is at least one repeated root (double or triple). If Δ < 0 there is exactly one real root and two complex conjugate roots.

What is the depressed cubic and why is it used?

The depressed cubic t³ + pt + q = 0 is obtained by substituting x = t − b/(3a) to eliminate the x² term. This simplification is the foundation of both Cardano's formula and the trigonometric method, reducing the general cubic to a two-parameter form that is much easier to solve analytically.

Can this tool return complex roots?

Yes. When the discriminant Δ < 0 the cubic has one real root and two complex conjugate roots. These are displayed in a + bi form. Complex roots always come in conjugate pairs when the original coefficients are real numbers.

How are critical points and the graph computed?

The derivative f′(x) = 3ax² + 2bx + c is solved as a quadratic to find turning points (local max and local min). These are plotted on the graph alongside the real roots and the y-intercept. The graph x-range is automatically centered on the roots and turning points so all key features are visible.