What Is Completing the Square?
Completing the square turns x² + bx into a perfect square plus a constant. See the geometric picture behind the name, where it's used and a first example.
What Is Completing the Square?
What is completing the square? It is a bookkeeping trick that rewrites a messy quadratic expression into a perfect square plus a constant. Take ax² + bx + c and turn it into a(x − h)² + k, which reveals the parabola's vertex in one glance. The name comes from a geometric picture: you literally fill in a square area.
The Idea in One Line
You have a quadratic expression like x² + 6x + 5. Rewrite it as (x + 3)² − 4. That is completing the square. Add and subtract the same number so the first three terms become a perfect square trinomial, an expression that factors into (x + h)². The leftover constant adjusts the value. You end up with a form that tells you the vertex, the axis of symmetry, and the minimum or maximum of the parabola.
The Geometric Picture: Literally Completing a Square
The method gets its name because it mimics a real-world action: cutting and pasting pieces to form a square. Imagine you have a square of side length x (area x²) and a rectangle of width b and length x (area bx). You want to combine them into a single square. Cut the rectangle in half lengthwise, producing two rectangles of width b/2. Attach one to the right side of the square and the other to the top. Now you have an L-shaped area. To complete the square, add a small square of side b/2 in the corner. That small square's area is (b/2)². You added it, so subtract it to keep the total unchanged. The new large square has side x + b/2 and area (x + b/2)². The original expression x² + bx becomes (x + b/2)² − (b/2)².
This is not a modern diagram. Babylonian clay tablets from the Old Babylonian period (c. 2000-1600 BCE) use exactly this geometric cut-and-paste method to solve quadratic problems. The Yale tablet YBC 4663 records a problem: "I have added the area and the side of my square: 3/4." The solution works by completing the square on a square plus a linear term. The MacTutor History of Mathematics archive documents this as the earliest known use of the technique.
Al-Khwarizmi, working at the House of Wisdom in Baghdad around 820 CE, formalised the method in his book Al-Kitāb al-mukhtaṣar fī ḥisāb al-jabr waʾl-muqābala. He gave six canonical forms of quadratic equations and solved each one with a geometric proof using squares and rectangles. The diagram he drew is the same L-shape plus corner square. The word "algebra" comes from al-jabr in his title, meaning "restoration" of a broken quantity. The geometric picture is not a footnote, it is the reason the method has its name.
Perfect Square Trinomials: The Target You Aim For
A perfect square trinomial is an expression that factors into (x + h)². Expand it: (x + h)² = x² + 2hx + h². The middle term is exactly twice the product of x and h. The constant term is h². If you have x² + 6x, you need a constant of 9 to make it a perfect square because half of 6 is 3, and 3² is 9. So x² + 6x + 9 = (x + 3)².
Most quadratics are not perfect squares. Force them to become one. The single most error-prone step is the "half-the-coefficient rule": take b, divide by 2, square the result, then add and subtract that number. If a ≠ 1, factor out a first, then add and subtract a·(b/2)² inside the parentheses. Forget the factor a, and the vertex's y-coordinate comes out wrong. This is the number one failure mode.
One Simple Example: x² + 6x + 5
Start with x² + 6x + 5. Take half of 6, which is 3. Square it: 9. Add and subtract 9 inside the expression: x² + 6x + 9 − 9 + 5. The first three terms form (x + 3)². Combine the constants: −9 + 5 = −4. So (x + 3)² − 4 is the vertex form. The vertex is at (−3, −4). The axis of symmetry is x = −3. The parabola opens up because a = 1 > 0. That is the entire process in four lines.
If the coefficient of x is odd, say x² + 3x + 2, half of 3 is 3/2. Square it: 9/4. Add and subtract 9/4: x² + 3x + 9/4 − 9/4 + 2. That becomes (x + 3/2)² − 1/4. The vertex is at (−3/2, −1/4). Fractions appear, but the method works exactly the same way. Keep the exact fractions for later calculus work.
Where Completing the Square Is Used: Beyond Solving Equations
The method shows up in four main places, each requiring the same algebraic trick applied in a slightly different context.
Solving Quadratic Equations
If you have x² + 6x + 5 = 0, rewrite as (x + 3)² − 4 = 0, then (x + 3)² = 4, then x + 3 = ±2, so x = −1 or x = −5. This is slower than the quadratic formula for messy coefficients, but it gives you the vertex for free.
Vertex Form and Parabola Graphing
Once you have f(x) = a(x − h)² + k, read the vertex (h, k) directly. The vertex is the turning point of the parabola. The axis of symmetry is x = h. The direction (up or down) is determined by a. This is how you graph a quadratic without plotting points.
Circle Equations
To rewrite a circle equation like x² + y² + Dx + Ey + F = 0 into centre-radius form (x − h)² + (y − k)² = r², complete the square twice, once for x and once for y. For example, x² + 6x + y² − 4y + 9 = 0 becomes (x + 3)² + (y − 2)² = 4, centre (−3, 2), radius 2. The centre is (−D/2, −E/2), which is the same sign-flip rule as the vertex.
The Quadratic Formula Derivation
Complete the square on the general equation ax² + bx + c = 0 and you derive x = [−b ± √(b² − 4ac)] / (2a). The derivation takes six lines. The discriminant b² − 4ac appears naturally as the term that must be non-negative for real roots. This is the single best proof of why the quadratic formula works.
Calculus: Integrals and Trigonometric Substitution
When you need to integrate ∫ dx / (x² + bx + c), completing the square transforms the denominator into (x + b/2)² + (c − b²/4), which matches the arctangent integral form. The same trick works for integrals that involve √(x² + bx + c), enabling trigonometric substitution. This is a standard calculus technique.
A Short History: From Babylonian Clay to Algebraic Notation
The Old Babylonian period, roughly 2000-1600 BCE, produced clay tablets with geometric solutions to quadratic problems. The MacTutor History of Mathematics archives the tablet YBC 4663, which asks: "I have added the area and the side of my square: 3/4." The scribe solved it by completing the square on a square plus a linear term, the same geometric cut-and-paste described above. No algebraic notation existed; the solution was purely geometric.
Euclid's Elements (Book II, c. 300 BCE) gave a Greek geometric treatment using areas of squares and rectangles. Brahmagupta (7th century CE) and Sridhara (9th century CE) provided early algebraic formulas. Al-Khwarizmi's Al-jabr (c. 820 CE) codified the method into six canonical forms with geometric proofs. The first Latin translation appeared in 1145 by Robert of Chester. Simon Stevin (16th century) introduced symbolic notation, and René Descartes (17th century) linked algebra to geometry in La Géométrie, formalising the coordinate plane where vertex form matters.
Common Questions
What does completing the square mean in simple terms?
It means rewriting a quadratic expression so that the variable part becomes a perfect square trinomial, like (x + h)². The name comes from the geometric act of adding a small square to complete a larger square area.
Why do I need to add and subtract the same number?
Adding (b/2)² creates a perfect square. Subtracting the same number keeps the expression equal to the original. If you only add, you change the value. This is the single most common mistake.
Does completing the square work when a is not 1?
Yes. Factor out a from the x² and x terms first. Then add and subtract a·(b/2)² inside the parentheses. The constant term changes by a factor of a. Forgetting this factor is the number one failure mode.
When should I use completing the square instead of the quadratic formula?
Use it when you need the vertex anyway, for graphing parabolas, finding maximum or minimum values, or rewriting circle equations. For pure root-finding with messy coefficients, the quadratic formula is faster.