Completing the Square: Steps, Vertex Form & Examples
Completing the square rewrites a quadratic so that the x terms sit inside a single squared bracket. The key fact is:
x² + bx = (x + b/2)² − (b/2)²
So you halve the x coefficient, square it, and add and subtract that number. For example, x² + 8x + 5 becomes (x + 4)² − 16 + 5 = (x + 4)² − 11. That form solves the equation, gives the vertex of the parabola, and is where the quadratic formula comes from. The solver below shows the completed-square (vertex) form of any quadratic:
Where the Missing Corner Comes From
The name comes from a picture. Draw x² as a square of side x. Split the 8x into two strips, each 4 by x, and attach one to the right side and one to the bottom. The shape is now almost a square of side x + 4, but the bottom-right corner is empty. That corner measures 4 by 4, so it’s 16.
Add the corner and you have a complete square: x² + 8x + 16 = (x + 4)². The 16 is (8/2)², which is why you always halve and square. Al-Khwarizmi solved equations this way in the 9th century, with diagrams instead of symbols.
Solving an Equation Step by Step
Take x² + 8x + 5 = 0:
- Move the constant across: x² + 8x = −5.
- Halve the x coefficient and square it: 8 ÷ 2 = 4, and 4² = 16.
- Add it to both sides: x² + 8x + 16 = 11.
- Write the left side as a square: (x + 4)² = 11.
- Take the square root, with ±: x + 4 = ±√11.
- Solve: x = −4 ± √11, so x ≈ −0.683 or x ≈ −7.317.
The ± in step 5 matters. (x + 2)² = 9 gives x + 2 = 3 or x + 2 = −3, so x = 1 or x = −5. Writing only x + 2 = 3 loses half the answer.
When b Is Odd
An odd b gives fractions, but the steps stay the same. Keep them as fractions rather than decimals. For x² − 5x − 3 = 0:
- x² − 5x = 3
- Half of −5 is −5/2, and (−5/2)² = 25/4.
- x² − 5x + 25/4 = 3 + 25/4 = 37/4
- (x − 5/2)² = 37/4
- x − 5/2 = ±√37/2, so x = (5 ± √37)/2, about 5.541 or −0.541.
The sign inside the bracket follows the sign of b. A negative b gives (x − 5/2)², but the number you add, 25/4, is always positive.
When a Isn’t 1
There are two ways to handle the leading coefficient, and which one you pick depends on the goal.
To solve an equation, divide through by a. For 3x² + 12x − 4 = 0, dividing by 3 gives x² + 4x − 4/3 = 0. Then x² + 4x = 4/3, so (x + 2)² = 4/3 + 4 = 16/3. The roots are x = −2 ± 4/√3 = −2 ± 4√3/3, about 0.309 and −4.309.
To get vertex form, factor a out of the x terms only. Here dividing would change the expression, so take the 3 out of the first two terms instead:
3x² + 12x − 4 = 3(x² + 4x) − 4 = 3[(x + 2)² − 4] − 4 = 3(x + 2)² − 16
The 4 you subtract sits inside the bracket, so it’s multiplied by 3 as well. Subtracting just 4 outside, to get 3(x + 2)² − 8, is a common slip. Expanding catches it: 3(x + 2)² − 16 = 3x² + 12x + 12 − 16 = 3x² + 12x − 4. ✓
A negative a works the same way. −x² + 6x + 1 = −(x² − 6x) + 1 = −[(x − 3)² − 9] + 1 = −(x − 3)² + 10.
What the Right-Hand Side Tells You
After step 4, the equation reads (x + something)² = some number. That number decides the kind of answer:
| Equation | After completing the square | Roots |
|---|---|---|
| x² + 8x + 5 = 0 | (x + 4)² = 11 | two real roots, −4 ± √11 |
| x² − 6x + 9 = 0 | (x − 3)² = 0 | one repeated root, 3 |
| x² + 4x + 13 = 0 | (x + 2)² = −9 | no real roots; complex −2 ± 3i |
A square can’t be negative, so the third equation has no real solution. In general the right-hand side is (b² − 4ac)/4a², and 4a² is always positive. So it has the same sign as the discriminant. The Quadratic Equation Solver explains what each discriminant value means.
Finding a Maximum or Minimum
In vertex form a(x − h)² + k, the squared bracket is never negative. So when a is positive, the smallest value is k, reached at x = h. When a is negative, k is the largest value. That gives the turning point without any calculus.
Example: the biggest rectangle for 40 m of fence. If one side is x, the other is 20 − x, and the area is
A = x(20 − x) = −x² + 20x = −(x² − 20x) = −[(x − 10)² − 100] = −(x − 10)² + 100
The area peaks at 100 m² when x = 10. The best shape is a 10 m by 10 m square. Any other choice makes (x − 10)² positive and the area smaller. A 12 by 8 rectangle, for instance, gives 96 m².
How the Quadratic Formula Comes From It
Completing the square on ax² + bx + c = 0, with letters instead of numbers, produces the formula:
- Divide by a: x² + (b/a)x + c/a = 0
- Move the constant: x² + (b/a)x = −c/a
- Add (b/2a)² to both sides: (x + b/2a)² = b²/4a² − c/a = (b² − 4ac)/4a²
- Take the square root: x + b/2a = ±√(b² − 4ac)/2a
- Subtract b/2a: x = (−b ± √(b² − 4ac))/2a
So the formula is completing the square done once, in general.
Completing the Square on a Circle
The same move turns a circle’s equation into one you can read. For x² + y² − 6x + 4y − 12 = 0, complete the square on the x terms and the y terms separately:
- x² − 6x = (x − 3)² − 9
- y² + 4y = (y + 2)² − 4
So (x − 3)² − 9 + (y + 2)² − 4 − 12 = 0, which gives (x − 3)² + (y + 2)² = 25. That’s a circle with center (3, −2) and radius 5.
When to Use It
Completing the square is the quickest choice when a = 1 and b is even, as in x² + 8x + 5. It’s also the method to use when you need the vertex, a maximum or minimum, or a circle’s center and radius. When the quadratic factors easily, factoring is faster; the factoring guide shows how to tell. For messy coefficients, the formula avoids the fractions.
