The quadratic formula

One formula solves every quadratic equation. Here’s how to use it without sign errors, and why it works.

x=−b±b2−4ac2ax = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}

for ax2+bx+c=0, a≠0ax^2 + bx + c = 0,\ a \neq 0

How to solve quadratic equations with the formula

  1. Get standard form. Move everything to one side so the other side is 0: 2x2+3x−2=02x^2 + 3x - 2 = 0.
  2. Read a, b and c with their signs. Here a=2, b=3, c=−2a = 2,\ b = 3,\ c = -2.
  3. Work out the discriminant first. b2−4ac=9−4(2)(−2)=25b^2 - 4ac = 9 - 4(2)(-2) = 25. Doing it separately avoids most mistakes.
  4. Substitute, in brackets. x=−3±252(2)=−3±54x = \frac{-3 \pm \sqrt{25}}{2(2)} = \frac{-3 \pm 5}{4}.
  5. Split the ±. x=24=12x = \frac{2}{4} = \frac12 or x=−84=−2x = \frac{-8}{4} = -2.
Most common mistake: squaring a negative b without brackets. If b=−4b = -4, then b2=(−4)2=16b^2 = (-4)^2 = 16, not −16. And −b-b is +4+4.

What the discriminant tells you

b2−4acb^2-4acRootsGraph
Positive perfect squareTwo rational roots, and it factorsCrosses the x-axis twice
Positive, not a squareTwo irrational roots (with √)Crosses twice
ZeroOne repeated root, x=−b2ax = -\tfrac{b}{2a}Vertex touches the axis
NegativeNo real roots, two complexNever meets the axis

Check any quadratic on the discriminant calculator, or solve it fully with the quadratic equation solver.

Where the quadratic formula comes from

Step through the derivation. Every line is ordinary algebra you already know.

ax2+bx+cax^2 + bx + c
==
00

Start with any quadratic (a ≠ 0).

Why the formula works

The formula isn’t a trick to memorise. It’s completing the square done once, on letters instead of numbers. Divide by aa, add the square of half the middle coefficient to both sides, take the square root, and you arrive at the formula.

That also explains its shape. −b2a-\tfrac{b}{2a} is the x-coordinate of the parabola’s vertex, its line of symmetry. The ±b2−4ac2a\pm\tfrac{\sqrt{b^2-4ac}}{2a} part is how far each root sits to the left and right of that line. When the discriminant is 0 that distance shrinks to nothing and the two roots merge.

Completing the square is really a geometry trick wearing algebra clothes. The same urge to see the shape behind a formula runs through ahaboo’s narrated how-it-works explainers, from compound interest curves to the tilt that causes the seasons.

Symmetry: the roots sit equally either side of x = −b/2a

1
-2
-3

y=x2−2x−3y = x^2 - 2x - 3

Discriminant b² − 4ac
16
Real roots
-1, 3
Vertex (h, k)
(1, -4)

Discriminant > 0: the parabola crosses the x-axis twice, so there are two real roots. a > 0 opens it upward.

-8-6-4-202468-8-6-4-202468-13vertex (1, -4)
  • y = ax² + bx + c

Frequently asked questions

What is the quadratic formula?
For any equation ax² + bx + c = 0 with a ≠ 0, the solutions are x = (−b ± √(b² − 4ac)) / 2a. The ± gives the two roots.
How do you use the quadratic formula?
Put the equation in standard form, read off a, b and c (including their signs), substitute them in brackets, work out the discriminant b² − 4ac first, then simplify the square root and the fraction.
Who discovered the quadratic formula?
Methods for solving quadratics go back to Babylonian clay tablets around 2000 BCE. Brahmagupta (628 CE) and al-Khwarizmi (c. 820 CE) described general solution methods in words; the symbolic formula as we write it came with algebraic notation in the 16th and 17th centuries.
What if b² − 4ac is negative?
Then the square root of a negative number appears, so there are no real solutions. The two solutions are complex numbers, a ± bi.
Is the quadratic formula the same as completing the square?
Yes, in effect. The formula is what you get by completing the square on the general equation ax² + bx + c = 0, as the step-through derivation on this page shows.