30% off your first 3 months

Get the deal

Completing the square

Completing the square turns x2+bxx^2 + bx into a perfect square: add (b2)2(\frac{b}{2})^2 and it becomes (x+b2)2(x + \frac{b}{2})^2.

Guide 2 of 8
An area model: a square split into four parts, x and 3 along the top and the side. The parts are x squared, 3x, 3x and, shaded in the corner, 9. The 9 is the piece that completes the square.
x² + 6x + 9 = (x + 3)². The 9 in the corner completes the square.

Why it works. (x+3)2(x + 3)^2 multiplies out to x2+6x+9x^2 + 6x + 9: the middle term is twice 3, and the last term is 3 squared. So halving the middle number and squaring it gives exactly the piece that makes a perfect square, and a square is undone by a square root.


Move it yourself

Change b and watch the corner piece that completes the square: always half of b, squared.

An area model: a square split into four parts, x and 3 along the top and the side. The parts are x squared, 3x, 3x and, shaded in the corner, 9. The 9 is the piece that completes the square.

Your turn

Solve x2−8x+7=0x^2 - 8x + 7 = 0 by completing the square.

Or just show the answer

x=7x = 7 or x=1x = 1

Move the 7: x2−8x=−7x^2 - 8x = -7. Half of −8-8 is −4-4, and (−4)2=16(-4)^2 = 16, so x2−8x+16=9x^2 - 8x + 16 = 9, which is (x−4)2=9(x - 4)^2 = 9. Then x−4=3x - 4 = 3 or x−4=−3x - 4 = -3, so x=7x = 7 or x=1x = 1.


Watch out for

  • Mistake 1. Struck through: x^2 + 6x + 9 = 7; written over it: x^2 + 6x + 9 = 16.

    Adding the 9 to the left side only: x2+6x+9=7x^2 + 6x + 9 = 7.

    Add it to both sides: x2+6x+9=16x^2 + 6x + 9 = 16.

  • Mistake 2. Struck through: + 6^2 = + 36; written over it: + 3^2 = + 9.

    Adding 62=366^2 = 36 instead of (62)2(\frac{6}{2})^2.

    Halve first, then square: 32=93^2 = 9.

  • Mistake 3. Struck through: x + 3 = 4 → x = 1; written over it: x = 1 or x = −7.

    Keeping only the positive root: x+3=4x + 3 = 4, so only x=1x = 1.

    x+3=4x + 3 = 4 or x+3=−4x + 3 = -4: two answers, 1 and −7-7.


Stuck on your own homework?

Open DuckyHelper and say it out loud. It sees your screen, so it works through your own problem with you and draws it, like the board above.

“Show me with a picture why I add half of b, squared.”

Plus is $14 a month for your first 3 months. DuckyHelper is an app for Mac (Apple silicon, macOS 14 or later), Windows and Linux.


Read the whole guide as text

Completing the square turns x2+bxx^2 + bx into a perfect square: add (b2)2(\frac{b}{2})^2 and it becomes (x+b2)2(x + \frac{b}{2})^2. In an equation, add that number to both sides, take the square root, and remember both signs. It solves quadratics that do not factor, and it is how you find a parabola's vertex form.

Worked example

Solve x2+6x−7=0x^2 + 6x - 7 = 0 by completing the square.

  1. Move the number to the other side.
    x2+6x=7x^2 + 6x = 7
  2. Half of 6 is 3, and 32=93^2 = 9. Add 9 to both sides.
    x2+6x+9=16x^2 + 6x + 9 = 16
  3. The left side is now a perfect square.
    (x+3)2=16(x + 3)^2 = 16
  4. Take the square root of both sides, keeping both signs.
    x+3=4orx+3=−4x + 3 = 4 \quad\text{or}\quad x + 3 = -4
  5. Take 3 from both sides.
    x=1orx=−7x = 1 \quad\text{or}\quad x = -7

Answer: x=1x = 1 or x=−7x = -7

Algebra 2: all 8 guides
Questions and jobs

Do anything

Ask it a question or hand it a job, in any app.

Doing jobs for you is in the Mac app. Asking works on Mac, Windows and Linux.