Skip to content
Tutorials Center
My learning

Topics

Lesson 30 of 37 · Quadratic Equations

The Quadratic Formula and the Discriminant

Derive and use the quadratic formula, use the discriminant to count real solutions, and choose the best method to solve any quadratic equation.

Factoring is quick when it works, but many quadratics will not factor neatly. Completing the square always works, but it is long. The quadratic formula is completing the square done once and for all, for the general equation ax² + bx + c = 0.

The formula

For ax² + bx + c = 0 with a ≠ 0:

Text
x = (−b ± √(b² − 4ac)) / (2a)

Where does it come from? Start with ax² + bx + c = 0 and complete the square.

  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/a)x + b²/(4a²) = b²/(4a²) − c/a.
  4. The left side is (x + b/(2a))². The right side is (b² − 4ac)/(4a²).
  5. Take square roots: x + b/(2a) = ±√(b² − 4ac) / (2a).
  6. Subtract b/(2a). That gives the formula.

Example 1. Solve 2x² − 5x − 3 = 0. Here a = 2, b = −5, c = −3.

  • b² − 4ac = 25 − 4(2)(−3) = 25 + 24 = 49.
  • x = (5 ± 7) / 4, so x = 12/4 = 3 or x = −2/4 = −1/2.

Example 2. Solve x² − 4x + 1 = 0. Here a = 1, b = −4, c = 1.

  • b² − 4ac = 16 − 4 = 12, and √12 = 2√3.
  • x = (4 ± 2√3) / 2 = 2 ± √3, about 3.73 or 0.27.

Watch the signs. When b is negative, −b is positive, and b² is always positive: write b = −5 as (−5)², not −5². Also divide the whole numerator by 2a, not just one term.

Python A quadratic formula calculator

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The discriminant

The expression under the square root, D = b² − 4ac, is called the discriminant. It tells you how many real solutions there are before you solve.

Discriminant Real solutions Graph of y = ax² + bx + c
D > 0 two different crosses the x-axis twice
D = 0 one (a double root) touches the x-axis once
D < 0 none never reaches the x-axis

If D is a perfect square (0, 1, 4, 9, ...) and a, b, c are integers, the roots are rational and the quadratic factors over the integers. In Example 1, D = 49 = 7², and indeed 2x² − 5x − 3 = (2x + 1)(x − 3).

Example 3. For which values of k does x² + 6x + k = 0 have exactly one solution?

We need D = 0: 36 − 4k = 0, so k = 9. Then x² + 6x + 9 = (x + 3)².

Which method should you use?

Situation Best method
Missing the x term: ax² = k square roots
Easy to factor, or a GCF is visible factoring
a = 1 and b is even completing the square works well
Anything else quadratic formula

The formula never fails (when real solutions exist), which makes it the safe default.

Python Does the discriminant predict the graph?

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. What is the discriminant of x² + 4x + 7?

    b² − 4ac = 16 − 28 = −12, which is negative, so there are no real solutions.
  2. 2. How many real solutions does 3x² − 6x + 3 = 0 have?

    D = 36 − 36 = 0, so there is exactly one (repeated) solution, x = 1.
  3. 3. Solve x² − 7x + 10 = 0 with the formula.

    D = 49 − 40 = 9, so x = (7 ± 3)/2 gives 5 and 2.
  4. 4. For ax² + bx + c = 0, what are a, b, c in 4 − x² = 3x?

    Move everything to one side: −x² − 3x + 4 = 0, so a = −1, b = −3, c = 4.

Summary

  • The quadratic formula x = (−b ± √(b² − 4ac)) / (2a) solves every quadratic in standard form.
  • Put the equation in standard form first so that a, b, c are right, signs included.
  • D = b² − 4ac gives two, one or zero real solutions when it is positive, zero or negative.
  • Pick the quickest method, but the formula always works.

Next: Graphing Parabolas