How to solve quadratic equations with the quadratic formula, shown through four fully worked examples that cover every type of answer you can get.

What is the quadratic formula?

The quadratic formula gives the solutions of ax² + bx + c = 0 as x = (−b ± √(b² − 4ac)) / 2a, as long as a isn’t 0. The ± means you get two answers: one using plus and one using minus.

It comes from completing the square on the general equation, so it always works, even when factoring doesn’t. The quadratic formula examples below cover all four kinds of answer you can run into, so you’ll know what each one looks like when it shows up on a test.

ax² + bx + c = 0
x = (−b ± √(b² − 4ac)) / 2a

How do you solve quadratic equations with the formula?

To solve a quadratic equation with the formula, rewrite it as ax² + bx + c = 0, identify a, b, and c, find the discriminant, then substitute into the formula and simplify.

  1. Move every term to one side so the other side is 0.
  2. Write down a, b, and c, keeping their signs.
  3. Work out the discriminant D = b² − 4ac.
  4. Substitute into x = (−b ± √D) / 2a.
  5. Simplify the square root, then split into the + and − answers.
  6. Check one answer in the original equation.

Example 1: what if the roots are rational?

Solve 2x² + 7x − 4 = 0. Here a = 2, b = 7, and c = −4. The discriminant is 7² − 4(2)(−4) = 49 + 32 = 81. That’s a perfect square, so both roots will be rational numbers.

Substitute: x = (−7 ± √81) / 4 = (−7 ± 9) / 4. With plus, x = 2/4 = 1/2. With minus, x = −16/4 = −4.

A perfect-square discriminant means the quadratic also factors: 2x² + 7x − 4 = (2x − 1)(x + 4). Check x = 1/2: 2(1/4) + 7/2 − 4 = 1/2 + 7/2 − 4 = 0.

a = 2, b = 7, c = −4
D = 49 + 32 = 81
x = (−7 ± 9) / 4
x = 1/2 or x = −4

Example 2: what if the roots are irrational?

Solve x² − 4x − 1 = 0. Here a = 1, b = −4, and c = −1. The discriminant is (−4)² − 4(1)(−1) = 16 + 4 = 20. Twenty isn’t a perfect square, so the roots involve a square root.

Substitute: x = (4 ± √20) / 2. Simplify √20 as √(4 × 5) = 2√5. That gives x = (4 ± 2√5) / 2. Divide both terms on top by 2 and you get x = 2 ± √5.

As decimals that’s about 4.236 and −0.236, but the exact answer 2 + √5 and 2 − √5 is what most teachers want. Notice that −b is +4 here because b is −4. Getting that sign wrong is the single most common slip with the formula.

a = 1, b = −4, c = −1
D = 16 + 4 = 20
x = (4 ± 2√5) / 2
x = 2 + √5 or x = 2 − √5

Example 3: what if there is only one root?

Solve 4x² − 12x + 9 = 0. Here a = 4, b = −12, and c = 9. The discriminant is 144 − 4(4)(9) = 144 − 144 = 0.

With D = 0, the ± adds and subtracts nothing, so both answers are the same: x = 12 / 8 = 3/2. This is called a repeated or double root.

The left side is a perfect square trinomial, (2x − 3)². On a graph, the parabola just touches the x-axis at x = 3/2 without crossing it.

a = 4, b = −12, c = 9
D = 144 − 144 = 0
x = 12 / 8
x = 3/2

Example 4: what if the discriminant is negative?

Solve x² + 2x + 5 = 0. Here a = 1, b = 2, and c = 5. The discriminant is 4 − 20 = −16. A negative discriminant means there are no real solutions.

If your class uses complex numbers, keep going. √(−16) = 4i, so x = (−2 ± 4i) / 2 = −1 ± 2i. The two roots are −1 + 2i and −1 − 2i, which are complex conjugates.

If your class hasn’t covered i yet, the expected answer is “no real solution.” The quadratic equation solver gives that by default and shows the complex roots when you switch complex numbers on.

a = 1, b = 2, c = 5
D = 4 − 20 = −16
x = (−2 ± 4i) / 2
x = −1 + 2i or x = −1 − 2i

How does the discriminant predict the type of roots?

The sign of b² − 4ac tells you how many real roots there are, and whether it’s a perfect square tells you if they’re rational. The four examples above line up with the four rows of this table.

D > 0 and a perfect square: two rational roots (Example 1, D = 81)
D > 0 and not a perfect square: two irrational roots (Example 2, D = 20)
D = 0: one repeated real root (Example 3)
D < 0: no real roots, two complex roots (Example 4, D = −16)

What if the equation isn’t in standard form?

Move every term to one side first, so the equation reads ax² + bx + c = 0. The formula only works when the other side is zero.

For x² = 3x + 10, subtract 3x and 10 from both sides to get x² − 3x − 10 = 0. Now a = 1, b = −3, and c = −10. The discriminant is 9 + 40 = 49, so x = (3 ± 7) / 2, which gives x = 5 or x = −2.

Reading a, b, and c from x² = 3x + 10 as it stands would give b = 3 and c = 10 with the wrong signs, and the formula would produce wrong roots.

What mistakes do people make with the quadratic formula?

The usual errors are a sign slip on −b, squaring a negative b incorrectly, and dividing only part of the top by 2a.

If b = −4, then −b is 4 and b² is 16, not −16. Put negative numbers in brackets when you substitute, as in (−4)², so your calculator squares the whole number. The fraction bar covers the entire top, so (4 ± 2√5) / 2 becomes 2 ± √5, not 4 ± √5.

One more: forgetting that 2a sits under both terms. In Example 1 the bottom is 2 × 2 = 4, and dividing by 2 instead would double both answers.

Which method should you use to solve a quadratic equation?

Try factoring first if the numbers are small, use the quadratic formula when factoring stalls, and complete the square when you also want the vertex. All three give the same roots.

Take x² + 5x + 6 = 0. You can spot (x + 2)(x + 3) in a few seconds, so factoring gives x = −2 or x = −3 faster than the formula would. Compare x² − 4x − 1 = 0 from Example 2: no pair of integers multiplies to −1 and adds to −4, so factoring goes nowhere and the formula is the right tool.

Some quadratics have a shortcut of their own. If c is 0, as in 2x² − 3x = 0, factor out x to get x(2x − 3) = 0, so x = 0 or x = 3/2. If b is 0, as in x² − 9 = 0, take square roots: x = ±3.

Completing the square is the method behind the formula, and it rewrites the quadratic in vertex form. For x² + 6x − 7, completing the square gives (x + 3)² − 16. The guide on how to complete the square walks through that process.

Small numbers, easy pair: factor
c = 0: factor out x
b = 0: take square roots
Anything else: quadratic formula

Frequently asked questions

What is the quadratic formula?

It is x = (−b ± √(b² − 4ac)) / 2a, which solves any quadratic equation written as ax² + bx + c = 0 with a not equal to 0. The ± gives up to two solutions.

Can the quadratic formula solve every quadratic equation?

Yes. Every quadratic in standard form can be solved with it. When b² − 4ac is negative the solutions are complex numbers rather than real ones.

What does it mean if b² − 4ac is 0?

The quadratic has one repeated real root, x = −b / 2a. Its graph touches the x-axis at a single point.

When should I use the quadratic formula instead of factoring?

Use the formula when the quadratic doesn’t factor easily, when the roots look irrational, or when you aren’t sure. If the discriminant is a perfect square, factoring will also work.

How do you check a quadratic formula answer?

Substitute each root into the original equation and confirm you get 0. For messy irrational roots, check that the two roots add to −b/a and multiply to c/a instead. In Example 2, (2 + √5) + (2 − √5) = 4, which matches −b/a.

What if b or c is missing?

Use 0 for the missing value. For x² − 9 = 0, a = 1, b = 0, and c = −9, so x = ±√36 / 2 = ±3.

References and further reading