1. Home
  2. Blog
  3. Completing the square

How to complete the square: from general form to standard form

To complete the square, factor a out of the x2 and x terms, add and subtract the square of half the coefficient of x inside the bracket, close the perfect square, and multiply the number left over by a as it leaves the bracket. What comes out is the standard form a(x−h)2+k (often called vertex form outside Quebec), which hands you the vertex (h,k) and the maximum or minimum of the function with no further work.

The one identity behind it

Every step of completing the square is this expansion read backwards:

(x+p)2=x2+2px+p2
  • The coefficient of x is 2p, twice the number in the bracket.
  • The constant is p2, the square of that number.

So if you are looking at x2+8x, the bracket must hold p=4, half of 8, and the piece missing to make a perfect square is 42=16. That is the whole trick: half the coefficient of x, squared. Everything else is bookkeeping, so that the function does not change while you rewrite it.

The four moves

  1. Factor a out of the first two terms only. Leave the constant outside. If a=1, there is nothing to do.
  2. Add and subtract the missing square inside the bracket: half the coefficient of x in the bracket, squared. Adding and subtracting the same number changes nothing.
  3. Close the square. The first three terms in the bracket are now a perfect square trinomial; write them as (x+p)2.
  4. Clear the bracket. The number you subtracted is multiplied by a as it leaves, then combined with the constant.

Example 1: a leading coefficient of 1

Write f(x)=x2+12x+7 in standard form. Move 1 is empty. Half of 12 is 6, and 62=36:

f(x)=(x2+12x+36)−36+7 f(x)=(x+6)2−29

The vertex is (−6,−29). Read h with care: x+6 is x−(−6), so h=−6.

Example 2: a leading coefficient that is not 1

This is where most students stall, because there are now two numbers to keep track of. Write f(x)=−2x2−8x+5 in standard form.

  1. Factor −2 out of the first two terms. Since −2×4x=−8x, the bracket holds x2+4x: f(x)=−2(x2+4x)+5
  2. Half of the 4 inside the bracket is 2, and 22=4. Add and subtract it inside: f(x)=−2(x2+4x+4−4)+5
  3. Close the square: f(x)=−2[(x+2)2−4]+5
  4. Clear the bracket. The −4 leaves multiplied by −2, so it becomes +8: f(x)=−2(x+2)2+8+5=−2(x+2)2+13

The vertex is (−2,13). Notice that in move 2 the number halved is the 4 in the bracket, not the −8 of the original rule.

A one-line check. Put x=0 into both rules. The general form gives f(0)=5; the standard form gives −2(0+2)2+13=−8+13=5. They agree. Had the −4 left the bracket without being multiplied by −2, the constant would have come out as 1 instead of 13, and this check would give −7 instead of 5.

Why the standard form hands you the maximum or minimum

The vertex is not just a point to plot. The standard form proves which value is the extreme one, using a single fact: a square is never negative.

  • (x−h)2≥0 for every x, and it equals 0 only when x=h.
  • If a>0, then a(x−h)2≥0, so f(x)=a(x−h)2+k≥k. The function never goes below k and reaches it at x=h: k is the minimum.
  • If a<0, then a(x−h)2≤0, so f(x)≤k: k is the maximum, again reached at x=h.

In Example 2, −2(x+2)2 is never positive, so f(x)=−2(x+2)2+13 is never more than 13, and it equals 13 exactly when x=−2. The maximum is 13, at x=−2. No graph and no table of values: the form itself is the argument. That is why a problem asking for a greatest height or a least cost is, underneath, asking you to complete the square.

Doing it once with letters

Run the four moves on ax2+bx+c itself and the vertex comes out as a formula:

ax2+bx+c=a(x+b2a)2+c−b24a

So h=−b2a, and k is simply f(h). That is a fast way to locate the vertex from the general form, and the post on which form of a quadratic function answers what uses it. It is still completing the square underneath, and doing the moves by hand is what stops a misremembered sign.

The most common mistake. Completing the square rewrites the rule; it must never change it. Every number added inside the bracket is subtracted inside the same bracket, and the number that leaves the bracket is multiplied by a on its way out. The trap is to treat the rule like an equation: add the missing number "to make the square work" and never take it back, or take it back without multiplying it by a. Either way the vertex comes out with the right h and the wrong k. The f(0) check catches both in one line.

Check your understanding

No calculator. The first four ask for the standard form; the last three ask you to explain.

  1. Write x2+6x−2 in standard form and give its vertex.
  2. Write x2−5x+1 in standard form. Fractions are allowed.
  3. Write 3x2−24x+50 in standard form. Does the function have a maximum or a minimum, and what is it?
  4. Write −4x2+4x+3 in standard form and give its maximum or minimum.
  5. True or false: g(x)=7−(x−3)2 has a minimum value of 7. Explain.
  6. Sam completes the square on f(x)=2x2+20x+1 and announces that the vertex is (−5,−24). Is he right? If not, what did he most likely forget?
  7. Use a completed square to explain why x2−2x+6 is positive for every real number x.
Show the answers
  1. (x+3)2−11, vertex (−3,−11). Half of 6 is 3 and 32=9, so x2+6x+9−9−2=(x+3)2−11.
  2. (x−52)2−214. Half of −5 is −52, whose square is 254, and 1−254=−214. The vertex is (52,−214).
  3. 3(x−4)2+2, with a minimum of 2 at x=4. Factoring gives 3[(x−4)2−16]+50, and the −16 leaves as −48, so 50−48=2. Since a=3>0, the function never goes below 2.
  4. −4(x−12)2+4, with a maximum of 4 at x=12. Factoring gives −4[(x−12)2−14]+3, and the −14 leaves as +1. Since a=−4<0, 4 is the greatest value.
  5. False. g(x)=−(x−3)2+7 has a=−1<0, so 7 is the maximum, reached at x=3. There is no minimum: the values keep falling as x moves away from 3.
  6. No. 2(x2+10x)+1=2[(x+5)2−25]+1=2(x+5)2−49, so the vertex is (−5,−49). He let the −25 leave the bracket without multiplying it by 2. The f(0) check exposes it: the general form gives 1, while his rule 2(x+5)2−24 gives 2(5)2−24=26 at x=0.
  7. x2−2x+6=(x−1)2+5. A square is never negative, so the expression is at least 5 for every x; it can never reach zero, let alone go below it.

Keep practising

The free Secondary 4 Algebraic Expressions worksheet has a completing-the-square question alongside the factoring it builds on, and the Quadratic Functions worksheet puts the standard form to work on graphs and problems. If your next question is which form to use, read general, standard or factored: which form answers what; if the rule factors, the product-sum method gets you to the zeroes faster.

Want one-on-one help with this? I offer Secondary 4 and 5 math tutoring in Montreal, in person or online. Sessions start with a short written diagnostic, and a written recap goes to whoever books after every session.

Practise completing the square

Ready to improve your grades?

WhatsApp is the way to reach me — tell me the course you're taking and what you're stuck on, and we'll sort out a first session from there.

Message Me on WhatsApp

or send a message

I reply within a day, usually sooner. Your details are used only to answer you — see the Privacy Policy.

Private math & science tutoring in Montreal, QC — Westmount · Outremont · Town of Mount Royal · Hampstead · Côte-Saint-Luc · NDG · Nuns' Island · West Island — and online across Quebec.

Chat with Marius