← All text tools

Cubic equation solver

Find the real and complex roots of a cubic equation ax^3 + bx^2 + cx + d = 0 with Cardano's method, the discriminant and a graph.

  • Free
  • No sign-up
  • Works on any device

About Cubic equation solver

Every cubic equation ax^3 + bx^2 + cx + d = 0 has at least one real root. This solver uses Cardano's method: it shifts x by b/(3a) to get a depressed cubic t^3 + pt + q = 0, then checks the sign of the discriminant. A positive value gives three distinct real roots, found with a cosine formula; zero means a repeated root; a negative value gives one real root and two complex roots. For x^3 - 6x^2 + 11x - 6 the roots are 1, 2 and 3. A graph marks the real roots on the curve.

How to use Cubic equation solver

  1. Enter the four coefficients a, b, c and d, with a not equal to zero.
  2. Read the roots in the main result and the type of roots from the discriminant row.
  3. See the Cardano working table for p and q, and check the real roots on the graph.

Why use this tool?

Also known as

Frequently asked questions

Can a cubic equation have no real roots?

No. As x goes to plus or minus infinity the cubic goes to opposite infinities, so the curve must cross the x-axis at least once.

What does the discriminant tell me?

Above zero there are three different real roots, equal to zero there is a repeated root, and below zero there is one real root plus a complex pair.

How accurate are the roots?

They are computed in double precision and shown to 10 significant digits. Roots that are extremely close together can lose a few digits, which is normal for cubic solvers.

Is Cubic equation solver free?

Yes. Cubic equation solver on Toolipedia is free to use, with no sign-up and no watermark.

Is it safe to use?

Yes. Everything is worked out in your browser, and nothing you enter is sent to our server.

Does it work on my phone?

Yes. It works in any modern browser on Android and iPhone, as well as on tablets and computers. There's nothing to install.

Do I need an account?

No. Just open the page and use the tool. There's no sign-up and no email needed.

Can I put Cubic equation solver on my own website?

Yes. Use the Embed on your site button under the tool to copy a short piece of code and paste it into your page. It is free, needs no account, and the tool keeps working inside your page.

Related tools