School and science

Quadratic equation solver

Enter a, b and c. The page solves ax² + bx + c = 0 and writes the discriminant and each root.

a x² + b x + c = 0

Runs in your browser. Nothing you type or open is uploaded. Free to use, no account. More school and science tools

How to use it

  1. Enter a, b and c for ax² + bx + c = 0.
  2. Read the discriminant and whether the roots are real or complex.
  3. Follow the arithmetic down to the simplified roots.

What the discriminant decides

The discriminant is D = b² − 4ac. A positive D gives two different real roots, (−b + √D) / (2a) and (−b − √D) / (2a). Zero gives one repeated real root, −b / (2a). A negative D gives a complex pair with real part −b / (2a) and imaginary part √|D| / (2a). When a, b and c are whole numbers and D is a perfect square, the working stays in whole numbers and fractions.

If a is 0 and b is not, the equation is linear and the page solves x = −c / b. Square roots of whole numbers are simplified, so √8 appears as 2√2. The sample equation x² − 5x + 6 = 0 has discriminant 1 and roots 2 and 3.

Private by design

Privacy

Everything runs in this page and stays on your device.

This page also shows Google ads, which can use cookies. Privacy and cookies explains how.

Questions

Does it show complex roots?

Yes. When the discriminant is negative the roots are written as a real part plus or minus an imaginary part, such as −1 + 2i.

What is the worked example?

a = 1, b = −5 and c = 6 is x² − 5x + 6 = 0. D = 25 − 24 = 1, and the roots are 3 and 2.

Can a be zero?

Yes. The equation is then linear, and the working solves it in one division. If a and b are both zero, the page says whether every number works or none does.

Will fractions stay exact?

Whole-number a, b and c keep an exact fraction when the square root is a whole number. Other inputs are shown as decimals.

From the same developer