Completing the square rewrites a quadratic expression in a form that
reveals turning points, minimum/maximum values, and roots. It is also
useful for solving equations and sketching graphs.
General Completing‑the‑Square Formula
\[
ax^2 + bx + c
= a(x - p)^2 + q
\]
\[
\text{where }
p = -\frac{b}{2a},
\qquad
q = c - \frac{b^2}{4a}.
\]

Explanation
1. Why do we complete the square?
It rewrites a quadratic into a form that clearly shows its turning point.
2. Start with the quadratic:
\(ax^2 + bx + c\).
3. The goal:
Turn it into \(a(x - p)^2 + q\), which is much easier to interpret.
4. How to find \(p\):
\(p = -\frac{b}{2a}\).
This comes from halving the coefficient of \(x\) and adjusting for the factor of \(a\).
5. How to find \(q\):
\(q = c - \frac{b^2}{4a}\).
This corrects the constant term after forming the square.
6. What this gives you:
The quadratic’s turning point is \((p, q)\), and the graph opens upwards if \(a \gt 0\) and downwards if \(a \lt 0\).
This formula works for every quadratic — it’s the universal completing‑the‑square identity.
A quadratic with no constant term after completing the square is called a
perfect square.
Worked Example
\[
(x+4)^2 = (x+4)(x+4)
\]
\[
= x^2 + 4x + 4x + 16
\]
\[
= x^2 + 8x + 16
\]
\[
\text{So } x^2 + 8x + 16 = (x+4)^2
\]
\[
x^2 + 8x + 16 \text{ is a perfect square.}
\]
Examples
\[
x^2 + 10x + 25 = (x+5)^2
\]
\[
x^2 - 8x + 16 = (x-4)^2
\]
This method requires expanding brackets and comparing co-efficients
Start with the pattern:
\[
(x+p)^2 + q
\]
Expand the square:
\[
(x+p)^2 + q = x^2 + 2px + p^2 + q
\]
Compare with \(ax^2 + bx + c\):
Example
Write \(x^2 + 10x + 3\) in the form \((x+p)^2 + q\).
Start with the pattern:
\[
(x+p)^2 + q
\]
Expand the square:
\[
(x+p)^2 + q = x^2 + 2px + p^2 + q
\]
Compare with \(x^2 + 10x + 3\):
\[
2p = 10
\qquad\Rightarrow\qquad
p = 5
\]
\[
p^2 + q = 3
\]
\[
25 + q = 3
\qquad\Rightarrow\qquad
q = -22
\]
So the completed‑square form is:
\[
x^2 + 10x + 3 = (x+5)^2 - 22
\]
Compare the coefficients of the quadratic with the expanded form of
\((x+a)^2 + b\):
\[
(x+a)^2 + b = x^2 + 2ax + (a^2 + b)
\]
Example
\[
x^2 + 8x + 7
\]
\[
2a = 8 \Rightarrow a = 4
\]
\[
x^2 + 8x + 7 = (x+4)^2 - 16 + 7
\]
\[
= (x+4)^2 - 9
\]
Example
\[
x^2 - 12x + 5
\]
\[
2a = -12 \Rightarrow a = -6
\]
\[
(x-6)^2 - 36 + 5 = (x-6)^2 - 31
\]
Example
\[
x^2 + 2x - 11
\]
\[
2a = 2 \Rightarrow a = 1
\]
\[
(x+1)^2 - 1 - 11 = (x+1)^2 - 12
\]
General Method (Unitary Coefficient)
Unitary coefficient means expression is of the form \( x^2 + bx + c \)
\[ x^2 + bx + c
\]
\[
\text{Add and subtract } \left(\frac{b}{2}\right)^2:
\]
\[
x^2 + bx + \left(\frac{b}{2}\right)^2 - \left(\frac{b}{2}\right)^2 + c
\]
\[
= (x + \tfrac{b}{2})^2 - \left(\tfrac{b}{2}\right)^2 + c
\]
Example
\[
x^2 + 6x + 5
\]
Add and subtract \(\left(\frac{6}{2}\right)^2 = 9\):
\[
x^2 + 6x + 9 - 9 + 5
\]
Group the perfect square:
\[
(x+3)^2 - 4
\]
Shortcut for \(x^2 + bx + c\)
- Write \(x\) inside a bracket.
- Add half of \(b\).
- Square the bracket.
- Subtract the square of the new number.
- Add or subtract \(c\).
Example
\[
x^2 + 6x + 2
\]
\[
(x+3)^2 - 9 + 2 = (x+3)^2 - 7
\]
Non‑Unitary \(x^2\) Coefficient
Example
\[
3x^2 + 12x + 5
\]
Factor out 3:
\[
3(x^2 + 4x) + 5
\]
Complete the square:
\[
x^2 + 4x = (x+2)^2 - 4
\]
Substitute:
\[
3[(x+2)^2 - 4] + 5
\]
\[
= 3(x+2)^2 - 12 + 5
\]
\[
= 3(x+2)^2 - 7
\]
Example
\[
2x^2 - 8x + 1
\]
\[
2(x^2 - 4x) + 1
\]
\[
x^2 - 4x = (x-2)^2 - 4
\]
\[
2[(x-2)^2 - 4] + 1
\]
\[
= 2(x-2)^2 - 7
\]
Example
Completing the Square — Negative Leading Coefficient
Rewrite:
\[
7 + x - x^2
\]
1. Reorder and factor out the negative
\[
-x^2 + x + 7 = -\left(x^2 - x\right) + 7
\]
2. Complete the square inside the brackets
\[
x^2 - x = x^2 - x + \left(\tfrac12\right)^2 - \left(\tfrac12\right)^2
\]
\[
= (x - \tfrac12)^2 - \tfrac14
\]
3. Substitute back and simplify
\[
-\left[(x - \tfrac12)^2 - \tfrac14\right] + 7
\]
\[
= -(x - \tfrac12)^2 + \tfrac14 + 7
\]
\[
= \frac{29}{4} - (x - \tfrac12)^2
\]
Final Form
\[
7 + x - x^2 = \frac{29}{4} - (x - \tfrac12)^2
\]
So:
\(p = \frac{29}{4}\),
\(q = -\tfrac12\).
Example
Completing the Square — Coefficient \(a \neq 1\)
Rewrite:
\[
3x^2 + 6x + 2
\]
1. Factor out the coefficient of \(x^2\)
\[
3(x^2 + 2x) + 2
\]
2. Complete the square inside the brackets
Half of \(2\) is \(1\), and \(1^2 = 1\).
\[
3(x^2 + 2x + 1 - 1) + 2
\]
\[
= 3\bigl((x+1)^2 - 1\bigr) + 2
\]
3. Expand and simplify
\[
3(x+1)^2 - 3 + 2
\]
\[
= 3(x+1)^2 - 1
\]
Final Form
\[
3x^2 + 6x + 2 = 3(x+1)^2 - 1
\]
So:
\(a = 3\),
\(p = 1\),
\(q = -1\).
\[
y = a(x - h)^2 + k
\]
Turning point:
\[
(h,\, k)
\]
Example
\[
y = x^2+2x - 1
\]
\[
y = (x+1)^2 - 2
\]
Turning point:
\[
(-1,\,-2)
\]
Solving Quadratic Equations
Example
\[
x^2 + 4x - 5 = 0
\]
Complete the square:
\[
(x+2)^2 - 9 = 0
\]
\[
(x+2)^2 = 9
\]
\[
x+2 = \pm 3
\]
\[
x = 1,\quad x = -5
\]
Graph Sketching from Completed Square Form
Worked Example
Example
Sketch the quadratic:
\( y = \frac{1}{2}x^2 - 3x + 4 \)
In completed square form:
\[
y = \frac{1}{2}x^2 - 3x + 4
\]
\[
y = \frac{1}{2}\bigl(x^2 - 6x\bigr) + 4
\]
\[
y = \frac{1}{2}\bigl(x^2 - 6x + 9 - 9\bigr) + 4
\]
\[
y = \frac{1}{2}\bigl((x - 3)^2 - 9\bigr) + 4
\]
\[
y = \frac{1}{2}(x - 3)^2 - \frac{9}{2} + 4
\]
\[
y = \frac{1}{2}(x - 3)^2 - \frac{1}{2}
\]
y‑intercept (set \(x = 0\)):
\[
y = \frac{1}{2}(0 - 3)^2 - \frac{1}{2}
\]
\[
y = \frac{9}{2} - \frac{1}{2}
\]
\[
y = 4
\]
Putting all this information together:
This shows:
- U‑shaped parabola (positive coefficient).
- Turning point at \((3,\,-\tfrac{1}{2})\).
- Axis of symmetry: \(x = 3\).
- Minimum value: \(y = -\tfrac{1}{2}\).
-
Roots (set \(y = 0\)):
\[
\frac{1}{2} = \frac{1}{2}(x - 3)^2
\]
\[
1 = (x - 3)^2
\]
\[
\pm 1 = x - 3
\]
\[
x = 4 \quad\text{and}\quad x = 2
\]
\[
(2,0) \text{ and } (4,0)
\]
© Alexander Forrest