Free Cubic Equation Calculator

ax³ bx² cx d = 0

Roots

Enter coefficients and click Solve to find the cubic roots

Cubic equations are among the most frequently encountered higher‑degree polynomials in mathematics, physics, and engineering. Whether you are analyzing the eigenvalues of a 3×33\times3 matrix, fitting a cubic regression model to data, or solving geometric volume problems, you often need to find the roots of a cubic polynomial. This cubic equation calculator provides a fast and reliable way to solve such equations online — it serves as a free cubic equation solver, a cubic polynomial solver, and a cubic root finder all in one. With this tool you can also inspect the graph of the cubic function, making the results easier to interpret.

Understanding Cubic Equations

A cubic equation is a polynomial equation of degree three. Its standard form is

ax3+bx2+cx+d=0,a≠0,a x^{3} + b x^{2} + c x + d = 0, \qquad a \neq 0,

where the coefficients a,b,c,da, b, c, d are real numbers. The name “cubic” comes from the highest exponent being 3. Simple examples include 3x3+2x2−x+5=03x^{3}+2x^{2}-x+5=0 and the well‑known x3−8=0x^{3}-8=0.

The fundamental theorem of algebra guarantees that every cubic equation has exactly three complex roots (counting multiplicities). At least one of these roots is always real; the other two may be real or may form a complex conjugate pair — that is, they have identical real parts and opposite imaginary parts. For instance, the equation x3−8=0x^{3}-8=0 has the real root 22 together with the complex roots −1+1.73205 i-1+1.73205\,i and −1−1.73205 i-1-1.73205\,i.

Cubic equations appear in many areas of science and engineering. The characteristic polynomial of a 3×33\times3 matrix is cubic, so solving it is essential for eigenvalue analysis. In statistics, cubic regression uses a cubic polynomial to capture non‑linear trends. Many geometric and physical problems, from computing volumes to analyzing control systems, also lead to cubic equations.

Using the Cubic Equation Solver

Operating this calculator is straightforward:

  1. Enter the coefficients a,b,c,da, b, c, d of the cubic equation into the input fields.
  2. The tool instantly returns the three roots (both real and complex values).
  3. It also displays the discriminant of the cubic polynomial, which reveals the nature of the roots without further computation.
  4. A graph of the cubic function is plotted, and you can adjust the portion of the xx-axis shown.

This makes the calculator an ideal resource for verifying manual work or for obtaining quick answers when the full Cardano formula is too cumbersome.

Solving Cubic Equations Manually

When solving a cubic by hand, the strategy depends on whether you already know one of its roots.

If One Root Is Known

If you can find a root rr — for example, by applying the rational root test or by reading an xx-intercept from a graph — you can reduce the problem to a quadratic. Divide the original cubic by x−rx-r using polynomial long division or synthetic division. The quotient is a quadratic trinomial, which you can solve with the quadratic formula:

x=−b±b2−4ac2a.x = \frac{-b \pm \sqrt{b^{2} - 4ac}}{2a}.

The two solutions from the quadratic, together with the known root rr, are the three roots of the original cubic.

The rational root test is especially helpful when the coefficients are integers. It states that any rational root in lowest terms p/qp/q must have pp dividing the constant term dd and qq dividing the leading coefficient aa. This narrows down the candidates and often reveals a root quickly.

When No Rational Root Exists: The Cardano Formula

If the rational root test fails and no root is obvious, the general solution is provided by the Cardano formula (also called the cubic formula). Published by Gerolamo Cardano in 1545 and originally discovered by Scipione del Ferro, this formula always yields the correct roots, though it is more involved than the quadratic formula.

For the cubic ax3+bx2+cx+d=0a x^{3} + b x^{2} + c x + d = 0, first compute two intermediate quantities:

Q=3ac−b29a2,R=9abc−27a2d−2b354a3.Q = \frac{3ac - b^{2}}{9 a^{2}}, \qquad R = \frac{9abc - 27 a^{2} d - 2 b^{3}}{54 a^{3}}.

Then define

S=R+Q3+R23,T=R−Q3+R23.S = \sqrt[3]{R + \sqrt{Q^{3} + R^{2}}}, \qquad T = \sqrt[3]{R - \sqrt{Q^{3} + R^{2}}}.

The cube roots are chosen so that ST=−QS T = -Q (for real radicands the real cube root suffices; for complex radicands the principal cube root automatically satisfies this condition). The three roots of the cubic are:

x1=S+T−b3a,x_{1} = S + T - \frac{b}{3a}, x2=−S+T2+32(S−T) i−b3a,x_{2} = -\frac{S + T}{2} + \frac{\sqrt{3}}{2} (S - T)\,i - \frac{b}{3a}, x3=−S+T2−32(S−T) i−b3a.x_{3} = -\frac{S + T}{2} - \frac{\sqrt{3}}{2} (S - T)\,i - \frac{b}{3a}.

Even when SS and TT are complex numbers (which happens when the radicand Q3+R2Q^{3}+R^{2} is negative), the three roots may all be real — a situation known as the casus irreducibilis.

The Role of the Discriminant

The discriminant of a cubic polynomial, denoted Δ\Delta, is a compact expression that summarizes the root types:

Δ=18abcd−4b3d+b2c2−4ac3−27a2d2.\Delta = 18abcd - 4b^{3}d + b^{2}c^{2} - 4ac^{3} - 27a^{2}d^{2}.

The sign of Δ\Delta tells us about the roots without needing to compute them explicitly:

Discriminant (Δ\Delta)Nature of the roots
Δ>0\Delta > 0Three distinct real roots
Δ<0\Delta < 0One real root and two non‑real complex conjugates
Δ=0\Delta = 0Multiple roots (at least two roots coincide)

More detailed classifications apply when Δ=0\Delta = 0:

  • If b2=3acb^{2} = 3ac, the polynomial has a triple root: x1=x2=x3=−b3a.x_{1} = x_{2} = x_{3} = -\frac{b}{3a}.
  • Otherwise (i.e., b2≠3acb^{2} \neq 3ac), there is a double root and a simple root: x1=x2=9ad−bc2b2−6ac,x3=4abc−9a2d−b3ab2−3a2c.x_{1} = x_{2} = \frac{9ad - bc}{2b^{2} - 6ac}, \qquad x_{3} = \frac{4abc - 9a^{2}d - b^{3}}{a b^{2} - 3 a^{2} c}.

The quantity Q3+R2Q^{3}+R^{2} that appears inside the square root of the Cardano formula is closely related to the discriminant: Δ=−108 (Q3+R2)\Delta = -108\,(Q^{3}+R^{2}). Consequently, the sign of Q3+R2Q^{3}+R^{2} is opposite to that of the discriminant. When Δ>0\Delta > 0 (three real roots), Q3+R2<0Q^{3}+R^{2} < 0, which forces SS and TT to be complex — a classic example of the casus irreducibilis.

Worked Example

Consider the equation x3−4x2+4x=0x^{3} - 4x^{2} + 4x = 0. Factor out the common term xx:

x(x2−4x+4)=0.x (x^{2} - 4x + 4) = 0.

The quadratic factor is a perfect square: x2−4x+4=(x−2)2x^{2} - 4x + 4 = (x-2)^{2}. Therefore the factorization becomes

x(x−2)2=0.x (x-2)^{2} = 0.

The roots are x=0x = 0 (simple) and x=2x = 2 (double). Plugging the coefficients into the discriminant formula gives Δ=0\Delta = 0, confirming the presence of a repeated root.

For equations with no rational root, such as x3−2x2−3x+2=0x^{3} - 2x^{2} - 3x + 2 = 0, the Cardano formula must be used. After computing Q=−139Q = -\frac{13}{9} and R=827R = \frac{8}{27}, one obtains complex values for SS and TT, yet all three roots are real (approximately 2.813612.81361, −1.34292-1.34292, and 0.529320.52932). The cubic equation solver handles such cases instantly, making it a practical companion for both learning and professional work.

FAQ

1. How do I use the cubic equation calculator?

Enter the coefficients a, b, c, d of the cubic equation a x³ + b x² + c x + d = 0 into the input fields. The tool will immediately display the three roots, the discriminant, and a graph of the cubic polynomial.

2. What does the discriminant tell me about the roots?

The discriminant Δ indicates the root nature without solving the equation fully. If Δ > 0, there are three distinct real roots. If Δ < 0, there is one real root and two complex conjugates. If Δ = 0, there is at least one repeated root (a double or triple root).

3. Can I solve a cubic equation manually if I already know one root?

Yes. If you know a root r, divide the cubic polynomial by x − r using synthetic division. The result is a quadratic, which you can solve with the quadratic formula to obtain the other two roots.

4. What is the Cardano formula and when should I use it?

The Cardano formula is the general algebraic solution for cubic equations. It should be applied when the rational root test fails and no root is obvious from inspection. The formula involves intermediate quantities Q and R, and cube roots; the calculator automates this messy process.

5. Does the calculator show complex roots?

Yes. The cubic equation solver returns all three roots, including complex values. If the discriminant is negative, two of the roots will be complex conjugates, displayed in a + bi form.

How to Use

  1. Enter the coefficients a, b, c, and d of your cubic equation ax³ + bx² + cx + d = 0.
  2. Select the desired precision for the calculated roots.
  3. Click Solve Equation to instantly get the roots, discriminant, and nature of the roots.