Sub topic 9
Completing the Square When \(a=1\)
Assume you can expand binomials, solve linear equations, and work with square roots. This chapter focuses on equations in the form
\[ x^2+bx+c=0. \]
Completing the square rewrites part of the equation as a perfect square, such as \((x+h)^2\). This method works even when the equation does not factor easily.
The completing-the-square pattern
Start with
\[ x^2+bx+c=0. \]
Move the constant term to the other side:
\[ x^2+bx=-c. \]
The expression \(x^2+bx\) becomes a perfect square if you add
\[ \left(\frac b2\right)^2 \]
to both sides. The number \(\frac b2\) is half the coefficient of \(x\).
Then,
\[ x^2+bx+\left(\frac b2\right)^2 = \left(x+\frac b2\right)^2. \]
The general steps are:
- Move the constant term to the right side.
- Add \(\left(\frac b2\right)^2\) to both sides.
- Rewrite the left side as a square.
- Take the positive and negative square roots.
- Solve for \(x\).
Worked example
Solve
\[ x^2+6x+5=0. \]
Move \(5\):
\[ x^2+6x=-5. \]
The coefficient of \(x\) is \(6\), so half of it is \(3\). Add \(3^2=9\) to both sides:
\[ x^2+6x+9=-5+9. \]
Rewrite the left side:
\[ (x+3)^2=4. \]
Take both square roots:
\[ x+3=\pm2. \]
Separate the two cases:
\[ x+3=2 \quad\text{or}\quad x+3=-2. \]
Therefore,
\[ x=-1 \quad\text{or}\quad x=-5. \]
The same result can be checked by factoring:
\[ x^2+6x+5=(x+1)(x+5). \]
Fractions are sometimes necessary
If \(b\) is odd, \(\frac b2\) is a fraction. For example:
\[ x^2+5x=6. \]
Half of \(5\) is \(\frac52\), so add
\[ \left(\frac52\right)^2=\frac{25}{4} \]
to both sides:
\[ x^2+5x+\frac{25}{4} = 6+\frac{25}{4}. \]
Thus,
\[ \left(x+\frac52\right)^2=\frac{49}{4}. \]
Taking square roots gives
\[ x+\frac52=\pm\frac72. \]
So the solutions are
\[ x=1 \quad\text{or}\quad x=-6. \]
| Common error | Why it fails | Correction |
|---|---|---|
| Adding \(b^2\) instead of \((b/2)^2\) | The binomial square has middle term \(2h\), not \(h\) | Use half of \(b\), then square |
| Taking only one square root | A positive number has two real square roots | Write \(\pm\sqrt{k}\) |
| Forgetting to move \(c\) first | The square-completion step becomes disorganized | Isolate \(x^2+bx\) |
import math
def complete_square_monic(b, c):
"""Return the real solutions of x^2 + b*x + c = 0."""
h = b / 2
right_side = h * h - c
if right_side < 0:
return ()
root = math.sqrt(right_side)
return tuple(sorted({-h - root, -h + root}))
print(complete_square_monic(6, 5)) # (-5.0, -1.0)Exercise
Solve x^2 - 8x + 7 = 0 by completing the square.
Show answer
Move 7: x^2 - 8x = -7. Add (-4)^2 = 16: (x - 4)^2 = 9. Thus x - 4 = ±3, so x = 1 or x = 7.