Skip to content
ihateDesmos

The quadratic formula

8 min read · Updated 6 November 2026

The quadratic formula solves any equation of the form ax² + bx + c = 0: put in a, b and c, and out come the solutions. It works every time, even when an equation won’t factor.

The formula

x = (-b ± sqrt(b^2 - 4 a c))/(2 a)

The ± means there are usually two answers: one using plus and one using minus. Before you use it, the equation must equal zero, so you can read off a, the coefficient of x²; b, the coefficient of x; and c, the constant.

How to use the quadratic formula

Solve 2x² + 5x − 3 = 0:

  1. Identify the coefficients: a = 2, b = 5, c = −3.
  2. Put them in the formula: x = (−5 ± √(5² − 4·2·(−3))) ÷ (2·2).
  3. Work out the discriminant: 25 + 24 = 49.
  4. Take the square root: √49 = 7.
  5. Find both solutions: x = (−5 + 7) ÷ 4 = 1/2, and x = (−5 − 7) ÷ 4 = −3.

Check by putting x = 1/2 back in: 2(1/4) + 5(1/2) − 3 = 1/2 + 5/2 − 3 = 0. It works. You can try your own in the quadratic formula calculator.

−4−22−550
Open in calculator
The solutions are where the parabola
y=2x2+5x−3
crosses the x-axis, at x = −3 and x = 1/2.

The discriminant

The part under the square root, b² − 4ac, is called the discriminant. Its sign tells you how many real solutions there are before you do any more work.

DiscriminantSolutionsThe parabola…
PositiveTwo real solutionsCrosses the x-axis twice
ZeroOne repeated solutionTouches the x-axis once
NegativeNo real solutions (two complex)Doesn’t reach the x-axis

If the discriminant is a perfect square, the solutions are rational, which means the quadratic could have been factored.

−22450
Open in calculator
Discriminant positive (blue), zero (red) and negative (green): two, one and no x-intercepts.

When the discriminant is negative

For x² + 2x + 5 = 0, the discriminant is 4 − 20 = −16. There is no real square root, so the parabola never reaches the x-axis. With complex numbers, √(−16) = 4i, which gives x = (−2 ± 4i) ÷ 2 = −1 ± 2i.

Where the formula comes from

The formula is what you get by completing the square on ax² + bx + c = 0 with letters instead of numbers:

  1. Divide by a: x² + (b/a)x + c/a = 0.
  2. Move the constant: x² + (b/a)x = −c/a.
  3. Add (b/2a)² to both sides: (x + b/2a)² = (b² − 4ac)/4a².
  4. Take square roots: x + b/2a = ±√(b² − 4ac)/2a.
  5. Subtract b/2a: x = (−b ± √(b² − 4ac))/2a.

A shortcut to the vertex

The two solutions sit either side of −b/2a, a distance of √(b² − 4ac)/2a each way. That means x = −b/2a is the axis of symmetry, and the x-coordinate of the vertex. The vertex calculator uses this.

When to use it

MethodBest when
FactoringThe numbers are small and it factors easily
Quadratic formulaAnything else: it always works
Completing the squareYou want vertex form as well
GraphingYou want to see the solutions, or estimate them

Common mistakes

  • Forgetting to rearrange to = 0. For x² + 3x = 10, c is −10, not 0.
  • Sign errors with −b. If b is −4, then −b is +4.
  • Squaring a negative b incorrectly. (−4)² is 16, not −16. Use brackets on your calculator.
  • Dividing only part of the top. 2a divides the whole of −b ± √(…), not just the root.

Frequently asked questions

What is the quadratic formula?
x = (−b ± √(b² − 4ac)) / 2a. It gives the solutions of ax² + bx + c = 0.
How do you remember the quadratic formula?
A common way is to sing it to the tune of “Pop Goes the Weasel”: “x equals negative b, plus or minus the square root, of b squared minus 4ac, all over 2a.”
What does the discriminant tell you?
How many real solutions there are: positive gives two, zero gives one, and negative gives none.
Does the quadratic formula always work?
Yes, for any quadratic equation. If a = 0, it isn’t quadratic, and the formula doesn’t apply.
What if the answer has a square root in it?
That is normal. Leave it exact, simplifying the root if you can, or give a decimal if your problem asks for one.

Keep going

Try it in the calculator

Every figure on this page opens in ihateDesmos, where you can drag sliders and watch the graph respond.

Open the calculator