Skip to main content
WizTools123
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 Solve a Cubic Equation

Three steps, and the third is the one that proves it.

1
Enter the four coefficients 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
Read the roots and what kind they are 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
Check the substitution table 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.

What to Know About Cubic Equations

Three roots always, and the one place other solvers go wrong.

A repeated root is shown once, as repeated. This is the main reason this page exists. On 2x³ - 11x² + 12x + 9 the roots are 3, 3 and minus a half. Cardano’s formula produces two nearly equal numbers there, and a solver that prints them gives you 2.99999994 and 3.00000006, which is not an answer, it is noise. Here the discriminant is examined first and the repeated case uses its own formula, which gives exactly 3.
Newton polishing is switched off at a repeated root. The usual way to clean up a root is one Newton step, x minus f over f prime. At a repeated root the derivative is zero as well, so that step divides one nearly zero number by another and the answer flies off. Without that guard the double root above came out as 3.2. The formula is already exact there, so no polishing is applied.
Complex roots come in a pair, and are given exactly. When the discriminant is negative there is one real root and two complex ones, and the two complex roots are always conjugates: the same real part, with equal and opposite imaginary parts. They are given as a plus or minus b i rather than being hidden, because a cubic with no real factor still factorises into a linear and a quadratic piece.
The sum and product of the roots check themselves. For any cubic the roots add up to minus b over a and multiply to minus d over a, whatever the roots turn out to be. Those two numbers are computed from your coefficients rather than from the roots, so comparing them with the roots on screen is a second, independent check that costs nothing.
A zero leading coefficient is solved, not refused. If a is zero the equation is a quadratic, and if b is zero as well it is linear. People arrive at this page with an equation they think is cubic and find that the cubed term cancelled, so those cases are solved and labelled rather than returning an error about a not being allowed to be zero.
It runs in your browser with nothing uploaded. The arithmetic is in the page, so it works offline once loaded and nothing you type is sent anywhere.

Key Features & Capabilities

What it does, and what it deliberately does not.

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 Equations

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

Complex roots, repeated roots, and what the discriminant tells you.

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 arithmetic runs in your browser, so nothing you type leaves the page and it works offline.

Related Tools

Advertisement Slot (Bottom Banner) Google AdSense Unit • Responsive Banner