Algebra 1 · Algebra 2 · Grades 9, 10

Completing the Square, Step by Step

Quick answer

Completing the square rewrites a quadratic as a perfect square plus a constant. Take half the coefficient of x, square it, and add that number to both sides. For x squared plus 6x = 7, half of 6 is 3 and 3 squared is 9, so add 9 to both sides to get (x + 3) squared = 16, giving x = 1 or x = -7.

What you'll learn

  • Complete the square to solve a quadratic equation
  • Explain geometrically why the method is called completing the square
  • Rewrite a quadratic in vertex form to find its maximum or minimum

What completing the square does

Completing the square rewrites a quadratic so the variable appears only once, inside a squared bracket:

x2+6x7=0(x+3)2=16x^2 + 6x - 7 = 0 \quad\longrightarrow\quad (x + 3)^2 = 16

That matters because once the variable appears once, you can undo the square directly and solve. It is the same “isolate the variable” goal you have had since one-step equations, and this is the detour that gets you there.

Why it is called completing the square

The name is literal. Drawing the picture shows you where the algebra comes from.

Think of x2+6xx^2 + 6x as area. Draw a square with side xx — area x2x^2. Attach the 6x6x as two rectangles of width 33 along two adjacent sides, each of area 3x3x.

You now have an L-shape. It is almost a bigger square with side x+3x + 3, but the corner is missing. That corner is a 3×33 \times 3 square, area 99.

x2+6xthe L-shape+9missing corner=(x+3)2complete square\underbrace{x^2 + 6x}_{\text{the L-shape}} + \underbrace{9}_{\text{missing corner}} = \underbrace{(x+3)^2}_{\text{complete square}}

Adding 99 completes the square. The half-of-bb rule comes straight from the width of those rectangles: you split 6x6x into two strips of 3x3x, so the corner is 32=93^2 = 9.

The payoff is visible on the graph. Writing x2+6xx^2 + 6x as (x+3)29(x+3)^2 - 9 says the plain parabola y=x2y = x^2 has been slid 33 left and 99 down, and the completed form is the only one that says so at a glance:

y = x^2 and y = (x+3)^2 - 9 Two upward parabolas of identical shape. The first has its lowest point at the origin. The second is the same curve moved three units left and nine units down, with its lowest point at (-3, -9). -8-6-4-224-10-55xy (0, 0) (-3, -9)
  • y = x^2
  • y = (x+3)^2 - 9
y = x^2 and y = (x+3)^2 - 9

The two numbers you built — the 33 inside the bracket and the 99 outside — are the coordinates of the lowest point, with the sign of the first reversed. That is why this form is worth the extra work even when factoring would also have solved the equation.

The algebra behind the rule

(x+k)2=x2+2kx+k2(x + k)^2 = x^2 + 2kx + k^2

Compare the middle term with bxbx: you need 2k=b2k = b, so k=b2k = \tfrac{b}{2}. The constant you must add is k2=(b2)2k^2 = \left(\tfrac{b}{2}\right)^2.

Take half of the coefficient of xx, square it, and add it to both sides.

How to complete the square

  1. Move the constant to the right side.
  2. If the leading coefficient is not 11, divide every term by it.
  3. Take half the coefficient of xx, square it, add to both sides.
  4. Factor the left side as a perfect square.
  5. Take the square root of both sides — remember ±\pm.
  6. Solve for xx.

Worked examples

Common mistakes

Where the quadratic formula comes from

Completing the square on the general equation ax2+bx+c=0ax^2 + bx + c = 0 produces the quadratic formula — the same five steps, done once with letters instead of numbers:

x=b±b24ac2ax = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}

That is the payoff. Do this once symbolically and you never have to do it again numerically.

Practice problems

  1. What number completes the square for x2+10xx^2 + 10x?

    Hint

    Half the coefficient of xx, then square it.

    Answer

    2525

    Full solution

    Half of 1010 is 55, and 52=255^2 = 25. So x2+10x+25=(x+5)2x^2 + 10x + 25 = (x+5)^2.

  2. Solve x2+4x12=0x^2 + 4x - 12 = 0 by completing the square.

    Answer

    x=2x = 2 or x=6x = -6

    Full solution

    x2+4x=12x^2 + 4x = 12. Half of 44 is 22, 22=42^2 = 4.

    x2+4x+4=16x^2 + 4x + 4 = 16, so (x+2)2=16(x + 2)^2 = 16 and x+2=±4x + 2 = \pm 4.

    x=2x = 2 or x=6x = -6. Check: 4+812=04 + 8 - 12 = 0

  3. Solve x26x+2=0x^2 - 6x + 2 = 0.

    Answer

    x=3±7x = 3 \pm \sqrt{7}

    Full solution

    x26x=2x^2 - 6x = -2. Half of 6-6 is 3-3, (3)2=9(-3)^2 = 9.

    x26x+9=7x^2 - 6x + 9 = 7, so (x3)2=7(x - 3)^2 = 7 and x3=±7x - 3 = \pm\sqrt{7}.

    x=3±7x = 3 \pm \sqrt{7}.

  4. Solve x2+3x1=0x^2 + 3x - 1 = 0.

    Hint

    Half of 33 is 32\tfrac{3}{2}. Expect fractions.

    Answer

    x=3±132x = \tfrac{-3 \pm \sqrt{13}}{2}

    Full solution

    x2+3x=1x^2 + 3x = 1. Add 94\tfrac{9}{4} to both sides: (x+32)2=134\left(x + \tfrac{3}{2}\right)^2 = \tfrac{13}{4}.

    x+32=±132x + \tfrac{3}{2} = \pm\tfrac{\sqrt{13}}{2}, so x=3±132x = \tfrac{-3 \pm \sqrt{13}}{2}.

  5. Solve 3x212x+9=03x^2 - 12x + 9 = 0.

    Hint

    Divide through by 33 before completing the square.

    Answer

    x=3x = 3 or x=1x = 1

    Full solution

    Divide by 33: x24x+3=0x^2 - 4x + 3 = 0, so x24x=3x^2 - 4x = -3.

    Half of 4-4 is 2-2, (2)2=4(-2)^2 = 4: (x2)2=1(x-2)^2 = 1, so x2=±1x - 2 = \pm 1.

    x=3x = 3 or x=1x = 1. Check: 3(9)12(3)+9=03(9) - 12(3) + 9 = 0

  6. Write y=x2+2x5y = x^2 + 2x - 5 in vertex form.

    Answer

    y=(x+1)26y = (x + 1)^2 - 6

    Full solution

    Half of 22 is 11, 12=11^2 = 1. Add and subtract 11:

    y=(x2+2x+1)15=(x+1)26y = (x^2 + 2x + 1) - 1 - 5 = (x + 1)^2 - 6. Vertex (1,6)(-1, -6).

  7. What is the minimum value of y=x210x+30y = x^2 - 10x + 30, and where does it occur?

    Answer

    Minimum 55 at x=5x = 5

    Full solution

    Half of 10-10 is 5-5, (5)2=25(-5)^2 = 25.

    y=(x210x+25)25+30=(x5)2+5y = (x^2 - 10x + 25) - 25 + 30 = (x - 5)^2 + 5.

    Since (x5)20(x-5)^2 \ge 0, the minimum is 55, at x=5x = 5.

  8. Solve x2+2x+5=0x^2 + 2x + 5 = 0 by completing the square. What happens?

    Hint

    Complete the square as usual and look at the right-hand side.

    Answer

    No real solutions

    Full solution

    x2+2x=5x^2 + 2x = -5. Add 11: (x+1)2=4(x + 1)^2 = -4.

    A real number squared is never negative, so there are no real solutions. The parabola sits entirely above the xx-axis.

Frequently asked questions

Why do you take half of b and then square it?

Expanding (x + k) squared gives x squared plus 2kx plus k squared. Matching the middle term 2kx to bx means k is half of b, and the constant you need is k squared. So halving b and squaring is not a trick — it is reading off the value of k that makes the trinomial a perfect square.

When should I complete the square instead of using the quadratic formula?

Use the quadratic formula when you only need the roots. Complete the square when you need vertex form, when you are finding a maximum or minimum, or when deriving a result. The quadratic formula is itself completing the square done once in general.

What do I do if the coefficient of x squared is not one?

Divide every term by it first, or factor it out of the x terms. Completing the square relies on the leading coefficient being one, so this step comes before anything else.

What is vertex form and why does it matter?

Vertex form is y = a(x − h)² + k, and completing the square is how you get there. The pair (h, k) is the lowest or highest point of the parabola, read straight off the equation with no further work.

What if half of b is a fraction?

Nothing changes; you carry the fraction through. For x² + 5x, half of 5 is five halves, and squaring it gives twenty-five quarters. Awkward numbers are a reason to be careful, not a sign of a wrong turn.

What to learn next

Formulas on this page

Key terms in this lesson

Constant
A constant is a term with a fixed value and no variable attached. In 3x + 7, the constant is 7, because it stays the same whatever x turns out to be.
Perfect square
A perfect square is a whole number that some whole number squares to, such as 1, 4, 9, 16, 25 and 36. Their square roots are exact whole numbers, which is what makes them worth recognising on sight.
Quadratic equation
A quadratic equation is one that can be written as ax squared plus bx plus c = 0, with a not equal to zero. The squared term is what makes it quadratic rather than linear.

Standards alignment

This lesson covers the following Common Core State Standards for Mathematics.

  • CCSS.MATH.CONTENT.HSA.REI.B.4aReasoning with Equations and InequalitiesUse the method of completing the square to transform any quadratic equation in x into an equation of the form (x - p)² = q that has the same solutions. Derive the quadratic formula from this form.