Advertisement
Loading...

Cubic Equation Solver

Find all three roots of ax³ + bx² + cx + d = 0 instantly

Equation Preview

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

Leading coefficient — must not be zero

Quick examples

Enter Coefficients to Solve

Enter the four coefficients a, b, c, and d for your cubic equation ax³ + bx² + cx + d = 0 to find all three roots instantly.

Advertisement
Loading...

How to Use the Cubic Equation Solver

1

Enter the Four Coefficients

Type your values for a, b, c, and d in the input fields on the left. These correspond to the equation ax³ + bx² + cx + d = 0. For example, for the equation x³ − 6x² + 11x − 6 = 0, enter a = 1, b = −6, c = 11, d = −6. If a term is absent (e.g., no x² term), enter 0 for that coefficient. The equation preview updates live as you type.

2

Review the Equation Preview

As you type, the equation preview above the inputs shows the formatted cubic equation with your current values. This lets you confirm the equation is entered correctly before solving. You can also click one of the quick example presets to load a well-known equation and see how the solver works.

3

Read the Results

After entering your coefficients, the solver automatically computes all three roots and displays them on the right. Each root is shown as a decimal approximation. Complex roots are displayed in the form a + bi. The root type badge tells you whether you have three real roots, one real and two complex conjugates, or repeated roots. The discriminant value and its interpretation are shown below the roots.

4

Explore the Detailed Breakdown

Click 'Show Step-by-Step Solution' to see the full derivation from your coefficients to the final roots, including the depressed cubic, intermediate values, and which method (Cardano or trigonometric) was used. Click 'Show Vieta's Verification' to confirm the roots satisfy the classical sum, sum-of-products, and product relationships. Use 'Export CSV' to download all results, or 'Print' for a printer-friendly version.

Frequently Asked Questions

Does a cubic equation always have at least one real root?

Yes — every cubic polynomial with real coefficients has at least one real root. This follows from the intermediate value theorem: since a cubic function f(x) = ax³ + bx² + cx + d approaches +∞ as x → +∞ and −∞ as x → −∞ (or vice versa when a < 0), the continuous function must cross the x-axis at least once. By the fundamental theorem of algebra, a cubic has exactly three roots (counted with multiplicity) in the complex numbers. Since complex roots of real polynomials come in conjugate pairs, and three minus two equals one, there is always at least one real root.

What does the discriminant tell me about the roots?

The discriminant Δ = 18abcd − 4b³d + b²c² − 4ac³ − 27a²d² is a single number that classifies the nature of all three roots without solving the equation. If Δ < 0, the equation has three distinct real roots (the curve crosses the x-axis three times). If Δ = 0, at least two roots are equal — either one double root and one single root, or one triple root. If Δ > 0, there is one real root and two non-real complex conjugate roots (the curve crosses the x-axis exactly once). The discriminant is essentially a polynomial in the coefficients, computed from the resultant of the cubic and its derivative.

What is Cardano's formula and when is it used?

Cardano's formula is the analytic solution for the depressed cubic t³ + pt + q = 0, published by Gerolamo Cardano in Ars Magna (1545). After reducing ax³ + bx² + cx + d = 0 to depressed form via the substitution x = t − b/(3a), compute D = (q/2)² + (p/3)³. When D > 0, Cardano's formula gives: S = ∛(−q/2 + √D), T = ∛(−q/2 − √D). Then t₁ = S + T, t₂ = −(S+T)/2 + i(S−T)√3/2, t₃ = −(S+T)/2 − i(S−T)√3/2. When D ≤ 0 (three real roots), using Cardano's formula directly requires taking cube roots of complex numbers; the trigonometric (Viète) method avoids this and is used instead.

Why is the trigonometric method needed for three real roots?

When the discriminant is negative (three distinct real roots), Cardano's formula leads to intermediate cube roots of complex numbers even though the final answers are all real. This is the 'casus irreducibilis' (irreducible case) — the cubic cannot be solved using only real arithmetic in Cardano's framework. The trigonometric method bypasses this by writing the depressed cubic in terms of cosines: let m = 2√(−p/3) and θ = (1/3)arccos(3q/(pm)). The three roots are then x₁ = m·cos(θ) − b/(3a), x₂ = m·cos(θ − 2π/3) − b/(3a), x₃ = m·cos(θ − 4π/3) − b/(3a). This method works entirely with real arithmetic and is numerically stable.

What are Vieta's formulas and how do they verify the roots?

Vieta's formulas express relationships between the roots r₁, r₂, r₃ and the coefficients of the polynomial directly. For ax³ + bx² + cx + d = 0: the sum r₁ + r₂ + r₃ = −b/a; the sum of root pairs r₁r₂ + r₁r₃ + r₂r₃ = c/a; the product r₁r₂r₃ = −d/a. These relationships must hold for any set of roots of the cubic. After computing roots, the solver checks all three Vieta conditions. If the computed values match the expected coefficient ratios (within floating-point tolerance), it confirms the roots are correct. Vieta's formulas are named after French mathematician François Viète (1540–1603).

Can this solver handle equations with fractional or negative coefficients?

Yes — the solver accepts any real-number coefficients, including negative values, decimals, and fractions (entered as decimals). For example, to solve 0.5x³ − 1.5x² + 1.5x − 0.5 = 0, enter a = 0.5, b = −1.5, c = 1.5, d = −0.5. The only restriction is that a must not be zero. If you have fractional coefficients like 3/4, convert them to their decimal equivalent (0.75) before entering. For very large or very small coefficient values, you may see minor floating-point rounding in the last displayed digit — this is normal for 64-bit arithmetic and does not affect the practical accuracy of the result.