Skip to main content
WizTools123
Free Online Tools

Tool Categories


Math Tools New Tool

Free Online Cubic Equation Solver With All Three Roots

Solve a cubic equation of the form ax cubed plus bx squared plus cx plus d and get all three roots, real and complex. Repeated roots are reported as repeated instead of as two slightly different numbers, every root is substituted back into your own equation as a check, and the Cardano working is shown step by step.

Free Forever Nothing Uploaded All Three Roots Every Root Checked
Free Online Cubic Equation Solver With All Three Roots
Share this tool
Advertisement Slot (Top Banner) Google AdSense Unit • Responsive Banner
📐 Cubic Equation Solver All three roots · repeated roots named · every root checked

The sum runs in your browser. Nothing you type is sent anywhere.

📐 The equation

Four coefficients, read as ax³ + bx² + cx + d = 0. Leave a as zero and it is solved as a quadratic instead of being refused.

—
Try one of these
The third and fourth are the cases where most solvers print two or three numbers that nearly match instead of one repeated root.
The roots
—
What kind of roots—
Factorised—
Discriminant—
Sum of the roots—
Product of the roots—
Largest error on substitution—

A cubic is solved by removing the squared term first, which turns it into t³ + pt + q = 0. The sign of the discriminant then decides which formula applies.

Step Value What it means

Every root put back into the equation you typed. A root makes the left side zero, so this column is the real test of the answer.

Root Value The equation at that value
Buy Us A Coffee

Enjoying WizTools123? Help keep our server infrastructure 100% free and open for everyone.

Buy Us A Coffee
Sponsored Content (Below Tool) Google AdSense Placement

How to Use Cubic Equation Solver

Step by step, start to finish.

1

They are read as a times x cubed, b times x squared, c times x, and d on its own. The equation is written out underneath as you type so you can see the signs landed where you meant them.

2

A cubic always has three roots. They may be three real numbers, one real and two complex, or a repeated root counted more than once, and the row above the working names which case you have.

3

Each root is put back into the equation you typed and the result shown. A genuine root makes it zero, so this column is the proof rather than the working above it.

Key Features

What this tool does, and what it does not do.

All three roots

Real and complex, in order, with the repeated ones labelled as repeated rather than listed twice.

Every root checked

Each root substituted into the equation you typed, with the largest discrepancy reported.

The Cardano working

The depressed cubic, p and q, the discriminant and which branch it chose, step by step.

Factorised form

The equation written as a product of factors, with the quadratic piece kept whole when the roots are complex.

Sum and product

Computed from the coefficients rather than the roots, so they are an independent check on the answer.

Nothing is uploaded

It runs in this tab and keeps working offline.

About Cubic Equation Solver

A cubic equation is one in which the highest power of the unknown is three. Unlike a quadratic it always has at least one real root, because the curve runs from minus infinity to plus infinity and has to cross zero somewhere, and counted properly it always has exactly three. Those three may be three separate real numbers, or one real number and a pair of complex ones, or the same number appearing twice or three times over.

There is a formula, published by Cardano in 1545, and it works. The method is to remove the squared term by a substitution, which turns the equation into the simpler shape t cubed plus pt plus q, and then to solve that. What the formula is not is numerically well behaved in every case, and the case where it misbehaves is a common one: the repeated root.

At a repeated root the formula subtracts two quantities that are nearly equal, and the digits that survive are the ones that carry the error rather than the answer. The published roots of two x cubed minus eleven x squared plus twelve x plus nine are three, three and minus one half, and a straightforward implementation returns 2.99999994 and 3.00000006 for the first two. Numpy does exactly this. Printing those two numbers is worse than useless, because it reports a single root as two distinct ones and invites you to believe the curve crosses the axis twice near three when it touches it once.

The fix is to look at the discriminant before choosing a formula. When it is zero within the tolerance that the size of the coefficients implies, the repeated case has its own closed form, derived by writing the cubic as t minus alpha squared times t minus beta and reading off the coefficients, and that form gives exactly three. The other correctness decision is to switch off the usual Newton cleanup there, because the derivative vanishes at a repeated root and the cleanup divides by it. Everywhere else one Newton step is applied, bounded so that it can tidy a root but never move it.

Whichever branch runs, the answer is then checked the same way: each root is substituted into the coefficients you typed and the value of the left hand side is printed. A root makes it zero. That check uses your equation rather than the derived one, so it catches an error anywhere in the chain, and it is shown rather than merely performed.

Frequently Asked Questions

Common questions about this tool.

Yes, counted with multiplicity. At least one is real, because the curve goes to minus infinity in one direction and plus infinity in the other and must cross zero. The other two are either both real or a complex conjugate pair.

That the curve touches the axis rather than crossing it, at a point where the value and the slope are both zero. It is one root counted twice, and reporting it as two slightly different numbers is a mistake rather than extra precision.

Its sign names the case. Positive means three distinct real roots, negative means one real root and two complex ones, and zero means a repeated root. It is shown so you can see which formula ran.

Yes. With a zero the equation is a quadratic and it is solved as one, and with b zero too it is linear. The answer is labelled with what it actually was rather than refused for not being cubic.

As a real part plus or minus an imaginary part, for example minus a half plus 1.3 i. They always arrive as a conjugate pair, so one line covers both.

Because they can be read straight off the coefficients: the roots add to minus b over a and multiply to minus d over a. Comparing them with the roots on screen is a free second check on the answer.

No. The roots are found in this tab by the same method you would use on paper. Your coefficients never leave the page, and the solver keeps working offline.
Advertisement Slot (Bottom Banner) Google AdSense Unit • Responsive Banner