Quadratic & cubic equation solver

Enter the coefficients to solve any quadratic or cubic equation, with step-by-step working, exact real and complex roots and a graph of the function.

Step-by-stepGraph of rootsFree, no sign-up

Coefficients

Solution

x² − 3x + 2 = 0
Graph (red dots = real roots)

How to solve quadratic and cubic equations

1. The quadratic formula

For ax² + bx + c = 0, first compute the discriminant Δ = b² − 4ac:

  • Δ > 0: two distinct real roots x = (−b ± √Δ) / 2a.
  • Δ = 0: one repeated root x = −b / 2a.
  • Δ < 0: no real roots; two complex roots x = −b/2a ± i·√(−Δ)/2a.

2. Solving cubics

Substituting x = t − b/(3a) turns any cubic into the depressed form t³ + pt + q = 0. The sign of Δ = (q/2)² + (p/3)³ decides the method: Cardano's formula when Δ > 0 (one real root), or the trigonometric method when Δ < 0 (three real roots).

3. Reading the graph

Real roots are the points where the curve crosses the x-axis (y = 0). The graph zooms automatically so all real roots are visible.

Frequently asked questions

Does it show the working, not just the answer?

Yes. For quadratics it shows the discriminant and each root. For cubics it reduces the equation to the depressed form t³ + pt + q = 0, computes the discriminant and solves exactly with Cardano's formula or the trigonometric method.

Does it find complex roots?

Yes. When there are no real roots (or only one, for a cubic), the complex conjugate roots are shown in the form a ± bi.

Why does every cubic have at least one real root?

A cubic polynomial goes to +∞ on one side and −∞ on the other, so its graph must cross the x-axis at least once.

Can I use decimals or negative coefficients?

Yes. Any real numbers are accepted, as long as the leading coefficient a is not zero.