1.1 - Completing the square

1.1 - Completing the square

Two expressions can describe the same quadratic and reveal different things about it. In this first part of 1.1, you will rewrite a quadratic as a square plus a constant, then use that form to find its turning point and sketch its graph. The method also explains why some quadratics can never be negative.

Making a perfect square

Can x2+6x+2x^2+6x+2 ever be less than −7-7? Substituting a few values might suggest an answer. Rewriting the expression will prove it for every real xx.

Start with a square you can recognise:

(x+3)2=x2+6x+9.(x+3)^2=x^2+6x+9.

The first two terms match our expression. The constant is 77 too large, so subtract 77:

x2+6x+2=(x+3)2−7.x^2+6x+2=(x+3)^2-7.

The picture shows where the 99 comes from. For a positive length xx, an xx-by-xx square and two xx-by-33 rectangles leave a 33-by-33 corner to fill. The algebraic identity remains true for negative xx too: expand the bracket to check it.

[DIAGRAM: asset_name: The missing corner; asset_slug: completing-square-area; caption: The missing corner has area 9, so x squared plus 6x is nine less than the whole square; description: A square of side x plus 3 is divided into an x by x square, two x by 3 rectangles and a 3 by 3 corner. The four areas are labelled x squared, 3x, 3x and 9, with side lengths x and 3 marked outside. The identity beneath is x squared plus 6x plus 9 equals the square of x plus 3.]
The missing corner has area 9, so x squared plus 6x is nine less than the whole square

Completing the square

Completing the square means rewriting a quadratic as a multiple of a squared linear expression plus a constant. The new expression has the same value as the original for every permitted input.

Why halve the coefficient of xx? Because (x+h)2=x2+2hx+h2(x+h)^2=x^2+2hx+h^2. To match bxbx, choose h=b/2h=b/2, then correct the constant.

Completing a monic quadratic

Completing a monic quadratic.
For real bb and cc,

x2+bx+c=(x+b2)2+c−b24.x^2+bx+c=\left(x+\frac b2\right)^2+c-\frac{b^2}{4}.

Not in the formula booklet: learn it.

Use the reasoning behind the formula: match the linear term, then check the constant.

Worked example 1: a positive linear term

Question. Express x2+6x+2x^2+6x+2 as a square plus a constant.

Plan. Half of 66 is 33; expand (x+3)2(x+3)^2 and adjust its constant.

x2+6x+2=(x+3)2−9+2remove the added 9=(x+3)2−7combine constants\begin{aligned} x^2+6x+2&=(x+3)^2-9+2 &&\text{remove the added }9\\ &=(x+3)^2-7 &&\text{combine constants} \end{aligned}

Answer. (x+3)2−7(x+3)^2-7.

Check. Expanding gives x2+6x+9−7=x2+6x+2x^2+6x+9-7=x^2+6x+2.

Now change just the sign of the linear term. The sign inside the bracket changes, but the correction still uses a positive square.

Worked example 2: a negative linear term

Question. Express x2−6x+2x^2-6x+2 as a square plus a constant.

Plan. Half of −6-6 is −3-3, so start with (x−3)2(x-3)^2.

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

Answer. (x−3)2−7(x-3)^2-7.

Check. At x=3x=3, the original gives 9−18+2=−79-18+2=-7, and the new form gives 0−7=−70-7=-7. Expanding confirms equality for every xx.

The same method works with odd coefficients: for x2+5xx^2+5x, the bracket starts x+5/2x+5/2. Keep the fraction exact.

Watch out

(x−3)2(x-3)^2 is x2−6x+9x^2-6x+9, not x2−9x^2-9. A squared bracket has a middle term. Expanding is a quick way to catch a wrong sign or constant.

Try the same method with a different linear coefficient.

A coefficient before the square

When the coefficient of x2x^2 is not 11, factor it out of the first two terms before completing the square. Anything you add or subtract inside that bracket is multiplied by the outside coefficient.

For example, 2(x2+6x)2(x^2+6x) becomes 2[(x+3)2−9]2[(x+3)^2-9]. The correction outside the square is −18-18, not −9-9.

The general completed-square form

The general completed-square form.
For a≠0a\ne0,

ax2+bx+c=a(x+b2a)2+c−b24a.ax^2+bx+c=a\left(x+\frac{b}{2a}\right)^2+c-\frac{b^2}{4a}.

Not in the formula booklet: learn it.

You can reconstruct this result by factoring and expanding; there is no need to force every calculation through a memorised substitution.

Worked example 3: a positive multiplier

Question. Express 2x2+12x+72x^2+12x+7 in the form 2(x+p)2+q2(x+p)^2+q.

Plan. Factor 22 from the first two terms, complete the square inside, then multiply out the correction.

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

Answer. 2(x+3)2−112(x+3)^2-11, so p=3p=3 and q=−11q=-11.

Check. Expanding gives 2x2+12x+18−112x^2+12x+18-11, which is the original expression.

Keep x2+6xx^2+6x and the constant 77, but change the multiplier from 22 to −2-2. This changes the sign of the correction outside the bracket.

Worked example 4: a negative multiplier

Question. Express −2x2−12x+7-2x^2-12x+7 in the form −2(x+p)2+q-2(x+p)^2+q.

Plan. Factor −2-2, then complete the same square as before.

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

Answer. −2(x+3)2+25-2(x+3)^2+25, so p=3p=3 and q=25q=25.

Check. At x=0x=0, the new form gives −18+25=7-18+25=7, matching the original constant. Expansion also recovers −12x-12x.

The outside coefficient acts on the whole bracket, including the correction.

Watch out

2[(x+3)2−9]≠2(x+3)2−92[(x+3)^2-9]\ne2(x+3)^2-9. The correct expression is 2(x+3)2−182(x+3)^2-18. Leave the square bracket in place until you have multiplied both terms.

Here is another negative multiplier to handle.

The turning point

A real square is non-negative, and it equals zero exactly when its base is zero. That simple fact reveals the highest or lowest point of a quadratic graph.

In y=2(x−3)2−5y=2(x-3)^2-5, the squared term is smallest at x=3x=3. Its value there is zero, so the smallest possible yy is −5-5. Inputs equally far from 33, such as 22 and 44, give the same squared term and the same height.

Vertex and axis of symmetry

The vertex of a quadratic graph is its turning point. For y=a(x−h)2+ky=a(x-h)^2+k, where a≠0a\ne0, the vertex is (h,k)(h,k) and the axis of symmetry is the vertical line x=hx=h.

If a>0a>0, the graph opens upwards and kk is its minimum value. If a<0a<0, multiplying a square by aa makes it non-positive: the graph opens downwards and kk is its maximum value. These statements allow every real input xx.

[DIAGRAM: asset_name: One vertex, two directions; asset_slug: quadratic-vertex-sign; caption: The sign before the square decides whether the vertex is a minimum or a maximum; description: Two coordinate plots with matching scales show y equals 2 times the square of x minus 3 minus 5 and y equals minus 2 times the square of x minus 3 minus 5. Both have vertex 3 comma minus 5 and symmetry line x equals 3. The first opens upwards and labels minimum minus 5; the second opens downwards and labels maximum minus 5.]
The sign before the square decides whether the vertex is a minimum or a maximum

Worked example 5: the minimum value

Question. State the minimum value of 2(x−3)2−52(x-3)^2-5 and the value of xx at which it occurs.

Plan. Use the fact that the square is at least zero and identify when it vanishes.

2(x−3)2≥0⟹2(x−3)2−5≥−5.2(x-3)^2\ge0 \quad\Longrightarrow\quad 2(x-3)^2-5\ge-5.

Equality holds when x−3=0x-3=0.

Answer. Minimum value −5-5, at x=3x=3. The vertex is (3,−5)(3,-5).

Check. At the neighbouring inputs x=2x=2 and x=4x=4, the value is −3-3, higher than −5-5.

Now change only the sign of the coefficient before the square. The vertex stays where it was, but its role changes.

Worked example 6: the maximum value

Question. State the maximum value of −2(x−3)2−5-2(x-3)^2-5 and the value of xx at which it occurs.

Plan. A negative multiple of a square cannot exceed zero.

−2(x−3)2≤0⟹−2(x−3)2−5≤−5.-2(x-3)^2\le0 \quad\Longrightarrow\quad -2(x-3)^2-5\le-5.

Equality again holds when x=3x=3.

Answer. Maximum value −5-5, at x=3x=3. The vertex is (3,−5)(3,-5).

Check. At x=2x=2 and x=4x=4, the value is −7-7, below the maximum.

Read the horizontal coordinate by asking which input makes the bracket zero.

Watch out

For y=(x+4)2+9y=(x+4)^2+9, the vertex is (−4,9)(-4,9), not (4,9)(4,9). The bracket vanishes at x=−4x=-4.

Use both the bracket and its multiplier in this check.

Sketching from the square

A completed square gives you the shape and turning point immediately. Add the yy-intercept by substituting x=0x=0, then use symmetry to place a second point. This gives a useful sketch without a long table of values.

Worked example 7: a graph above the axis

Question. Find the vertex and yy-intercept of y=x2−4x+7y=x^2-4x+7, and describe its position relative to the xx-axis.

Plan. Complete the square, then use its minimum and substitute x=0x=0.

y=(x−2)2−4+7=(x−2)2+3.y=(x-2)^2-4+7=(x-2)^2+3.

The graph opens upwards. Its minimum is 33, attained at x=2x=2, and its symmetry line is x=2x=2. At x=0x=0, y=7y=7; symmetry gives another point (4,7)(4,7).

Answer. Vertex (2,3)(2,3), yy-intercept (0,7)(0,7). The whole graph lies above the xx-axis because y≥3y\ge3.

Check. Direct substitution gives y(2)=4−8+7=3y(2)=4-8+7=3 and y(4)=16−16+7=7y(4)=16-16+7=7.

The three labelled points and the symmetry line locate the curve clearly.

[DIAGRAM: asset_name: A sketch from three features; asset_slug: quadratic-sketch; caption: A completed square locates the vertex and explains why this graph stays above the x-axis; description: Coordinate plot of y equals x squared minus 4x plus 7, with vertex 2 comma 3, y-intercept 0 comma 7, reflected point 4 comma 7 and dashed symmetry line x equals 2. The curve opens upwards and its minimum height is 3.]
A completed square locates the vertex and explains why this graph stays above the x-axis

Next, keep the first two terms but make the constant unknown. An extreme value can tell us what that constant must be.

Worked example 8: an unknown constant

Question. The minimum value of x2−4x+kx^2-4x+k, for real xx, is 88. Find kk and state the vertex of its graph.

Plan. Complete the square in terms of kk, then equate the minimum to 88.

x2−4x+k=(x−2)2+k−4.x^2-4x+k=(x-2)^2+k-4.

The square is zero at x=2x=2, so the minimum is k−4k-4. Therefore

k−4=8⟹k=12.k-4=8\quad\Longrightarrow\quad k=12.

Answer. k=12k=12, with vertex (2,8)(2,8).

Check. Substituting x=2x=2 into x2−4x+12x^2-4x+12 gives 88. Every other real input adds a positive square to 88.

Return to our opening question: x2+6x+2=(x+3)2−7x^2+6x+2=(x+3)^2-7, so it cannot be less than −7-7. It reaches −7-7 exactly at x=−3x=-3. One rearrangement has settled infinitely many possible inputs.

Exam tip

When asked for a particular completed-square form, give that form explicitly. Expand it once to check the constant correction: this is the check highlighted in Cambridge's guidance on this question type.

Use the minimum to recover a missing constant in a new quadratic.

Quick Recap

  • Match a square by halving the linear coefficient, then correct the constant.
  • Factor the coefficient of x2x^2 first when it is not 11.
  • In y=a(x−h)2+ky=a(x-h)^2+k, the vertex is (h,k)(h,k). It is a minimum for a>0a>0 and a maximum for a<0a<0.
  • Use the vertex, symmetry and yy-intercept to sketch a quadratic, and expand your completed square to check it.

The opening quadratic cannot fall below −7-7: x2+6x+2=(x+3)2−7x^2+6x+2=(x+3)^2-7.