Skip to content
MathMagic

Why completing the square works

A picture of a square with a corner missing explains the trick, the vertex form, and where the quadratic formula comes from.

post2 min
published
tags
algebra, quadratics

Every quadratic can be rewritten so that its vertex jumps out at you. The trick is called completing the square, and it is also the reason the quadratic formula exists.

The idea

Start with x2+6xx^2 + 6x. Picture a square of side xx, plus two strips each 33 wide and xx long. The strips almost fill out a bigger square, with a 3×33 \times 3 corner missing. Add that corner and you have (x+3)2(x+3)^2. So

x2+6x=(x+3)2−9x^2 + 6x = (x+3)^2 - 9

where the −9-9 pays back the corner we borrowed.

A worked example

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

Where the quadratic formula comes from

Do exactly the same thing to ax2+bx+c=0ax^2 + bx + c = 0. Divide by aa, complete the square, and solve:

(x+b2a)2=b2−4ac4a2⟹x=−b±b2−4ac2a\left(x + \frac{b}{2a}\right)^2 = \frac{b^2 - 4ac}{4a^2} \quad\Longrightarrow\quad x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}

That is all the quadratic formula is: completing the square, done once and for all.

Seeing the vertex

Our example, f(x)=x2−6x+5=(x−3)2−4f(x) = x^2 - 6x + 5 = (x-3)^2 - 4, has its vertex at (3,−4)(3, -4). The number inside the bracket moves the parabola sideways; the number outside moves it up or down.

You can watch each of those parameters move in the Quadratic Equations explainer.