Quadratic Equation Solver

Solve ax² + bx + c = 0 with steps, exact roots, simplified square roots and complex roots.

Runs in your browser. Files never leave your device.

ax² + bx + c = 0

Whole numbers, decimals (0.5) or fractions (1/2). Use a minus sign for negatives.

x² − 3x − 10 = 0x = -2 or x = 5As decimals: -2 and 5

Inputs as interpreted

Vertex form
(x − 3/2)² − 49/4
Vertex
(3/2, -49/4)

Working

  1. Discriminant D = b² − 4ac = (-3)² − 4 × 1 × -10 = 49
  2. D > 0: two different real roots
  3. x = (−b ± √D) ÷ 2a = (3 ± √49) ÷ 2

Exact answers use fractions and square roots in their simplest form; decimals are rounded to 10 significant digits.

About the Quadratic Equation Solver

Solve any quadratic equation ax² + bx + c = 0 and see every step: the discriminant, what it tells you about the roots, and the quadratic formula worked through. Answers come exactly, as fractions and simplified square roots, as well as decimals.

It handles all the cases: two different roots, one repeated root, complex roots when there are no real ones, and a = 0, when the equation is really linear.

How it works

The discriminant D = b² − 4ac decides what kind of roots the equation has. If D is positive there are two different real roots, if it is zero there is one repeated root, and if it is negative the roots are a pair of complex numbers. The roots themselves come from the quadratic formula.

Coefficients are kept as exact fractions, so 0.1 is exactly one tenth. When the discriminant is a perfect square the roots are fractions; otherwise the square root is simplified (√80 = 4√5) and the answer is shown in that exact form and as a decimal.

For the decimals, the calculator uses a rearranged formula that avoids subtracting two nearly equal numbers. The textbook formula loses accuracy when b² is much larger than 4ac; for x² − 100000000x + 1 it gets the small root wrong by more than 25%, while the rearranged form is accurate to the last digit.

D = b² − 4ac
x = (−b ± √D) ÷ 2a
vertex form: a(x − h)² + k, with h = −b ÷ 2a and k = c − b² ÷ 4a

Assumptions and limits

  • Coefficients can be whole numbers, decimals or fractions such as 3/4.
  • Exact roots use the simplest square root form; decimals are rounded to 10 significant digits.
  • If a = 0 the equation is linear and is solved as bx + c = 0.

Worked examples

x² − 3x − 10 = 0

D = 9 + 40 = 49, a perfect square, so the roots are rational: x = (3 ± 7) ÷ 2, giving x = 5 or x = −2. Check: (x − 5)(x + 2) = x² − 3x − 10.

2x² + 4x − 3 = 0

D = 16 + 24 = 40 = 4 × 10, so √D = 2√10 and x = (−4 ± 2√10) ÷ 4 = (−2 ± √10) ÷ 2. As decimals that is about 0.5811 and −2.5811.

x² + 2x + 5 = 0

D = 4 − 20 = −16 is negative, so there are no real solutions. The complex roots are x = (−2 ± 4i) ÷ 2 = −1 ± 2i.

What the discriminant tells you

For whole-number or fraction coefficients.

DiscriminantRootsGraph of y = ax² + bx + c
D > 0, a perfect squareTwo different rational rootsCrosses the x-axis twice
D > 0, not a perfect squareTwo different irrational rootsCrosses the x-axis twice
D = 0One repeated rootTouches the x-axis once
D < 0Two complex rootsDoesn't reach the x-axis

How to use the Quadratic Equation Solver

  1. Enter a, b and c. From your equation written as ax² + bx + c = 0.
  2. Read the roots. Exact form and decimals, or complex roots.
  3. Follow the working. The discriminant and formula steps are shown below.

Frequently asked questions

How do I use the quadratic formula?

Write the equation as ax² + bx + c = 0, then x = (−b ± √(b² − 4ac)) ÷ 2a. Work out b² − 4ac first, take its square root, and use + and − to get the two roots.

What if the discriminant is negative?

There are no real numbers that solve the equation, so the graph never meets the x-axis. The solutions are complex numbers of the form p ± qi, where i is the square root of −1; the calculator shows them in that form.

Why does the answer have a square root in it?

When b² − 4ac isn't a perfect square, the roots are irrational: their decimals go on forever without repeating. The exact form with a square root, such as (3 ± √5) ÷ 2, is the precise answer; the decimal is rounded.

My equation isn't in the form ax² + bx + c = 0. What do I do?

Move everything to one side first. For example, x² = 3x + 10 becomes x² − 3x − 10 = 0, so a = 1, b = −3 and c = −10. Expand any brackets before reading off a, b and c.

What is the vertex form for?

Writing a(x − h)² + k shows the turning point of the parabola, (h, k), directly. It's useful for sketching the graph and for finding the maximum or minimum value of the expression.

Sources

  • Press et al., Numerical Recipes (3rd ed.), §5.6: quadratic and cubic equations (stable root formula)

This tool runs entirely in your browser. What you enter or upload stays on your device and is never sent to our servers.