US Trends

how to complete the square

To complete the square , you rewrite a quadratic into a perfect square form so it’s easy to solve or graph. Here’s a clear, step‑by‑step guide plus an example.

Core idea in one line

You turn something like x2+bx+cx^2+bx+cx2+bx+c into (x+p)2+q(x+p)^2+q(x+p)2+q, where (x+p)2(x+p)^2(x+p)2 is a perfect square and the equation becomes easy to solve.

Standard step‑by‑step method

Use this when you solve a quadratic equation ax2+bx+c=0ax^2+bx+c=0ax2+bx+c=0.

1. Get the x2x^2x2 term alone with coefficient 1

  • Move the constant to the other side:
    • ax2+bx+c=0⇒ax2+bx=−cax^2+bx+c=0\Rightarrow ax^2+bx=-cax2+bx+c=0⇒ax2+bx=−c.
  • If a≠1a\neq 1a=1, divide the whole equation by aaa:
    • x2+bax=−cax^2+\frac{b}{a}x=-\frac{c}{a}x2+ab​x=−ac​.

Now the left side starts with x2x^2x2.

2. Take half of the x‑coefficient and square it

  • Look at the coefficient of xxx, which is ba\frac{b}{a}ab​.
  • Take half: 12⋅ba=b2a\dfrac{1}{2}\cdot \dfrac{b}{a}=\dfrac{b}{2a}21​⋅ab​=2ab​.
  • Square it: (b2a)2=b24a2\left(\dfrac{b}{2a}\right)^2=\dfrac{b^2}{4a^2}(2ab​)2=4a2b2​.

This is the magic number that will complete the square.

3. Add that square to both sides

  • Add (b2a)2\left(\dfrac{b}{2a}\right)^2(2ab​)2 to both sides:
    • x2+bax+(b2a)2=−ca+(b2a)2x^2+\frac{b}{a}x+\left(\dfrac{b}{2a}\right)^2=-\dfrac{c}{a}+\left(\dfrac{b}{2a}\right)^2x2+ab​x+(2ab​)2=−ac​+(2ab​)2.

The left side is now a perfect square trinomial.

4. Rewrite the left side as a binomial square

Use the identity (x+p)2=x2+2px+p2(x+p)^2=x^2+2px+p^2(x+p)2=x2+2px+p2.

  • Here p=b2ap=\dfrac{b}{2a}p=2ab​.
  • So the left side becomes:
    • (x+b2a)2\left(x+\dfrac{b}{2a}\right)^2(x+2ab​)2.

Now you have:

(x+b2a)2=−ca+b24a2.\left(x+\dfrac{b}{2a}\right)^2=-\dfrac{c}{a}+\dfrac{b^2}{4a^2}.(x+2ab​)2=−ac​+4a2b2​.

You can simplify the right side into a single fraction if you want.

5. Take square roots and solve for x

  • Take square roots of both sides:
    • x+b2a=±(right side)x+\dfrac{b}{2a}=\pm \sqrt{\text{(right side)}}x+2ab​=±(right side)​.
  • Then isolate xxx:
    • x=−b2a±(right side)x=-\dfrac{b}{2a}\pm \sqrt{\text{(right side)}}x=−2ab​±(right side)​.

If you simplify that square root fraction, you actually recover the quadratic formula.

Concrete example

Let’s solve x2+6x+5=0x^2+6x+5=0x2+6x+5=0 by completing the square.

  1. Move the constant:
    • x2+6x=−5x^2+6x=-5x2+6x=−5.
  2. Half the x‑coefficient and square:
    • Half of 6 is 3, and 32=93^2=932=9.
  3. Add 9 to both sides:
    • x2+6x+9=−5+9x^2+6x+9=-5+9x2+6x+9=−5+9.
    • x2+6x+9=4x^2+6x+9=4x2+6x+9=4.
  4. Rewrite left as a square:
    • x2+6x+9=(x+3)2x^2+6x+9=(x+3)^2x2+6x+9=(x+3)2.
    • So (x+3)2=4(x+3)^2=4(x+3)2=4.
  5. Take square roots:
    • x+3=±2x+3=\pm 2x+3=±2.
    • If x+3=2x+3=2x+3=2, then x=−1x=-1x=−1.
    • If x+3=−2x+3=-2x+3=−2, then x=−5x=-5x=−5.

So the solutions are x=−1x=-1x=−1 and x=−5x=-5x=−5.

Completing the square just for rewriting

Sometimes you don’t have “= 0”; you just want to rewrite a quadratic, for example to get vertex form:

ax2+bx+c=a(x−h)2+k.ax^2+bx+c=a(x-h)^2+k.ax2+bx+c=a(x−h)2+k.

For x2+4x+1x^2+4x+1x2+4x+1:

  1. Focus on x2+4xx^2+4xx2+4x.
  2. Half of 4 is 2, 22=42^2=422=4.
  3. Add and subtract 4 inside:
    • x2+4x+1=(x2+4x+4)−4+1x^2+4x+1=(x^2+4x+4)-4+1x2+4x+1=(x2+4x+4)−4+1.
    • =(x+2)2−3=(x+2)^2-3=(x+2)2−3.

So x2+4x+1=(x+2)2−3x^2+4x+1=(x+2)^2-3x2+4x+1=(x+2)2−3, which is vertex form.

Tiny “story” to remember it

Think of your quadratic as a nearly complete square garden : x2+bxx^2+bxx2+bx is like two sides of the fence built, but one corner is missing.
Completing the square means:

  1. Measure the open gap (the bbb term),
  2. Cut that gap in half,
  3. Build a little square patch ((b2)2(\frac{b}{2})^2(2b​)2) to fill the missing corner,
  4. Whatever you added to one side of the equation, you balance on the other side.

Do that every time and the method becomes automatic.

Super‑short checklist

When you see ax2+bx+c=0ax^2+bx+c=0ax2+bx+c=0:

  1. Make coefficient of x2x^2x2 equal to 1 (divide if needed).
  2. Move constant term to the right side.
  3. Add (b2a)2\left(\frac{b}{2a}\right)^2(2ab​)2 to both sides.
  4. Rewrite left side as (x+b2a)2(x+\frac{b}{2a})^2(x+2ab​)2.
  5. Take square roots and solve for xxx.

TL;DR: To complete the square, get x2x^2x2 coefficient to 1, move the constant, add the square of half the x‑coefficient to both sides, rewrite as a binomial square, then take square roots and solve.