Solving Quadratic Equations

2.2 — Completing the Square

The Problem with Factoring

In the last section, we solved quadratics by factoring — finding two numbers with the right product and sum, then using the zero-product property. It was fast and satisfying when it worked.

But we also hit a wall. The equation $x^2 + 3x + 1 = 0$ couldn't be factored with integers, and we left it unsolved. That equation has perfectly good solutions — they just aren't "nice" numbers.

We need a method that works for every quadratic, not just the ones with integer roots. And surprisingly, the key idea comes from geometry.

A Square with a Piece Missing

Here's a puzzle. Look at this expression:

$$x^2 + 6x$$

Can you think of this as the area of something?

Try this before reading on. Imagine $x^2$ as a square with side length $x$. And $6x$ as a rectangle with sides $x$ and $6$. Can you arrange these shapes into something close to a larger square?

The geometric picture Start with a square of side $x$ (area $x^2$). Now take the rectangle $6x$ and split it into two equal strips, each $x \times 3$. Attach one strip to the right side of the square and the other to the bottom. You almost have a bigger square — one with side length $x + 3$. But there's a gap: a small $3 \times 3$ square in the corner. Its area is $9$. If you filled in that gap, you'd have a perfect $(x + 3) \times (x + 3)$ square with total area $(x + 3)^2$.

This is the core idea of completing the square: we take an expression like $x^2 + 6x$, figure out what's missing to make it a perfect square, and add that piece in.

Since $(x + 3)^2 = x^2 + 6x + 9$, the "missing piece" is $9$. We can write:

$$x^2 + 6x = (x + 3)^2 - 9$$

We've rewritten a messy expression as a perfect square minus a constant. And that form is something we can solve.

Why Perfect Squares Are Easy to Solve

Here's the payoff. Suppose we need to solve:

$$(x + 3)^2 = 9$$

This says: "something squared equals $9$." What could that something be? Either $3$ or $-3$. So:

$$x + 3 = 3 \quad \text{or} \quad x + 3 = -3$$

$$x = 0 \quad \text{or} \quad x = -6$$

No hunting for factor pairs. No guessing. Once the equation is in the form $(x + k)^2 = d$, you take the square root of both sides and solve two simple linear equations.

The key insight: Completing the square transforms a quadratic equation into one that's solvable by taking a square root. It trades algebraic complexity for geometric clarity.

The Method, Step by Step

Let's solve $x^2 + 6x - 7 = 0$ from start to finish.

Step 1: Isolate the $x$ terms.

Move the constant to the other side:

$$x^2 + 6x = 7$$

Step 2: Find the missing piece.

Take the coefficient of $x$ (which is $6$), halve it (get $3$), and square it (get $9$). This is the area of that missing corner square.

Step 3: Add it to both sides.

$$x^2 + 6x + 9 = 7 + 9$$

$$(x + 3)^2 = 16$$

Step 4: Take the square root.

$$x + 3 = \pm 4$$

Step 5: Solve.

$$x = -3 + 4 = 1 \quad \text{or} \quad x = -3 - 4 = -7$$

Verify it yourself. Plug $x = 1$ into $x^2 + 6x - 7$: you get $1 + 6 - 7 = 0$. Plug in $x = -7$: you get $49 - 42 - 7 = 0$. Both check out.

MathBox Visualization

Loading visualization...
Cell visualization output

MathBox Visualization

Loading visualization...

Check your understanding

Solve by completing the square: $x^2 - 4x - 5 = 0$

Start by moving the constant, then find the missing piece. What number do you halve and square?

Check your answer Move the constant: $x^2 - 4x = 5$. The coefficient of $x$ is $-4$. Half of $-4$ is $-2$. And $(-2)^2 = 4$. Add $4$ to both sides: $$x^2 - 4x + 4 = 9$$ $$(x - 2)^2 = 9$$ $$x - 2 = \pm 3$$ $$x = 5 \quad \text{or} \quad x = -1$$ Verify: $5^2 - 4(5) - 5 = 25 - 20 - 5 = 0$. $(-1)^2 - 4(-1) - 5 = 1 + 4 - 5 = 0$. Both work.

Why "Half and Square"?

The recipe — halve the coefficient of $x$, then square it — might feel like a magic trick. But it's not arbitrary. It comes directly from the geometry.

When you split the $bx$ rectangle into two equal strips, each strip has width $\frac{b}{2}$. The missing corner square has side length $\frac{b}{2}$, so its area is $\left(\frac{b}{2}\right)^2$.

In general:

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

This identity is the engine behind the entire method. Every step of "completing the square" is just applying this one fact.

Connection to Section 2.1: Notice that perfect square trinomials — the pattern $(x - k)^2 = x^2 - 2kx + k^2$ — are exactly what we're building here. In Section 2.1 we recognized them; now we're creating them on purpose.

What If $a \neq 1$?

So far, the leading coefficient has always been $1$. What about an equation like $2x^2 + 12x + 7 = 0$?

The method still works — you just need one extra step at the beginning: divide everything by $a$.

$$x^2 + 6x + \frac{7}{2} = 0$$

Now proceed as before:

$$x^2 + 6x = -\frac{7}{2}$$

Half of $6$ is $3$. Square it: $9$. Add to both sides:

$$x^2 + 6x + 9 = -\frac{7}{2} + 9 = \frac{11}{2}$$

$$(x + 3)^2 = \frac{11}{2}$$

$$x + 3 = \pm\sqrt{\frac{11}{2}}$$

$$x = -3 \pm \sqrt{\frac{11}{2}}$$

The arithmetic gets messier, but the logic is identical. The roots aren't integers — and that's fine. This is exactly the kind of equation that factoring couldn't handle.

Completing the Square Reveals Vertex Form

There's a deeper reason completing the square matters, beyond just solving equations. It transforms the standard form of a quadratic into something more revealing.

Start with any quadratic $y = x^2 + bx + c$ and complete the square:

$$y = x^2 + bx + c = \left(x + \frac{b}{2}\right)^2 - \frac{b^2}{4} + c$$

This is vertex form: $y = (x - h)^2 + k$, where $h = -\frac{b}{2}$ and $k = c - \frac{b^2}{4}$.

Why is this useful? Because you can read the vertex directly from the equation:

  • The parabola's vertex (its lowest or highest point) is at $(h, k)$.
  • The axis of symmetry is the vertical line $x = h$.

Example: Take $y = x^2 - 8x + 12$. Completing the square:

$$y = (x^2 - 8x + 16) - 16 + 12 = (x - 4)^2 - 4$$

The vertex is at $(4, -4)$, and the axis of symmetry is $x = 4$. Without completing the square, this information is hidden inside the coefficients.

This is a recurring theme in mathematics: the same technique that solves a problem also reveals the structure behind it.

Reflection

Let's name what happened here.

Factoring works backward from a product. Completing the square works differently — it reshapes the equation into a form where the answer is visible. Instead of finding factors, you build a perfect square and let the square root do the work.

The method rests on one geometric idea: $x^2 + bx$ is almost a perfect square, and it takes exactly $\left(\frac{b}{2}\right)^2$ to complete it. That's the whole method in one sentence.

What changed: In Section 2.1, we could only solve quadratics with "nice" roots. Now we can solve any quadratic — the roots might involve square roots, but the method always works. We've gone from a tool that's fast but limited to one that's universal.

Practice

Problem 1 — Concrete. Solve by completing the square:

(a) $x^2 + 10x + 21 = 0$

(b) $x^2 - 2x - 8 = 0$

(c) $x^2 + 4x + 1 = 0$

Solutions (a) $x^2 + 10x = -21$. Half of $10$ is $5$, and $5^2 = 25$. Add to both sides: $$(x + 5)^2 = 4 \implies x + 5 = \pm 2 \implies x = -3 \text{ or } x = -7$$ (b) $x^2 - 2x = 8$. Half of $-2$ is $-1$, and $(-1)^2 = 1$. Add to both sides: $$(x - 1)^2 = 9 \implies x - 1 = \pm 3 \implies x = 4 \text{ or } x = -2$$ (c) $x^2 + 4x = -1$. Half of $4$ is $2$, and $2^2 = 4$. Add to both sides: $$(x + 2)^2 = 3 \implies x + 2 = \pm\sqrt{3} \implies x = -2 + \sqrt{3} \text{ or } x = -2 - \sqrt{3}$$ Note: part (c) can't be solved by factoring — the roots are irrational. Completing the square handles it without breaking a sweat.

Problem 2 — Vertex form. Rewrite each quadratic in vertex form $(x - h)^2 + k$ and identify the vertex:

(a) $y = x^2 + 6x + 5$

(b) $y = x^2 - 4x + 7$

Solutions (a) $y = (x^2 + 6x + 9) - 9 + 5 = (x + 3)^2 - 4$. Vertex: $(-3, -4)$. (b) $y = (x^2 - 4x + 4) - 4 + 7 = (x - 2)^2 + 3$. Vertex: $(2, 3)$.

Problem 3 — Debug. A student solves $x^2 + 8x + 3 = 0$ like this:

"Half of $8$ is $4$. Add $4$ to both sides: $x^2 + 8x + 4 = 3 + 4$. So $(x + 4)^2 = 7$."

What's the error?

Solution The student halved $8$ to get $4$ — correct — but then forgot to **square** it. They added $4$ instead of $4^2 = 16$. Correct version: $x^2 + 8x + 16 = -3 + 16$, so $(x + 4)^2 = 13$. **Lesson:** The recipe is "half *then* square," not just "half." Skipping the squaring step means you aren't actually completing the square — the left side won't factor as a perfect square.

Problem 4 — Connection. Solve $x^2 - 6x + 9 = 0$ in two ways: (a) by factoring (using the pattern from Section 2.1), and (b) by completing the square. Do you get the same answer? Why does this make sense?

Solution (a) Factoring: $x^2 - 6x + 9 = (x - 3)^2 = 0$, so $x = 3$. (b) Completing the square: $x^2 - 6x = -9$. Half of $-6$ is $-3$, and $(-3)^2 = 9$. Add: $x^2 - 6x + 9 = 0$, so $(x - 3)^2 = 0$, giving $x = 3$. Same answer — because this equation is *already* a perfect square trinomial. Completing the square adds $9$ to both sides, but $9$ was already there. When a quadratic is a perfect square trinomial, both methods lead to the same factored form. The methods aren't competing — they're two paths up the same mountain.

What's Next

Completing the square works for every quadratic, but the algebra can get tedious — especially when $a \neq 1$ or the coefficients are fractions. What if we did the completing-the-square process once, in general, with letters instead of numbers? We'd get a single formula that solves any quadratic equation in one step. That formula has a name — and you'll derive it yourself in the next section.