Skip to content
Family Table Math
Auto

Completing the Square

Completing the square turns a quadratic like x2+6x+2x^2 + 6x + 2 into vertex form, (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=x2+6x+9(x + 3)^2 = x^2 + 6x + 9

The constant 99 is the square of half the xx-coefficient: (62)2=9\left(\tfrac{6}{2}\right)^2 = 9. In general:

x2+bx+(b2)2=(x+b2)2x^2 + bx + \left(\frac{b}{2}\right)^2 = \left(x + \frac{b}{2}\right)^2

To write x2+bx+cx^2 + bx + c in vertex form:

  1. Take half of bb and square it.
  2. Add and subtract that number right after the xx term (adding and subtracting the same number changes nothing).
  3. Group the first three terms as a perfect square, and combine the constants.
x2+6x+2=x2+6x+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}

First factor aa out of the x2x^2 and xx terms only. Complete the square inside the bracket, then multiply the subtracted number by aa as you take it out.

f(x)=a(x−h)2+kf(x) = a(x - h)^2 + k has vertex (h,k)(h, k).

If you haven’t seen it yet, f(x)f(x) just means “the yy-value when the input is xx”: writing f(x)=(x+3)2−7f(x) = (x + 3)^2 - 7 is the same as y=(x+3)2−7y = (x + 3)^2 - 7. (You’ll meet function notation properly in Grade 11 — see function notation.)

  • If a>0a \gt 0, the parabola opens up, so kk is the minimum value.
  • If a<0a \lt 0, it opens down, so kk is the maximum value.

Watch the sign: (x+3)2(x + 3)^2 means h=−3h = -3.

The built-in Desmos calculator is a quick way to check your work. Type y = x^2 + 6x + 2 and y = (x + 3)^2 - 7 on separate lines: if the two graphs lie exactly on top of each other, your vertex form is right, and clicking the parabola shows the vertex (−3,−7)(-3, -7). Desmos shows rounded decimals, so when the answer choices are exact fractions (like a vertex of (52,−214)\left(\tfrac{5}{2}, -\tfrac{21}{4}\right), shown as (2.5,−5.25)(2.5, -5.25)), match the decimal to the choice or finish the algebra by hand. See using Desmos on the SAT.

Write f(x)=x2+6x+2f(x) = x^2 + 6x + 2 in vertex form, and give the vertex.

Solution. Half of 66 is 33, and 32=93^2 = 9:

f(x)=x2+6x+9−9+2=(x+3)2−7\begin{aligned} f(x) &= x^2 + 6x + 9 - 9 + 2 \\ &= (x + 3)^2 - 7 \end{aligned}

The vertex is (−3,−7)(-3, -7), and since a=1>0a = 1 \gt 0, the minimum value is −7-7.

Write f(x)=x2−5x+1f(x) = x^2 - 5x + 1 in vertex form.

Solution. Half of −5-5 is −52-\tfrac{5}{2}, and (−52)2=254\left(-\tfrac{5}{2}\right)^2 = \tfrac{25}{4}:

f(x)=x2−5x+254−254+1=(x−52)2−214\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}

The vertex is (52,−214)\left(\tfrac{5}{2}, -\tfrac{21}{4}\right).

Write f(x)=2x2−12x+7f(x) = 2x^2 - 12x + 7 in vertex form, and give the minimum value.

Solution. Factor 22 out of the first two terms only:

f(x)=2(x2−6x)+7=2(x2−6x+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}

The vertex is (3,−11)(3, -11). Since a=2>0a = 2 \gt 0, the minimum value is −11-11, when x=3x = 3.

Check by expanding: 2(x2−6x+9)−11=2x2−12x+72(x^2 - 6x + 9) - 11 = 2x^2 - 12x + 7. ✓

Write f(x)=−3x2−12x+1f(x) = -3x^2 - 12x + 1 in vertex form, and give the maximum value.

Solution. Factor −3-3 out of the first two terms:

f(x)=−3(x2+4x)+1=−3(x2+4x+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}

The maximum value is 1313, when x=−2x = -2.

Adding the square without subtracting it. x2+6x+2x^2 + 6x + 2 becomes x2+6x+9−9+2x^2 + 6x + 9 - 9 + 2. If you only add 99, you’ve changed the function.

Forgetting to multiply by aa. In Example 3, the −9-9 inside the bracket becomes −18-18 when it comes out, because it’s multiplied by 22.

Using bb instead of half of bb. For x2+6xx^2 + 6x, you add 32=93^2 = 9, not 62=366^2 = 36.

Factoring aa out of the constant too. Only the x2x^2 and xx terms go in the bracket. The constant waits outside.

Getting the vertex sign wrong. (x+3)2−7(x + 3)^2 - 7 has vertex (−3,−7)(-3, -7), not (3,−7)(3, -7).

1. (Warm-up) What number should be added to x2+10xx^2 + 10x to make a perfect square? Write the result as a squared binomial.

Solution

(102)2=25\left(\tfrac{10}{2}\right)^2 = 25, and x2+10x+25=(x+5)2x^2 + 10x + 25 = (x + 5)^2.

2. (Warm-up) Write x2−8x+3x^2 - 8x + 3 in vertex form.

Solutionx2−8x+16−16+3=(x−4)2−13x^2 - 8x + 16 - 16 + 3 = (x - 4)^2 - 13

3. (Warm-up) Write x2+2x−5x^2 + 2x - 5 in vertex form, and give the vertex.

Solutionx2+2x+1−1−5=(x+1)2−6x^2 + 2x + 1 - 1 - 5 = (x + 1)^2 - 6

The vertex is (−1,−6)(-1, -6).

4. (Core) Write x2+3x−1x^2 + 3x - 1 in vertex form.

Solution

Half of 33 is 32\tfrac{3}{2}, and (32)2=94\left(\tfrac{3}{2}\right)^2 = \tfrac{9}{4}:

x2+3x+94−94−1=(x+32)2−134x^2 + 3x + \tfrac{9}{4} - \tfrac{9}{4} - 1 = \left(x + \tfrac{3}{2}\right)^2 - \tfrac{13}{4}

5. (Core) Write 3x2+18x+203x^2 + 18x + 20 in vertex form, and give the minimum value.

Solution3(x2+6x)+20=3(x2+6x+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}

The minimum value is −7-7, when x=−3x = -3.

6. (Core) Write −2x2+8x−3-2x^2 + 8x - 3 in vertex form, and give the maximum value.

Solution−2(x2−4x)−3=−2(x2−4x+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}

The maximum value is 55, when x=2x = 2.

7. (Core) Write 0.5x2−3x+40.5x^2 - 3x + 4 in vertex form.

Solution0.5(x2−6x)+4=0.5(x2−6x+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}

8. (Challenge) Solve x2+6x−3=0x^2 + 6x - 3 = 0 by completing the square. Give exact answers.

Solutionx2+6x+9−9−3=0(x+3)2=12x+3=±12=±23x=−3±23\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}

9. (Challenge) Complete the square on f(x)=ax2+bx+cf(x) = ax^2 + bx + c to show that the vertex has xx-coordinate −b2a-\dfrac{b}{2a}.

Solutionf(x)=a(x2+bax)+c=a(x2+bax+b24a2−b24a2)+c=a(x+b2a)2−b24a+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}

This is vertex form with h=−b2ah = -\dfrac{b}{2a}, so the vertex is at x=−b2ax = -\dfrac{b}{2a}.

Try these independently after the practice questions. Show your setup and explain your reasoning. Use exact answers where possible, and check that your answers fit the question. Homework solutions are not provided on the published site.

H1. (Foundations) What constant makes x2−14xx^2-14x a perfect-square trinomial? Write the completed square and explain why adding this constant alone would change a given function.

H2. (Foundations) Complete the square on x2+8x+3x^2+8x+3. State the vertex and verify by expanding your result.

H3. (Core) Rewrite x2−7x+2x^2-7x+2 in vertex form, using exact fractions. State the axis of symmetry and the minimum value.

H4. (Core) Complete the square on 3x2−15x+43x^2-15x+4. Show how the correction inside the brackets is multiplied by 33. Give the vertex and check the constant term by re-expanding.

H5. (Core) Rewrite −2x2−12x+1-2x^2-12x+1 in vertex form. State its maximum, the input where it occurs, and its range in set notation.

H6. (Core) Rewrite 12x2+5x−6\frac12x^2+5x-6 in vertex form. Explain why taking half of the original coefficient 55 before factoring out 1/21/2 would be wrong. Verify your form and state the range.

H7. (Challenge) Solve 3x2+12x−5=03x^2+12x-5=0 by completing the square rather than using the quadratic formula. Give exact simplified roots and verify both in the original equation.

H8. (Challenge) Find every real kk for which f(x)=2x2+kx+9f(x)=2x^2+kx+9 has minimum value 55. Complete the square with the parameter, give the vertex for each answer, and check the minimum directly.

H9. (Challenge) Suppose a>0a\gt0. Use completing the square to find a necessary and sufficient condition on a,b,ca,b,c for ax2+bx+cax^2+bx+c to be nonnegative at every real input. Explain both why your condition is sufficient and why it is necessary. Include the equality case.

H10. (Challenge) A point at coordinate xx on a number line has squared-distance sum S(x)=(x−1)2+(x−5)2S(x)=(x-1)^2+(x-5)^2 from the fixed points 11 and 55.

  • (a) Complete the square and find the least possible sum over all real xx.
  • (b) If the point must satisfy 0≤x≤20\le x\le2, find the least and greatest sums on that restricted domain.
  • (c) Explain why the unrestricted vertex cannot simply be reported as the answer to part (b).