2.12 - Completing the square

2.12 - Completing the square

Rewrite a quadratic as a squared bracket plus a constant, without changing its value. You will complete the square with positive, negative and fractional bracket values, handle a coefficient in front of the square and work out unknown constants in identities.

Building a squared bracket

Can x2−10x+29x^2-10x+29 ever be less than 44? Trying lots of values might suggest an answer. A squared bracket will explain it for every real value of xx.

Start with x2+6xx^2+6x. For positive xx, picture a square of side xx and two strips, each of width 33 and area 3x3x. The missing corner has area 99; adding it creates a square of side x+3x+3.

[DIAGRAM: asset_name: Completing a square with two strips; asset_slug: l2fm-completing-square-area; caption: Adding a corner of area 9 makes a square of side x plus 3; description: An exact square area construction has a blue x by x square, two sage strips of width 3 and area 3x, and a clay corner square of area 9. Dimensions mark x and 3 on each side. The equations show x squared plus 6x plus 9 equals the square of x plus 3, so x squared plus 6x equals the square of x plus 3 minus 9. The diagram states that its area interpretation uses positive x but the identity holds for every real x]
Adding a corner of area 9 makes a square of side x plus 3

Adding 99 changes the original expression, so subtract 99 as well: x2+6x=(x+3)2−9x^2+6x=(x+3)^2-9. Expansion proves this identity even when xx is zero or negative and the area picture no longer applies.

You already know

(x+h)2=x2+2hx+h2(x+h)^2=x^2+2hx+h^2. The middle coefficient is twice the bracket value. Squaring a bracket includes its two mixed products; (x+h)2≠x2+h2(x+h)^2\ne x^2+h^2.

Completing the square reverses this expansion. Choose the bracket value to match the linear term, then correct the constant.

Completing the square

Completing the square rewrites a quadratic as a(x+b)2+ca(x+b)^2+c, where a≠0a\ne0, in an identity true for every real xx. For example, x2+6x≡(x+3)2−9x^2+6x\equiv(x+3)^2-9. The expression (x+3)2(x+3)^2 alone is not identical to x2+6xx^2+6x, because it includes an extra 99.

For a quadratic whose squared-term coefficient is 11, halve the linear coefficient to get the bracket value.

Completing the square when the leading coefficient is one

For real pp, qq and xx,

x2+px+q≡(x+p2)2+q−(p2)2x^2+px+q\equiv\left(x+\frac p2\right)^2+q-\left(\frac p2\right)^2

Half of pp may be negative or fractional. Subtract its square to compensate for the constant added by the bracket.
Not on the formulae sheet: learn it.

First use the positive linear coefficient from the area picture, with a constant already present.

Worked example 1: a positive bracket value

Question. Write x2+6x+4x^2+6x+4 in the form (x+b)2+c(x+b)^2+c.

Plan. Halve 66, form the squared bracket and subtract its extra constant.

x2+6x+4≡(x+3)2−9+4half of 6 is 3≡(x+3)2−5combine constants\begin{aligned} x^2+6x+4&\equiv(x+3)^2-9+4 &&\text{half of }6\text{ is }3\\ &\equiv(x+3)^2-5 &&\text{combine constants} \end{aligned}

Why this step? Expanding (x+3)2(x+3)^2 creates +9+9, so subtracting 99 preserves the original value.

Answer. (x+3)2−5(x+3)^2-5, so b=3b=3 and c=−5c=-5.

Check. Expansion gives x2+6x+9−5=x2+6x+4x^2+6x+9-5=x^2+6x+4. At x=0x=0, both forms give 44.

Change only the sign of the linear term. The bracket value becomes negative, but its square is still positive.

Worked example 2: a negative bracket value

Question. Write x2−6x+4x^2-6x+4 in the form (x+b)2+c(x+b)^2+c.

Plan. Halve −6-6, then compensate for the constant in the squared bracket.

x2−6x+4≡(x−3)2−9+4half of −6 is −3≡(x−3)2−5combine constants\begin{aligned} x^2-6x+4&\equiv(x-3)^2-9+4 &&\text{half of }-6\text{ is }-3\\ &\equiv(x-3)^2-5 &&\text{combine constants} \end{aligned}

Why this step? The bracket creates (−3)2=9(-3)^2=9, so the correction is −9-9, just as before.

Answer. (x−3)2−5(x-3)^2-5, so b=−3b=-3 and c=−5c=-5.

Check. Expanding gives x2−6x+9−5=x2−6x+4x^2-6x+9-5=x^2-6x+4. At x=3x=3, both expressions equal −5-5.

The sign of the linear coefficient controls the sign inside the bracket, not the sign of the squared correction.

Watch out

Wrong: x2−6x+4≡(x−3)2+9+4x^2-6x+4\equiv(x-3)^2+9+4. The square already contains +9+9, so this adds it twice. Right: (x−3)2−9+4(x-3)^2-9+4.

Try a new negative linear coefficient, keeping the constant correction separate until the final line.

Keeping the outside coefficient

If the coefficient of x2x^2 is not 11, take it outside the quadratic terms first. Complete the square inside, then let the outside coefficient multiply every correction inside its bracket.

For 2x2+6x+72x^2+6x+7, start with 2(x2+3x)+72(x^2+3x)+7. You must halve 33, the linear coefficient inside, rather than the original 66.

Completing the square with a leading coefficient

For real A≠0A\ne0, BB, CC and xx,

Ax2+Bx+C≡A(x+B2A)2+C−B24AAx^2+Bx+C\equiv A\left(x+\frac{B}{2A}\right)^2+C-\frac{B^2}{4A}

The factorisation-and-correction method works for negative AA too. The outside factor multiplies the entire correction.
Not on the formulae sheet: learn it.

You can derive the result each time; memorising the longer formula is less useful than understanding where the correction comes from.

Worked example 3: a fractional bracket value

Question. Write 2x2+6x+72x^2+6x+7 in the form a(x+b)2+ca(x+b)^2+c.

Plan. Take out 22 from the quadratic terms, complete the square inside and distribute the correction.

2x2+6x+7≡2(x2+3x)+7factor the first two terms≡2[(x+32)2−94]+7halve 3 and square≡2(x+32)2−92+7multiply the correction by 2≡2(x+32)2+52combine constants\begin{aligned} 2x^2+6x+7&\equiv2(x^2+3x)+7 &&\text{factor the first two terms}\\ &\equiv2\left[\left(x+\frac32\right)^2-\frac94\right]+7 &&\text{halve }3\text{ and square}\\ &\equiv2\left(x+\frac32\right)^2-\frac92+7 &&\text{multiply the correction by }2\\ &\equiv2\left(x+\frac32\right)^2+\frac52 &&\text{combine constants} \end{aligned}

Why this step? The extra 9/49/4 lies inside a bracket multiplied by 22, so it contributes 9/29/2 to the whole expression.

Answer. 2(x+32)2+522\left(x+\frac32\right)^2+\frac52, so a=2a=2, b=32b=\frac32, c=52c=\frac52.

Check. Expansion gives 2x2+6x+9/2+5/2=2x2+6x+72x^2+6x+9/2+5/2=2x^2+6x+7. At x=0x=0, the result is 9/2+5/2=79/2+5/2=7.

Change only the leading coefficient from 22 to 33, leaving the linear and constant terms unchanged. The linear coefficient inside the first bracket changes, so halve it afresh.

Worked example 4: the leading coefficient changes

Question. Write 3x2+6x+73x^2+6x+7 in the form a(x+b)2+ca(x+b)^2+c.

Plan. Take out 33, complete the square inside and simplify the constant outside.

3x2+6x+7≡3(x2+2x)+7factor the first two terms≡3[(x+1)2−1]+7half of 2 is 1≡3(x+1)2−3+7distribute the 3≡3(x+1)2+4combine constants\begin{aligned} 3x^2+6x+7&\equiv3(x^2+2x)+7 &&\text{factor the first two terms}\\ &\equiv3[(x+1)^2-1]+7 &&\text{half of }2\text{ is }1\\ &\equiv3(x+1)^2-3+7 &&\text{distribute the }3\\ &\equiv3(x+1)^2+4 &&\text{combine constants} \end{aligned}

Why this step? Changing the outside coefficient changes the inside coefficient too; copying the previous bracket value would give the wrong linear term.

Answer. 3(x+1)2+43(x+1)^2+4, so a=3a=3, b=1b=1, c=4c=4.

Check. 3(x2+2x+1)+4=3x2+6x+73(x^2+2x+1)+4=3x^2+6x+7. At x=−1x=-1, the original and completed forms both give 44.

A completed square can reveal a fact hidden in the expanded form. For every real xx,

x2+x+1≡(x+12)2+34>0x^2+x+1\equiv\left(x+\frac12\right)^2+\frac34>0

So this quadratic is always positive, even though the middle term is negative whenever x<0x<0. The square makes the guarantee visible.

Watch out

Wrong: 2[(x+32)2−94]+7≡2(x+32)2−94+72[(x+\frac32)^2-\frac94]+7\equiv2(x+\frac32)^2-\frac94+7. The outside 22 must multiply −9/4-9/4 as well. The correction outside is −9/2-9/2.

In this check the bracket value is fractional again. Give the expression in the exact form requested as your final answer.

Matching constants in a square identity

An identity holds for every value of xx, so coefficients of corresponding powers must match. This gives another route to a completed square and lets you work out a missing constant in the original quadratic.

Expand the general form once:

a(x+b)2+c≡ax2+2abx+ab2+ca(x+b)^2+c\equiv ax^2+2abx+ab^2+c

The three coefficients are aa, 2ab2ab and ab2+cab^2+c. This is an expansion of the earlier identity, not a formula supplied on the formulae sheet.

Worked example 5: a missing constant in the quadratic

Question. 6x2+18x+n≡a(x+b)2+26x^2+18x+n\equiv a(x+b)^2+2, where aa, bb and nn are constants. Work out their values.

Plan. Expand the right-hand side, then compare the squared, linear and constant coefficients in that order.

a(x+b)2+2≡ax2+2abx+ab2+2expand the squarea=6match the squared term2(6)b=18⟹b=32match the linear termn=6(32)2+2match the constant=272+2=312evaluate\begin{aligned} a(x+b)^2+2&\equiv ax^2+2abx+ab^2+2 &&\text{expand the square}\\ a&=6 &&\text{match the squared term}\\ 2(6)b&=18\Longrightarrow b=\frac32 &&\text{match the linear term}\\ n&=6\left(\frac32\right)^2+2 &&\text{match the constant}\\ &=\frac{27}{2}+2=\frac{31}{2} &&\text{evaluate} \end{aligned}

Why this step? The outside coefficient aa contributes to both the linear term and the constant; neither is determined by bb alone.

Answer. a=6a=6, b=32b=\frac32, n=312n=\frac{31}{2}.

Check. 6(x+32)2+2≡6x2+18x+27/2+2=6x2+18x+31/26(x+\frac32)^2+2\equiv6x^2+18x+27/2+2=6x^2+18x+31/2.

Change only the sign of the linear term. Predict which constant changes sign and which stays the same before following the working.

Worked example 6: the bracket sign changes

Question. 6x2−18x+n≡a(x+b)2+26x^2-18x+n\equiv a(x+b)^2+2, where aa, bb and nn are constants. Work out their values.

Plan. Compare coefficients again, retaining the sign in the linear equation.

a(x+b)2+2≡ax2+2abx+ab2+2expanda=6match the squared term12b=−18⟹b=−32match the signed linear termn=6(−32)2+2match the constant=312the square is unchanged\begin{aligned} a(x+b)^2+2&\equiv ax^2+2abx+ab^2+2 &&\text{expand}\\ a&=6 &&\text{match the squared term}\\ 12b&=-18\Longrightarrow b=-\frac32 &&\text{match the signed linear term}\\ n&=6\left(-\frac32\right)^2+2 &&\text{match the constant}\\ &=\frac{31}{2} &&\text{the square is unchanged} \end{aligned}

Why this step? Negating bb changes 2ab2ab, but it does not change ab2ab^2.

Answer. a=6a=6, b=−32b=-\frac32, n=312n=\frac{31}{2}.

Check. Expanding 6(x−32)2+26(x-\frac32)^2+2 gives 6x2−18x+31/26x^2-18x+31/2, with the required negative linear coefficient.

Finally, the opening expression is

x2−10x+29≡(x−5)2−25+29≡(x−5)2+4x^2-10x+29\equiv(x-5)^2-25+29\equiv(x-5)^2+4

A real square is non-negative, so the expression cannot be less than 44. It equals 44 exactly when x=5x=5. This is why the completed form is useful later when you study quadratic functions.

Exam tip

Read whether the question wants an expression or values of named constants. For “write in the form”, give the completed expression. For “work out the values”, finish with each named value clearly identified.

The last check changes the coefficients and the supplied final constant. Compare all three terms, including the constant created by squaring the bracket.

Quick Recap

  • A squared bracket creates a linear term and a constant; compensate for the constant it adds.
  • When the squared-term coefficient is 11, halve the linear coefficient for the bracket value.
  • Otherwise factor out the leading coefficient first, and let it multiply the correction too.
  • Expand to check the identity, or match coefficients to work out unknown constants.

The opening quadratic is (x−5)2+4(x-5)^2+4, so its smallest real value is 44, attained at x=5x=5.