Algebra 1Quadratic Functions and EquationsA-REI.B.4a

Completing the Square

Add (b/2)² to make a perfect square, then solve or find the vertex.

Not started Jump to practice

What if a quadratic does not factor nicely, like $x^2 + 6x - 7 = 0$? We can rewrite it so the $x$ terms form a perfect square, then take square roots. The trick reverses the square of a sum, and it also produces vertex form.

Why it works

Picture $x^2 + 6x$ as area: an $x$-by-$x$ square and a strip $x$ by $6$. Cut the strip in half lengthwise and put one half on the right of the square and one below it. Now you almost have a bigger square, side $x + 3$, but the corner is missing: a $3$-by-$3$ square of area $9$. Adding $9$ completes it: $x^2 + 6x + 9 = (x + 3)^2$. The missing corner is always $\left(\frac{b}{2}\right)^2$, half the $x$ coefficient, squared.
Step through it: split the $6x$ strip, move the halves, and fill the corner with $9$. In an equation, the $9$ must be added to both sides.

Key idea

To solve $x^2 + bx + c = 0$: move $c$ to the right, add $\left(\frac{b}{2}\right)^2$ to both sides, write the left side as $\left(x + \frac{b}{2}\right)^2$, and take square roots. If $a \ne 1$, divide every term by $a$ first.

Worked examples

Worked example: Solve by completing the square

Solve $x^2 + 6x - 7 = 0$.
  1. Move the constant: $x^2 + 6x = 7$.
  2. Half of $6$ is $3$, and $3^2 = 9$. Add $9$ to both sides: $x^2 + 6x + 9 = 16$.
  3. The left side is a perfect square: $(x + 3)^2 = 16$.
  4. $x + 3 = \pm 4$, so $x = 1$ or $x = -7$.

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

Worked example: Irrational answers, and a leading coefficient

Solve $2x^2 - 8x - 2 = 0$.
  1. Divide every term by $2$: $x^2 - 4x - 1 = 0$.
  2. Move the constant: $x^2 - 4x = 1$. Half of $-4$ is $-2$, squared is $4$: $x^2 - 4x + 4 = 5$.
  3. $(x - 2)^2 = 5$, so $x = 2 \pm \sqrt{5}$.

Answer: $x = 2 \pm \sqrt{5}$

Worked example: Vertex form

Write $y = x^2 + 10x + 21$ in vertex form.
  1. Half of $10$ is $5$; $5^2 = 25$. Add and subtract $25$: $y = (x^2 + 10x + 25) + 21 - 25$.
  2. $y = (x + 5)^2 - 4$, so the vertex is $(-5, -4)$.

Answer: $y = (x + 5)^2 - 4$

Common mistake

Adding $\left(\frac{b}{2}\right)^2$ to one side only, or forgetting to divide by $a$ first. Adding $9$ to the left of $x^2 + 6x = 7$ without adding it on the right breaks the balance and gives wrong answers. And in $2x^2 - 8x = 2$, the square to complete is for $x^2 - 4x$, after dividing by $2$. Check your solutions in the original equation.

Practice

Pass with 3 right answers, the last 2 in a row. Each right answer earns 3 XP.

Loading practice…

Builds on

Leads to

Sources and further reading

  • OpenStax, Elementary Algebra 2e, section 10.2 Solve Quadratic Equations by Completing the Square
  • Common Core State Standards for Mathematics, A-REI.B.4a: use completing the square to transform a quadratic into the form (x − p)² = q
@teddyrookbook GitHub