The quadratic formula, and what the discriminant tells you
Any equation of the form ax2 + bx + c = 0 is a quadratic, and one formula solves all of them. But there is a cheaper calculation to do first, which tells you how many answers exist before you go looking for them.
The formula
x = (−b ± √(b2 − 4ac)) ÷ 2a
The ± is why a quadratic usually has two solutions: you work it once with a plus and once with a minus. The expression under the square root, b2 − 4ac, is called the discriminant, and on its own it decides the shape of the answer.
Check the discriminant first
- Positive — two different real solutions. The curve crosses the horizontal axis twice.
- Zero — one repeated solution. The curve just touches the axis.
- Negative — no real solutions. The curve never reaches the axis, and you would be taking the square root of a negative number.
One subtraction saves you from hunting for roots that are not there.
A real example: x2 − 3x + 2 = 0
Here a = 1, b = −3, c = 2.
- Discriminant:
(−3)2 − 4(1)(2) = 9 − 8 = 1. Positive, so two real solutions. - Square root of 1 is 1.
- With the plus:
(3 + 1) ÷ 2 = 2. - With the minus:
(3 − 1) ÷ 2 = 1.
So x = 2 and x = 1. Check the first by substituting back: 22 − 3(2) + 2 = 4 − 6 + 2 = 0. Correct. Substituting back takes ten seconds and catches nearly every sign error, which is the most common mistake in the whole procedure — note that b was −3, so −b was +3.
A real example with a negative c: 2x2 + 4x − 6 = 0
a = 2, b = 4, c = −6.
- Discriminant:
42 − 4(2)(−6) = 16 + 48 = 64. Subtracting a negative added to it. - Square root of 64 is 8.
- With the plus:
(−4 + 8) ÷ 4 = 1. - With the minus:
(−4 − 8) ÷ 4 = −3.
Checking x = −3: 2(9) + 4(−3) − 6 = 18 − 12 − 6 = 0. Correct.
The touching case: x2 − 4x + 4 = 0
Discriminant: 16 − 16 = 0. The square root of zero is zero, so the plus and the minus give the same thing: 4 ÷ 2 = 2. One solution, x = 2, repeated. This is the quadratic that factors to (x − 2)2, and the discriminant told you so before you factored anything.
The no-real-answer case: x2 + 2x + 5 = 0
Discriminant: 4 − 20 = −16. Negative, so there is no real number that satisfies this equation. Solutions do exist in the complex numbers, but if your x is a length, a price or a time, "no real solution" is the meaningful answer — and usually a sign that the situation you modelled cannot happen.
When a is zero
If a = 0 there is no x2 term and it is not a quadratic at all — it is linear, bx + c = 0, solved by x = −c ÷ b. Worth noticing because the formula itself breaks here: its denominator, 2a, would be zero. For 2x − 6 = 0 the answer is simply 6 ÷ 2 = 3.
Run your own numbers
The free Quadratic Solver takes a, b and c, reports both roots when they are real, and tells you the discriminant when they are not — entirely on your device.