Algebra guide · 6 min read

How to Complete the Square (Step by Step)

Completing the square turns a quadratic like x^2 + 6x + 5 into a perfect square plus a constant, (x + 3)^2 - 4. It solves any quadratic equation, puts parabolas into vertex form, and is where the quadratic formula comes from. This guide walks through every case with fully worked examples.

The Core Rule: Half of b, Squared

A perfect square trinomial has this pattern:

x2+bx+(b2)2=(x+b2)2x^2 + bx + \left(\frac{b}{2}\right)^2 = \left(x + \frac{b}{2}\right)^2

So to complete the square on x2+bxx^2 + bx, take half of bb and square it, then add that number.

Example: Complete the square on x2+6xx^2 + 6x.

  1. Half of 6 is 3.
  2. Square it: 32=93^2 = 9.
  3. Add it: x2+6x+9=(x+3)2x^2 + 6x + 9 = (x + 3)^2.

Example: Complete the square on x2−10xx^2 - 10x.

  1. Half of −10-10 is −5-5, and (−5)2=25(-5)^2 = 25.
  2. x2−10x+25=(x−5)2x^2 - 10x + 25 = (x - 5)^2.

The number inside the parentheses is always half of bb, with the same sign as bb.

Solving an Equation When a = 1

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

  1. Move the constant to the right: 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. Write the left side as a square: (x+3)2=16(x + 3)^2 = 16.
  4. Take the square root of both sides, with ±\pm: x+3=±4x + 3 = \pm 4.
  5. Solve each case: x=−3+4=1x = -3 + 4 = 1 or x=−3−4=−7x = -3 - 4 = -7.

Check: 1+6−7=01 + 6 - 7 = 0 and 49−42−7=049 - 42 - 7 = 0. Both work.

When b Is Odd

An odd bb just means you work with fractions. Do not round.

Example: Solve x2+5x−2=0x^2 + 5x - 2 = 0.

  1. Move the constant: x2+5x=2x^2 + 5x = 2.
  2. Half of 5 is 52\frac{5}{2}. Square it: 254\frac{25}{4}.
  3. Add to both sides: x2+5x+254=2+254=84+254=334x^2 + 5x + \frac{25}{4} = 2 + \frac{25}{4} = \frac{8}{4} + \frac{25}{4} = \frac{33}{4}.
  4. Factor the left side: (x+52)2=334\left(x + \frac{5}{2}\right)^2 = \frac{33}{4}.
  5. Square root both sides: x+52=±332x + \frac{5}{2} = \pm\frac{\sqrt{33}}{2}.
  6. Solve: x=−5±332x = \frac{-5 \pm \sqrt{33}}{2}.

When a Is Not 1

The rule only works when the coefficient of x2x^2 is 1. If it is not, divide every term by aa first.

Example: Solve 2x2+8x−3=02x^2 + 8x - 3 = 0.

  1. Divide every term by 2: x2+4x−32=0x^2 + 4x - \frac{3}{2} = 0.
  2. Move the constant: x2+4x=32x^2 + 4x = \frac{3}{2}.
  3. Half of 4 is 2, and 22=42^2 = 4. Add 4 to both sides: x2+4x+4=32+4=112x^2 + 4x + 4 = \frac{3}{2} + 4 = \frac{11}{2}.
  4. Factor: (x+2)2=112(x + 2)^2 = \frac{11}{2}.
  5. Square root: x+2=±112=±222x + 2 = \pm\sqrt{\frac{11}{2}} = \pm\frac{\sqrt{22}}{2}.
  6. Solve: x=−2±222x = -2 \pm \frac{\sqrt{22}}{2}.

To simplify 112\sqrt{\frac{11}{2}}, multiply the top and bottom by 2 inside the root: 224=222\sqrt{\frac{22}{4}} = \frac{\sqrt{22}}{2}.

Converting to Vertex Form

Vertex form is y=a(x−h)2+ky = a(x - h)^2 + k, where the vertex is (h,k)(h, k). Completing the square gets you there. Since this is an expression (not an equation), you add and subtract the same number instead of adding to both sides.

Example 1: Write y=x2−4x+7y = x^2 - 4x + 7 in vertex form.

  1. Half of −4-4 is −2-2, and (−2)2=4(-2)^2 = 4.
  2. Add and subtract 4: y=(x2−4x+4)−4+7y = (x^2 - 4x + 4) - 4 + 7.
  3. Factor: y=(x−2)2+3y = (x - 2)^2 + 3.
  4. The vertex is (2,3)(2, 3).

Example 2: Write y=3x2+12x+5y = 3x^2 + 12x + 5 in vertex form.

  1. Factor 3 out of the xx terms only: y=3(x2+4x)+5y = 3(x^2 + 4x) + 5.
  2. Inside, half of 4 is 2, and 22=42^2 = 4. Add and subtract 4 inside: y=3(x2+4x+4−4)+5y = 3(x^2 + 4x + 4 - 4) + 5.
  3. Move the −4-4 outside. It gets multiplied by 3 on the way out: y=3(x2+4x+4)−12+5y = 3(x^2 + 4x + 4) - 12 + 5.
  4. Simplify: y=3(x+2)2−7y = 3(x + 2)^2 - 7.
  5. The vertex is (−2,−7)(-2, -7). Check: 3(4)+12(−2)+5=12−24+5=−73(4) + 12(-2) + 5 = 12 - 24 + 5 = -7.

No Real Solutions, and the Quadratic Formula

If completing the square leaves a negative number on the right, there are no real solutions.

Example: Solve x2+2x+5=0x^2 + 2x + 5 = 0.

  1. x2+2x=−5x^2 + 2x = -5.
  2. Add 1: (x+1)2=−4(x + 1)^2 = -4.
  3. No real number squared is negative, so there are no real solutions. With complex numbers, x=−1±2ix = -1 \pm 2i.

Where the quadratic formula comes from. Complete the square on ax2+bx+c=0ax^2 + bx + c = 0:

  1. Divide by aa and move the constant: x2+bax=−cax^2 + \frac{b}{a}x = -\frac{c}{a}.
  2. Add (b2a)2=b24a2\left(\frac{b}{2a}\right)^2 = \frac{b^2}{4a^2} to both sides: (x+b2a)2=b2−4ac4a2\left(x + \frac{b}{2a}\right)^2 = \frac{b^2 - 4ac}{4a^2}.
  3. Square root and solve:
x=−b±b2−4ac2ax = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}

Paste a quadratic into the VeilGPT solver to check your steps.

Common mistakes

  • Adding (b/2)^2 to only one side of an equation, which changes the equation.
  • Completing the square before dividing by a, when the rule only works if the x^2 coefficient is 1.
  • Forgetting the plus or minus when taking the square root, which loses one of the two solutions.
  • Reading the vertex of y = (x + 2)^2 - 7 as (2, -7). The vertex x value has the opposite sign, so it is (-2, -7).

Try one yourself

Solve by completing the square: x^2 - 8x + 3 = 0

Work it out, then check every step with the VeilGPT algebra solver.

Check it with VeilGPT

Questions about this topic

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

Complete the square when you need vertex form, when b is even and a is 1, or when a problem asks for it. The quadratic formula is usually faster for messy coefficients.

Why is it called completing the square?

Picture x^2 + 6x as an x by x square plus two 3 by x rectangles. Arranged in an L shape, they are missing a 3 by 3 corner, and adding 9 completes the square.

Does completing the square work on every quadratic?

Yes. It works for any quadratic, even ones that do not factor, which is why it can be used to derive the quadratic formula.

More study guides