Unit 3, lesson 25

Completing the Square

How to add the right number to both sides so a quadratic becomes a perfect square, then solve it with both square roots or read its vertex.

  • Theory part 49
  • Practice part 50
  • Quadratics

Theory, part 49

Practice, part 50

Some quadratics refuse to factor nicely, yet one small move makes them easy. If you can rewrite an equation so that one side is a perfect square, like (x+3)2=25(x + 3)^2 = 25, you can undo the square directly and read off both solutions. Completing the square is that move. It also turns y=x2−8x+13y = x^2 - 8x + 13 into a form that shows at a glance where the parabola turns, which the SAT asks about often.

See also Completing the Square in Foundations for Calculus and Quadratic Functions and Vertex Form in Precalculus.

Key terms

Perfect-square trinomial

Definition A perfect-square trinomial is a polynomial that equals the square of a binomial. For every real number kk and every real xx,

(x+k)2=x2+2kx+k2,(x−k)2=x2−2kx+k2.\begin{aligned} (x + k)^2 &= x^2 + 2kx + k^2, \\[0.4em] (x - k)^2 &= x^2 - 2kx + k^2. \end{aligned}

So a monic quadratic x2+bx+cx^2 + bx + c is a perfect square exactly when its constant term is the square of half the xx coefficient, that is when

c=(b2)2,c = \left(\frac{b}{2}\right)^2,

and then it equals (x+b2)2\left(x + \frac{b}{2}\right)^2.

In plain words Halve the middle coefficient and square it. If you get the constant term, the expression is a square in disguise.

Example In x2−10x+25x^2 - 10x + 25 half of −10-10 is −5-5, and (−5)2=25(-5)^2 = 25 matches the constant term. So x2−10x+25=(x−5)2x^2 - 10x + 25 = (x - 5)^2. By contrast x2−10x+20x^2 - 10x + 20 is not a perfect square, because its constant term is 2020 and not 2525.

Square-root method

Definition For a real number cc the equation z2=cz^2 = c has

  • two real solutions z=cz = \sqrt{c} and z=−cz = -\sqrt{c} when c>0c > 0,
  • exactly one real solution z=0z = 0 when c=0c = 0,
  • no real solutions when c<0c < 0, since no real number has a negative square.

The symbol c\sqrt{c} means only the nonnegative root, so the minus branch has to be written separately. The same applies when zz is an expression, for example z=x−hz = x - h.

In plain words If something squared is 1616, that something is 44 or −4-4. Forgetting the negative branch is the most common way to lose half the answer.

Example Solve (x−3)2=16(x - 3)^2 = 16. The quantity x−3x - 3 is either 44 or −4-4.

BranchEquationSolution
plusx−3=4x - 3 = 4x=7x = 7
minusx−3=−4x - 3 = -4x=−1x = -1

Both check, since (7−3)2=16(7 - 3)^2 = 16 and (−1−3)2=16(-1 - 3)^2 = 16.

Completing the square

Definition To complete the square in x2+bxx^2 + bx, add (b2)2\left(\frac{b}{2}\right)^2, which produces the perfect square

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

In an equation you add this number to both sides, so the solution set does not change. In an expression you add it and subtract it at once, so the value does not change.

In plain words You build the missing piece of a square, and you keep the balance by adding the same amount on the other side.

Example Solve x2+6x=16x^2 + 6x = 16. Half of 66 is 33, and 32=93^2 = 9, so add 99 to both sides.

x2+6x+9=16+9(x+3)2=25.\begin{aligned} x^2 + 6x + 9 &= 16 + 9 \\[0.4em] (x + 3)^2 &= 25. \end{aligned}

By the square-root method x+3=5x + 3 = 5 or x+3=−5x + 3 = -5, so x=2x = 2 or x=−8x = -8.

There is a helpful picture when xx is a positive length. Take an xx by xx square and attach two 33 by xx strips to two of its sides, one along the right and one along the bottom. The total area is x2+6xx^2 + 6x, and the shape is a large (x+3)(x + 3) by (x+3)(x + 3) square with a 33 by 33 corner missing. That missing corner is the 99 you add. The picture only works for positive lengths, but the algebra does not need it. The identity holds for every real xx, which is why the negative solution x=−8x = -8 is just as valid as x=2x = 2. Check it, (−8)2+6(−8)=64−48=16(-8)^2 + 6(-8) = 64 - 48 = 16.

Vertex form

Definition A quadratic function is in vertex form when it is written as

f(x)=a(x−h)2+k,a≠0.f(x) = a(x - h)^2 + k, \qquad a \ne 0.

Its graph is a parabola with vertex (h,k)(h, k). If a>0a > 0, the smallest value of ff is kk, reached at x=hx = h. If a<0a < 0, the largest value of ff is kk, reached at x=hx = h. Completing the square turns ax2+bx+cax^2 + bx + c into this form.

In plain words A square is never negative, so with a>0a > 0 the expression is smallest when the square is zero. That happens at x=hx = h, and the output there is kk.

Example Rewrite y=x2−8x+13y = x^2 - 8x + 13. Half of −8-8 is −4-4, and (−4)2=16(-4)^2 = 16. Add and subtract 1616.

y=x2−8x+16−16+13=(x−4)2−3.\begin{aligned} y &= x^2 - 8x + 16 - 16 + 13 \\[0.4em] &= (x - 4)^2 - 3. \end{aligned}

The vertex is (4,−3)(4, -3), and the minimum value of yy is −3-3. Watch the sign. The form (x−4)2(x - 4)^2 puts the vertex at x=4x = 4, not at x=−4x = -4.

Nonunit leading coefficient

Definition When the coefficient aa of x2x^2 is not 11, deal with it before completing the square.

  • In an equation ax2+bx+c=0ax^2 + bx + c = 0 with a≠0a \ne 0, divide both sides by aa. The new equation has the same solutions and a leading coefficient of 11.
  • In a function f(x)=ax2+bx+cf(x) = ax^2 + bx + c, factor aa out of the xx terms only. Do not divide, because that would change the function. The number you add inside the parentheses is multiplied by aa, so you must subtract aa times it outside.
ax2+bx+c=a(x2+bax)+c=a(x+b2a)2+c−b24a.\begin{aligned} &ax^2 + bx + c \\[0.4em] &= a\left(x^2 + \frac{b}{a}x\right) + c \\[0.4em] &= a\left(x + \frac{b}{2a}\right)^2 + c - \frac{b^2}{4a}. \end{aligned}

In plain words The square trick works on x2x^2 with coefficient 11. Get the aa out of the way first, and remember it still multiplies whatever you add inside.

Example Solve 2x2−8x−10=02x^2 - 8x - 10 = 0. Divide by 22 to get x2−4x−5=0x^2 - 4x - 5 = 0, so x2−4x=5x^2 - 4x = 5. Add 44 to both sides.

(x−2)2=9.(x - 2)^2 = 9.

So x−2=3x - 2 = 3 or x−2=−3x - 2 = -3, which gives x=5x = 5 or x=−1x = -1.

Now a function. For f(x)=2x2+12x+7f(x) = 2x^2 + 12x + 7 factor 22 from the first two terms. Inside, half of 66 is 33 and 32=93^2 = 9. Adding 99 inside really adds 2⋅9=182 \cdot 9 = 18, so subtract 1818 outside.

f(x)=2(x2+6x+9)−18+7=2(x+3)2−11.\begin{aligned} f(x) &= 2(x^2 + 6x + 9) - 18 + 7 \\[0.4em] &= 2(x + 3)^2 - 11. \end{aligned}

The vertex is (−3,−11)(-3, -11). Expanding 2(x+3)2−112(x + 3)^2 - 11 gives back 2x2+12x+72x^2 + 12x + 7, which confirms the work.

Check yourself

  1. Which expression is equivalent to x2+10x+18x^2 + 10x + 18? (A) (x+5)2+18(x + 5)^2 + 18, (B) (x+5)2−7(x + 5)^2 - 7, (C) (x+10)2−82(x + 10)^2 - 82, (D) (x+5)2+7(x + 5)^2 + 7
Show the answer

Choice (B) is correct. Half of 1010 is 55, and (x+5)2=x2+10x+25(x + 5)^2 = x^2 + 10x + 25. To get 1818 instead of 2525 you subtract 77. Choice (A) adds the 2525 without taking it back. Choice (C) uses 1010 instead of half of it, and its expansion has middle term 20x20x. Choice (D) has the sign of the correction wrong.

  1. If (x−4)2=49(x - 4)^2 = 49 and x<0x < 0, what is the value of xx?
Show the answer

The answer is −3-3. The square-root method gives x−4=7x - 4 = 7 or x−4=−7x - 4 = -7, so x=11x = 11 or x=−3x = -3. Only −3-3 is negative. Taking just the positive root would have missed the answer completely.

  1. The function f(x)=3x2−12x+5f(x) = 3x^2 - 12x + 5 can be written as f(x)=3(x−h)2+kf(x) = 3(x - h)^2 + k, where hh and kk are constants. What is the value of kk? (A) 11, (B) 99, (C) 1717, (D) −7-7
Show the answer

Choice (D) is correct. Factor 33 from the xx terms to get 3(x2−4x)+53(x^2 - 4x) + 5. Adding 44 inside adds 3⋅4=123 \cdot 4 = 12, so subtract 1212 outside.

f(x)=3(x−2)2−12+5=3(x−2)2−7.\begin{aligned} f(x) &= 3(x - 2)^2 - 12 + 5 \\[0.4em] &= 3(x - 2)^2 - 7. \end{aligned}

Choice (A) subtracts only 44, forgetting that the 33 multiplies it. Choice (B) adds 44 instead of subtracting it, and choice (C) adds 1212 instead of subtracting it.

How this lesson connects