Sub topic 5
Using the Quadratic Formula
Prerequisites and standard form
This chapter assumes that you can solve linear equations, expand and factor simple expressions, simplify square roots, and read points on a coordinate graph.
The quadratic formula solves any quadratic equation written in standard form:
ax² + bx + c = 0
Here, a, b, and c are numbers, and a must not equal zero. The variable x has up to two solutions, called roots.
The formula is:
x = (-b ± √(b² - 4ac)) / (2a)
The symbol ± means that you calculate both versions:
x = (-b - √(b² - 4ac)) / (2a)x = (-b + √(b² - 4ac)) / (2a)
A reliable solving process
Use these steps:
- Rewrite the equation in standard form.
- Identify
a,b, andc, including their signs. - Calculate the discriminant,
b² - 4ac. - Substitute the values into the formula.
- Simplify both roots.
- Check the result in the original equation.
The most common error is losing a negative sign while identifying b or while calculating -b.
Worked example
Solve:
2x² - 4x - 6 = 0
The coefficients are:
| Coefficient | Value |
|---|---|
| `a` | 2 |
| `b` | -4 |
| `c` | -6 |
First calculate the discriminant:
b² - 4ac = (-4)² - 4(2)(-6)
= 16 + 48
= 64
Now substitute into the formula:
x = (-(-4) ± √64) / (2(2))
x = (4 ± 8) / 4
Calculate both values:
x = (4 - 8) / 4 = -1x = (4 + 8) / 4 = 3
Therefore, the roots are x = -1 and x = 3.
You can check them in the original equation:
- For
x = -1:2(-1)² - 4(-1) - 6 = 2 + 4 - 6 = 0 - For
x = 3:2(3)² - 4(3) - 6 = 18 - 12 - 6 = 0
Both values work.
import math
def solve_quadratic(a, b, c):
if a == 0:
raise ValueError("a must be nonzero")
discriminant = b * b - 4 * a * c
if discriminant > 0:
root = math.sqrt(discriminant)
return [(-b - root) / (2 * a), (-b + root) / (2 * a)]
if discriminant == 0:
return [-b / (2 * a)]
return []
print(solve_quadratic(2, -4, -6)) # [-1.0, 3.0]Using the discriminant before solving
The discriminant is the expression b² - 4ac. Its value predicts the type and number of real roots.
| Discriminant | Real roots | Meaning |
|---|---|---|
| Positive | 2 | Two different real roots |
| Zero | 1 | One repeated real root |
| Negative | 0 | No real roots |
If the discriminant is negative, the square root is not real. For example, √(-16) = 4i, where i² = -1. The roots can then be written as complex numbers.
For x² + 2x + 5 = 0, the discriminant is:
2² - 4(1)(5) = -16
Thus:
x = (-2 ± √(-16)) / 2
x = (-2 ± 4i) / 2
x = -1 ± 2i
A quick check using the roots
For ax² + bx + c = 0 with roots r₁ and r₂:
r₁ + r₂ = -b/ar₁r₂ = c/a
For 2x² - 4x - 6 = 0, the roots are -1 and 3.
Their sum is -1 + 3 = 2, and -b/a = -(-4)/2 = 2.
Their product is (-1)(3) = -3, and c/a = -6/2 = -3.
Exercise
Solve 3x² + 2x - 1 = 0 using the quadratic formula.
Show answer
a = 3, b = 2, c = -1, so D = 2² - 4(3)(-1) = 16. Therefore x = (-2 ± 4)/6, giving x = 1/3 and x = -1.