Completing the square turns a quadratic like x 2 + 6 x + 2 x^2 + 6x + 2 x 2 + 6 x + 2 into vertex form, ( x + 3 ) 2 − 7 (x + 3)^2 - 7 ( x + 3 ) 2 − 7 . Vertex form shows the vertex and the maximum or minimum value straight away, which is exactly what you need for optimization problems.
Expanding a squared binomial gives a pattern:
( x + 3 ) 2 = x 2 + 6 x + 9 (x + 3)^2 = x^2 + 6x + 9 ( x + 3 ) 2 = x 2 + 6 x + 9
The constant 9 9 9 is the square of half the x x x -coefficient: ( 6 2 ) 2 = 9 \left(\tfrac{6}{2}\right)^2 = 9 ( 2 6 ) 2 = 9 . In general:
x 2 + b x + ( b 2 ) 2 = ( x + b 2 ) 2 x^2 + bx + \left(\frac{b}{2}\right)^2 = \left(x + \frac{b}{2}\right)^2 x 2 + b x + ( 2 b ) 2 = ( x + 2 b ) 2
To write x 2 + b x + c x^2 + bx + c x 2 + b x + c in vertex form:
Take half of b b b and square it.
Add and subtract that number right after the x x x term (adding and subtracting the same number changes nothing).
Group the first three terms as a perfect square, and combine the constants.
x 2 + 6 x + 2 = x 2 + 6 x + 9 − 9 + 2 = ( x + 3 ) 2 − 7 \begin{aligned}
x^2 + 6x + 2 &= x^2 + 6x + 9 - 9 + 2 \\
&= (x + 3)^2 - 7
\end{aligned} x 2 + 6 x + 2 = x 2 + 6 x + 9 − 9 + 2 = ( x + 3 ) 2 − 7
First factor a a a out of the x 2 x^2 x 2 and x x x terms only . Complete the square inside the bracket, then multiply the subtracted number by a a a as you take it out.
f ( x ) = a ( x − h ) 2 + k f(x) = a(x - h)^2 + k f ( x ) = a ( x − h ) 2 + k has vertex ( h , k ) (h, k) ( h , k ) .
If a > 0 a \gt 0 a > 0 , the parabola opens up, so k k k is the minimum value.
If a < 0 a \lt 0 a < 0 , it opens down, so k k k is the maximum value.
Watch the sign: ( x + 3 ) 2 (x + 3)^2 ( x + 3 ) 2 means h = − 3 h = -3 h = − 3 .
Write f ( x ) = x 2 + 6 x + 2 f(x) = x^2 + 6x + 2 f ( x ) = x 2 + 6 x + 2 in vertex form, and give the vertex.
Solution. Half of 6 6 6 is 3 3 3 , and 3 2 = 9 3^2 = 9 3 2 = 9 :
f ( x ) = x 2 + 6 x + 9 − 9 + 2 = ( x + 3 ) 2 − 7 \begin{aligned}
f(x) &= x^2 + 6x + 9 - 9 + 2 \\
&= (x + 3)^2 - 7
\end{aligned} f ( x ) = x 2 + 6 x + 9 − 9 + 2 = ( x + 3 ) 2 − 7
The vertex is ( − 3 , − 7 ) (-3, -7) ( − 3 , − 7 ) , and since a = 1 > 0 a = 1 \gt 0 a = 1 > 0 , the minimum value is − 7 -7 − 7 .
Write f ( x ) = x 2 − 5 x + 1 f(x) = x^2 - 5x + 1 f ( x ) = x 2 − 5 x + 1 in vertex form.
Solution. Half of − 5 -5 − 5 is − 5 2 -\tfrac{5}{2} − 2 5 , and ( − 5 2 ) 2 = 25 4 \left(-\tfrac{5}{2}\right)^2 = \tfrac{25}{4} ( − 2 5 ) 2 = 4 25 :
f ( x ) = x 2 − 5 x + 25 4 − 25 4 + 1 = ( x − 5 2 ) 2 − 21 4 \begin{aligned}
f(x) &= x^2 - 5x + \tfrac{25}{4} - \tfrac{25}{4} + 1 \\
&= \left(x - \tfrac{5}{2}\right)^2 - \tfrac{21}{4}
\end{aligned} f ( x ) = x 2 − 5 x + 4 25 − 4 25 + 1 = ( x − 2 5 ) 2 − 4 21
The vertex is ( 5 2 , − 21 4 ) \left(\tfrac{5}{2}, -\tfrac{21}{4}\right) ( 2 5 , − 4 21 ) .
Write f ( x ) = 2 x 2 − 12 x + 7 f(x) = 2x^2 - 12x + 7 f ( x ) = 2 x 2 − 12 x + 7 in vertex form, and give the minimum value.
Solution. Factor 2 2 2 out of the first two terms only:
f ( x ) = 2 ( x 2 − 6 x ) + 7 = 2 ( x 2 − 6 x + 9 − 9 ) + 7 = 2 ( ( x − 3 ) 2 − 9 ) + 7 = 2 ( x − 3 ) 2 − 18 + 7 = 2 ( x − 3 ) 2 − 11 \begin{aligned}
f(x) &= 2(x^2 - 6x) + 7 \\
&= 2(x^2 - 6x + 9 - 9) + 7 \\
&= 2\big((x - 3)^2 - 9\big) + 7 \\
&= 2(x - 3)^2 - 18 + 7 \\
&= 2(x - 3)^2 - 11
\end{aligned} f ( x ) = 2 ( x 2 − 6 x ) + 7 = 2 ( x 2 − 6 x + 9 − 9 ) + 7 = 2 ( ( x − 3 ) 2 − 9 ) + 7 = 2 ( x − 3 ) 2 − 18 + 7 = 2 ( x − 3 ) 2 − 11
The vertex is ( 3 , − 11 ) (3, -11) ( 3 , − 11 ) . Since a = 2 > 0 a = 2 \gt 0 a = 2 > 0 , the minimum value is − 11 -11 − 11 , when x = 3 x = 3 x = 3 .
Check by expanding: 2 ( x 2 − 6 x + 9 ) − 11 = 2 x 2 − 12 x + 7 2(x^2 - 6x + 9) - 11 = 2x^2 - 12x + 7 2 ( x 2 − 6 x + 9 ) − 11 = 2 x 2 − 12 x + 7 . ✓
Write f ( x ) = − 3 x 2 − 12 x + 1 f(x) = -3x^2 - 12x + 1 f ( x ) = − 3 x 2 − 12 x + 1 in vertex form, and give the maximum value.
Solution. Factor − 3 -3 − 3 out of the first two terms:
f ( x ) = − 3 ( x 2 + 4 x ) + 1 = − 3 ( x 2 + 4 x + 4 − 4 ) + 1 = − 3 ( ( x + 2 ) 2 − 4 ) + 1 = − 3 ( x + 2 ) 2 + 12 + 1 = − 3 ( x + 2 ) 2 + 13 \begin{aligned}
f(x) &= -3(x^2 + 4x) + 1 \\
&= -3(x^2 + 4x + 4 - 4) + 1 \\
&= -3\big((x + 2)^2 - 4\big) + 1 \\
&= -3(x + 2)^2 + 12 + 1 \\
&= -3(x + 2)^2 + 13
\end{aligned} f ( x ) = − 3 ( x 2 + 4 x ) + 1 = − 3 ( x 2 + 4 x + 4 − 4 ) + 1 = − 3 ( ( x + 2 ) 2 − 4 ) + 1 = − 3 ( x + 2 ) 2 + 12 + 1 = − 3 ( x + 2 ) 2 + 13
The maximum value is 13 13 13 , when x = − 2 x = -2 x = − 2 .
Adding the square without subtracting it. x 2 + 6 x + 2 x^2 + 6x + 2 x 2 + 6 x + 2 becomes x 2 + 6 x + 9 − 9 + 2 x^2 + 6x + 9 - 9 + 2 x 2 + 6 x + 9 − 9 + 2 . If you only add 9 9 9 , you’ve changed the function.
Forgetting to multiply by a a a . In Example 3, the − 9 -9 − 9 inside the bracket becomes − 18 -18 − 18 when it comes out, because it’s multiplied by 2 2 2 .
Using b b b instead of half of b b b . For x 2 + 6 x x^2 + 6x x 2 + 6 x , you add 3 2 = 9 3^2 = 9 3 2 = 9 , not 6 2 = 36 6^2 = 36 6 2 = 36 .
Factoring a a a out of the constant too. Only the x 2 x^2 x 2 and x x x terms go in the bracket. The constant waits outside.
Getting the vertex sign wrong. ( x + 3 ) 2 − 7 (x + 3)^2 - 7 ( x + 3 ) 2 − 7 has vertex ( − 3 , − 7 ) (-3, -7) ( − 3 , − 7 ) , not ( 3 , − 7 ) (3, -7) ( 3 , − 7 ) .
1. (Warm-up) What number should be added to x 2 + 10 x x^2 + 10x x 2 + 10 x to make a perfect square? Write the result as a squared binomial.
Solution ( 10 2 ) 2 = 25 \left(\tfrac{10}{2}\right)^2 = 25 ( 2 10 ) 2 = 25 , and x 2 + 10 x + 25 = ( x + 5 ) 2 x^2 + 10x + 25 = (x + 5)^2 x 2 + 10 x + 25 = ( x + 5 ) 2 .
2. (Warm-up) Write x 2 − 8 x + 3 x^2 - 8x + 3 x 2 − 8 x + 3 in vertex form.
Solution x 2 − 8 x + 16 − 16 + 3 = ( x − 4 ) 2 − 13 x^2 - 8x + 16 - 16 + 3 = (x - 4)^2 - 13 x 2 − 8 x + 16 − 16 + 3 = ( x − 4 ) 2 − 13
3. (Warm-up) Write x 2 + 2 x − 5 x^2 + 2x - 5 x 2 + 2 x − 5 in vertex form, and give the vertex.
Solution x 2 + 2 x + 1 − 1 − 5 = ( x + 1 ) 2 − 6 x^2 + 2x + 1 - 1 - 5 = (x + 1)^2 - 6 x 2 + 2 x + 1 − 1 − 5 = ( x + 1 ) 2 − 6 The vertex is ( − 1 , − 6 ) (-1, -6) ( − 1 , − 6 ) .
4. (Core) Write x 2 + 3 x − 1 x^2 + 3x - 1 x 2 + 3 x − 1 in vertex form.
Solution Half of 3 3 3 is 3 2 \tfrac{3}{2} 2 3 , and ( 3 2 ) 2 = 9 4 \left(\tfrac{3}{2}\right)^2 = \tfrac{9}{4} ( 2 3 ) 2 = 4 9 :
x 2 + 3 x + 9 4 − 9 4 − 1 = ( x + 3 2 ) 2 − 13 4 x^2 + 3x + \tfrac{9}{4} - \tfrac{9}{4} - 1 = \left(x + \tfrac{3}{2}\right)^2 - \tfrac{13}{4} x 2 + 3 x + 4 9 − 4 9 − 1 = ( x + 2 3 ) 2 − 4 13
5. (Core) Write 3 x 2 + 18 x + 20 3x^2 + 18x + 20 3 x 2 + 18 x + 20 in vertex form, and give the minimum value.
Solution 3 ( x 2 + 6 x ) + 20 = 3 ( x 2 + 6 x + 9 − 9 ) + 20 = 3 ( x + 3 ) 2 − 27 + 20 = 3 ( x + 3 ) 2 − 7 \begin{aligned}
3(x^2 + 6x) + 20 &= 3(x^2 + 6x + 9 - 9) + 20 \\
&= 3(x + 3)^2 - 27 + 20 \\
&= 3(x + 3)^2 - 7
\end{aligned} 3 ( x 2 + 6 x ) + 20 = 3 ( x 2 + 6 x + 9 − 9 ) + 20 = 3 ( x + 3 ) 2 − 27 + 20 = 3 ( x + 3 ) 2 − 7 The minimum value is − 7 -7 − 7 , when x = − 3 x = -3 x = − 3 .
6. (Core) Write − 2 x 2 + 8 x − 3 -2x^2 + 8x - 3 − 2 x 2 + 8 x − 3 in vertex form, and give the maximum value.
Solution − 2 ( x 2 − 4 x ) − 3 = − 2 ( x 2 − 4 x + 4 − 4 ) − 3 = − 2 ( x − 2 ) 2 + 8 − 3 = − 2 ( x − 2 ) 2 + 5 \begin{aligned}
-2(x^2 - 4x) - 3 &= -2(x^2 - 4x + 4 - 4) - 3 \\
&= -2(x - 2)^2 + 8 - 3 \\
&= -2(x - 2)^2 + 5
\end{aligned} − 2 ( x 2 − 4 x ) − 3 = − 2 ( x 2 − 4 x + 4 − 4 ) − 3 = − 2 ( x − 2 ) 2 + 8 − 3 = − 2 ( x − 2 ) 2 + 5 The maximum value is 5 5 5 , when x = 2 x = 2 x = 2 .
7. (Core) Write 0.5 x 2 − 3 x + 4 0.5x^2 - 3x + 4 0.5 x 2 − 3 x + 4 in vertex form.
Solution 0.5 ( x 2 − 6 x ) + 4 = 0.5 ( x 2 − 6 x + 9 − 9 ) + 4 = 0.5 ( x − 3 ) 2 − 4.5 + 4 = 0.5 ( x − 3 ) 2 − 0.5 \begin{aligned}
0.5(x^2 - 6x) + 4 &= 0.5(x^2 - 6x + 9 - 9) + 4 \\
&= 0.5(x - 3)^2 - 4.5 + 4 \\
&= 0.5(x - 3)^2 - 0.5
\end{aligned} 0.5 ( x 2 − 6 x ) + 4 = 0.5 ( x 2 − 6 x + 9 − 9 ) + 4 = 0.5 ( x − 3 ) 2 − 4.5 + 4 = 0.5 ( x − 3 ) 2 − 0.5
8. (Challenge) Solve x 2 + 6 x − 3 = 0 x^2 + 6x - 3 = 0 x 2 + 6 x − 3 = 0 by completing the square. Give exact answers.
Solution x 2 + 6 x + 9 − 9 − 3 = 0 ( x + 3 ) 2 = 12 x + 3 = ± 12 = ± 2 3 x = − 3 ± 2 3 \begin{aligned}
x^2 + 6x + 9 - 9 - 3 &= 0 \\
(x + 3)^2 &= 12 \\
x + 3 &= \pm\sqrt{12} = \pm 2\sqrt{3} \\
x &= -3 \pm 2\sqrt{3}
\end{aligned} x 2 + 6 x + 9 − 9 − 3 ( x + 3 ) 2 x + 3 x = 0 = 12 = ± 12 = ± 2 3 = − 3 ± 2 3
9. (Challenge) Complete the square on f ( x ) = a x 2 + b x + c f(x) = ax^2 + bx + c f ( x ) = a x 2 + b x + c to show that the vertex has x x x -coordinate − b 2 a -\dfrac{b}{2a} − 2 a b .
Solution f ( x ) = a ( x 2 + b a x ) + c = a ( x 2 + b a x + b 2 4 a 2 − b 2 4 a 2 ) + c = a ( x + b 2 a ) 2 − b 2 4 a + c \begin{aligned}
f(x) &= a\left(x^2 + \frac{b}{a}x\right) + c \\
&= a\left(x^2 + \frac{b}{a}x + \frac{b^2}{4a^2} - \frac{b^2}{4a^2}\right) + c \\
&= a\left(x + \frac{b}{2a}\right)^2 - \frac{b^2}{4a} + c
\end{aligned} f ( x ) = a ( x 2 + a b x ) + c = a ( x 2 + a b x + 4 a 2 b 2 − 4 a 2 b 2 ) + c = a ( x + 2 a b ) 2 − 4 a b 2 + c This is vertex form with h = − b 2 a h = -\dfrac{b}{2a} h = − 2 a b , so the vertex is at x = − b 2 a x = -\dfrac{b}{2a} x = − 2 a b .