Take . It's close to being a perfect square, but not quite. Add exactly one number to it and it becomes one. That number isn't a magic constant someone made up, it's built right into the 6. Once you know how to find it, you can turn any quadratic into a perfect square plus a leftover. That's the whole trick, and it's called completing the square.
Why does need anything added at all?
Picture as a literal square, side length . Now attach a rectangle of area to one side. Together they form an L-shape, not a square, because a real square needs four matching sides and right now you've got a big square with an extra strip hanging off one edge.
Here's the move that makes it work: cut that rectangle in half, and wrap one half around the right side of the square and the other half around the bottom. Now you've got a bigger square-ish shape with one small piece missing, right in the corner.
x² + bx is an almost-square: a big square plus two thin strips, missing one corner. Slide b, then reveal the exact piece needed to close the gap.
Slide and look at that corner gap. Its side length is always half of , because you split down the middle to wrap it around two sides. So its area is always . Fill that piece in and you've genuinely built a square, with side .
That's the entire idea. In symbols, we write it as:
Notice the minus sign at the end. We added to make the square work, so we have to subtract it right back out, otherwise we've changed the value of the expression. Add it, then take it away. That's completing the square in one sentence.
Turning the picture into an algorithm
Geometry is great for seeing why the trick works, but you don't want to draw a square every time you solve an equation. Here's the algebra version, applied to .
Watch x² + 6x + 5 = 0 turn into a perfect square, one legal move at a time. Nothing here changes the equation, it only changes how it's written.
Every step is a legal move: adding the same number to both sides, or just rewriting one side in a different form. Nothing here secretly changes the equation. Once the left side is , solving is just a square root away.
The general pattern for any :
And if you push this through with letters instead of numbers, all the way to the end, you get the quadratic formula. It's not a separate method you have to learn from scratch, it's completing the square done once in general so you never have to redo the algebra by hand. If the leading coefficient isn't 1, you factor it out first: , same idea, just with an extra factor to track.
A quadratic already knows where its own minimum is
Here's something you don't get for free from factoring. Once you write a quadratic as , called vertex form, the lowest point of the parabola is sitting right there in the equation: it's .
Why? Because can never be negative, its smallest possible value is 0, and that happens exactly when . At that instant, . Everywhere else, you're adding something positive to , so is the floor.
y = (x - h)² + k is a quadratic that already tells you its own vertex. Drag h and k and watch the parabola slide, no calculus required to find the bottom.
Drag and and watch the parabola slide around, always keeping its lowest point exactly at . This is why completing the square matters beyond solving equations. It's how you find a maximum or minimum without touching calculus, just by rewriting the expression.
Where this actually gets used: finding a maximum
Suppose you've got 40 meters of fence and want to build the biggest possible rectangular pen against a wall... how long should each side be?
Let one side be . Since the two sides you're fencing (not counting the wall) must add up to 20, the other side is . The area is:
That's a downward parabola, so it has a maximum, and completing the square finds it directly:
The vertex is , so the biggest possible pen is a square, with area . No derivatives, no guessing, just the same "fill the missing corner" idea from before, applied to a real shape.
40 meters of fence, one rectangular pen. Slide the side length x and watch the area curve, completing the square finds the peak without ever touching calculus.
Slide toward 10 and watch the area climb toward exactly 100, then fall away on the other side. That symmetry isn't a coincidence, it's the same shape doing the same thing it always does.
This kind of problem shows up everywhere real quadratics do: projectile motion asks for the peak height the same way, and any time you're optimizing something that follows a parabola, completing the square gets you the answer directly.
The short version
Completing the square works because is a square shape with one corner missing, and that missing piece always has area . Add it in, subtract it back out, and any quadratic becomes "something squared plus a constant." That single move solves equations by taking a square root instead of guessing factors, and it reveals a parabola's vertex directly, which means it finds a maximum or minimum without any calculus at all. If you've also seen factoring or the three ways to solve a quadratic, this is the method sitting underneath both of them.
All visualizations are interactive React components running entirely in your browser. No libraries beyond React.