Clear methods, worked examples and practical results.toolsgenio.com
☰

Cubic Equation Calculator

Your inputs

Calculated result

1.000000, 2.000000, 3.000000

Your result

3 real root value(s)

This calculator provides an estimate based on the entered values. Verify the assumptions and results before making decisions.

Intro

Cubic equations have a richer mathematical structure than their degree alone might suggest. Their solutions are controlled by algebraic relationships among the coefficients, and these relationships explain when roots are distinct, repeated, real or complex. A cubic equation calculator addresses the solution of a*x^3 + b*x^2 + c*x + d = 0 with a nonzero leading coefficient. For deeper understanding, the central tools are the depressed cubic transformation, Cardano's formulas, the discriminant and the relationship between repeated roots and derivatives.

This discussion develops those ideas carefully, including the different sign conventions used for discriminants. A worked example demonstrates how a repeated root can be discovered both through factorization and by analyzing stationary points.

About this result

How to use

Enter the requested values, then select Calculate to view the result.

Formula

Start with a*x^3 + b*x^2 + c*x + d = 0 and a ! = 0. Make the substitution x = y - b/(3a).

After expansion and simplification, the equation becomes y^3 + p*y + q = 0, where p = (3*a*c - b^2)/(3*a^2) and q = (2*b^3 - 9*a*b*c + 27*a^2*d)/(27*a^3). Define D = (q/2)^2 + (p/3)^3. If D > 0, there is one distinct real root. If D < 0, there are three distinct real roots.

If D = 0, at least two roots coincide. When p = q = 0, the depressed cubic is y^3 = 0 and the original cubic has a triple root. For D >= 0, one real depressed-cubic solution is y = cbrt(-q/2 + sqrt(D)) + cbrt(-q/2 - sqrt(D)).

The original variable is recovered using x = y - b/(3a). At D = 0, the remaining real roots can be recovered by algebraic factorization or by noting their multiplicities. For D < 0, define theta = arccos((-q/2)/sqrt(-(p/3)^3)). The three real solutions are x_k = 2*sqrt(-p/3)*cos((theta - 2*pi*k)/3) - b/(3a), for k = 0, 1 and 2.

The conventional cubic discriminant is Delta = b^2*c^2 - 4*a*c^3 - 4*b^3*d - 27*a^2*d^2 + 18*a*b*c*d. It satisfies Delta = -108*a^4*D. Unlike D, positive Delta indicates three distinct real roots. Finally, repeated roots obey f(r) = f'(r) = 0.

This derivative criterion provides an independent way to recognize multiplicity.

Worked example

Consider x^3 - 3*x + 2 = 0. This equation illustrates a double root, a distinct simple root and the boundary case of Cardano's classification. Step 1: Identify a = 1, b = 0, c = -3 and d = 2.

Because b is zero, the equation is already a depressed cubic. Step 2: Read p = -3 and q = 2 directly from y^3 + p*y + q = 0. Step 3: Calculate the Cardano quantity D = (q/2)^2 + (p/3)^3 = (2/2)^2 + (-3/3)^3 = 1 + (-1) = 0. Step 4: Interpret D = 0.

This indicates that some roots coincide, although the discriminant alone does not identify their values. Step 5: Test x = 1. Substitution gives 1 - 3 + 2 = 0, so x - 1 is a factor.

Step 6: Divide the polynomial by x - 1. The quotient is x^2 + x - 2, which factors as (x - 1)*(x + 2). Step 7: Combine factors to obtain (x - 1)^2*(x + 2) = 0.

Hence x = 1 is a double root and x = -2 is a simple root. Step 8: Verify using the derivative. Here f'(x) = 3*x^2 - 3.

At x = 1, f'(1) = 3 - 3 = 0. At x = -2, f'(-2) = 12 - 3 = 9, which is nonzero. Step 9: Check the second root directly: (-2)^3 - 3*(-2) + 2 = -8 + 6 + 2 = 0. The equation has two distinct real solutions, -2 and 1, with three roots when multiplicity is counted.

Understand the calculation

A real-coefficient cubic polynomial has degree three and consequently has three complex roots when counted with algebraic multiplicity. The fundamental theorem of algebra guarantees that count. Because complex nonreal roots occur in conjugate pairs for polynomials with real coefficients, at least one of the three roots must be real.

The number of distinct real roots depends on the coefficients. A cubic may have three distinct real roots, one distinct real root together with two nonreal roots, or two distinct real roots when one real root has multiplicity two. A triple root is also possible.

Repeated roots are therefore a central part of a complete classification. The derivative supplies a useful geometric interpretation. For f(x) = a*x^3 + b*x^2 + c*x + d, the derivative is f'(x) = 3*a*x^2 + 2*b*x + c.

A repeated root r satisfies both f(r) = 0 and f'(r) = 0. The converse also holds: a common zero of a polynomial and its derivative is a multiple root. A cubic with three distinct real roots has two distinct stationary points, with the local maximum and local minimum lying on opposite sides of the horizontal axis. When a stationary point falls exactly on the axis, a repeated root is present.

However, a cubic can have stationary points without possessing three distinct real roots; their heights relative to zero matter. A particularly effective mathematical transformation removes the squared term. It preserves the root relationships while producing a simpler equation.

The resulting depressed cubic has the form y^3 + p*y + q = 0. Its parameters p and q determine a quantity often called the Cardano discriminant or Cardano radicand. Care is required with terminology.

The conventional polynomial discriminant and Cardano's quantity have opposite signs for a real cubic with nonzero leading coefficient. Therefore, a statement about a positive discriminant is ambiguous unless the convention is specified. Numerical computation adds another layer of difficulty near repeated roots.

When distinct roots are extremely close, floating-point rounding may make it difficult to classify the exact multiplicity using ordinary numerical comparisons. Symbolic factorization can establish exact multiplicity when the coefficients permit exact arithmetic. Approximate methods require tolerance choices and error analysis.

These principles characterize cubic equations generally. They do not establish which algorithms, precision settings or result formats are implemented by an unverified calculator engine.

Questions

What is a depressed cubic equation?

A depressed cubic is an equation of the form y^3 + p*y + q = 0, containing no squared term. Every genuine cubic can be transformed into this form by an appropriate change of variable.

Why do cubic discriminant sign conventions differ?

Cardano's quantity D and the conventional polynomial discriminant Delta are related by Delta = -108*a^4*D. Since a^4 is positive for nonzero real a, their signs are opposite.

How can derivatives identify repeated roots?

A number r is a repeated root of a polynomial precisely when both the polynomial and its first derivative vanish at r. The derivative detects the shared factor associated with multiplicity.

What is the difference between a double and triple root?

A double root corresponds to a squared linear factor and has multiplicity two. A triple root corresponds to a cubed linear factor and accounts for all three roots of a cubic.

Why can Cardano's method involve complex intermediate values?

When a cubic has three distinct real roots, the direct radical expressions in Cardano's classical method can pass through complex numbers. Trigonometric representations provide a real-valued alternative in that case.

Can a cubic have stationary points but only one real root?

Yes. Two stationary points can exist while both associated function values lie on the same side of zero. In that situation the cubic crosses the horizontal axis only once.

Why is numerical multiplicity difficult near the discriminant boundary?

Small changes in coefficients or floating-point rounding can alter whether closely spaced roots appear equal. Exact multiplicity is an algebraic property, while approximate equality depends on numerical tolerances and precision.