Sub topic 7
The Quadratic Formula
When to use it
Assume you can expand brackets, collect like terms, factor simple quadratics, and work with square roots. A quadratic equation is an equation that can be written as:
ax² + bx + c = 0
Here, a, b, and c are constants, and a is not zero. The quadratic formula solves any quadratic equation in this standard form:
x = (-b ± √(b² - 4ac)) / 2a
The symbol ± means that you calculate both signs:
- x = (-b + √(b² - 4ac)) / 2a
- x = (-b - √(b² - 4ac)) / 2a
A reliable procedure
- Move every term to one side so the equation equals zero.
- Identify a, b, and c, including their signs.
- Calculate b² - 4ac inside the square root.
- Calculate the two values using the plus and minus signs.
- Substitute the answers into the original equation if signs or fractions may have caused an error.
For example, solve:
2x² + 3x - 2 = 0
The coefficients are a = 2, b = 3, and c = -2.
x = (-3 ± √(3² - 4(2)(-2))) / (2(2))
x = (-3 ± √25) / 4
Therefore:
- x = (-3 + 5) / 4 = 1/2
- x = (-3 - 5) / 4 = -2
The solutions are x = 1/2 and x = -2.
Common errors
The most frequent mistake is treating b as positive when it is negative. In x² - 5x + 6 = 0, b is -5, so the formula begins with -(-5), which equals 5.
Another mistake is forgetting that 4ac includes the sign of c. If c is negative, then 4ac is negative, so subtracting 4ac increases the discriminant.
The denominator is 2a, not only 2. Also, the entire numerator belongs over the denominator:
x = (-b ± √(b² - 4ac)) / (2a)
If b² - 4ac is zero, both formula results are the same. If it is negative, there are no real-number solutions. These cases are examined more fully through the discriminant.
import math
def quadratic_roots(a, b, c):
if a == 0:
raise ValueError("a must not be zero")
discriminant = b * b - 4 * a * c
if discriminant < 0:
return []
root = math.sqrt(discriminant)
return sorted({(-b - root) / (2 * a), (-b + root) / (2 * a)})
print(quadratic_roots(1, -5, 6))Exercise
Solve 3x² - 7x - 6 = 0 using the quadratic formula.
Show answer
Here a = 3, b = -7, and c = -6. The discriminant is (-7)² - 4(3)(-6) = 121. Thus x = (7 ± 11)/6, giving x = 3 or x = -2/3.