What does completing the square mean?
Completing the square is an algebra technique that turns a quadratic expression into a perfect square plus a constant. A perfect square trinomial looks like this:
Given x² + 6x, you are missing the last term. Adding 9 gives x² + 6x + 9 = (x + 3)². The missing term is 9 because it is the square of half the middle coefficient: (6/2)² = 3² = 9.
The rule: to complete the square on x² + bx, add (b/2)².
This technique is used to solve equations that do not factor, to find the vertex of a parabola, to work with circle equations and to derive the quadratic formula. For the broader menu of methods, see our guide to solving quadratic equations.
How does the geometry work?
Picture x² + bx as a square of side x with a rectangle of width b and height x attached. Cut the rectangle in half lengthwise, giving two strips of size (b/2) by x. Attach one strip to the right side of the square and one to the top. This leaves an empty corner of size (b/2) by (b/2).
Filling the corner gives a bigger square with side x + b/2. Its area is (x + b/2)² = x² + bx + (b/2)². So the "missing piece" you add is (b/2)². The picture explains the name.
How do you complete the square to solve an equation?
Follow these steps for x² + bx + c = 0 when the leading coefficient is 1:
- Move the constant to the right side: x² + bx = −c.
- Add (b/2)² to both sides.
- Write the left side as a square: (x + b/2)² = (b/2)² − c.
- Take square roots of both sides, using ±.
- Solve for x.
Example: x² + 8x + 5 = 0.
- x² + 8x = −5.
- (8/2)² = 16. Add 16 to both sides: x² + 8x + 16 = 11.
- (x + 4)² = 11.
- x + 4 = ±√11.
- x = −4 ± √11, about −0.68 and −7.32.
This quadratic does not factor over the integers, but completing the square solves it exactly.
Example with a negative middle term: x² − 10x + 21 = 0.
x² − 10x = −21. Half of −10 is −5, and its square is 25. So (x − 5)² = 4, and x − 5 = ±2, giving x = 7 or x = 3.
What if the leading coefficient is not 1?
Divide the whole equation by a first, or factor a out of the x terms.
Example: 2x² + 12x − 14 = 0.
Divide by 2: x² + 6x − 7 = 0. Then x² + 6x = 7, add 9: (x + 3)² = 16, so x = −3 ± 4, which gives x = 1 or x = −7.
Example: 3x² − 6x − 1 = 0.
Divide by 3: x² − 2x − 1/3 = 0. Then x² − 2x = 1/3. Add 1 to both sides: (x − 1)² = 4/3. So x = 1 ± √(4/3) = 1 ± 2/√3, or about 2.15 and −0.15. You may need to handle fractions, which is where the fraction guide helps.
How do you find the vertex form?
To rewrite y = ax² + bx + c as y = a(x − h)² + k, complete the square on the expression and keep the equation balanced by adding and subtracting the same amount.
Example: y = x² − 6x + 5.
Take half of −6 to get −3, and square it to get 9. Add and subtract 9:
y = (x² − 6x + 9) − 9 + 5 = (x − 3)² − 4.
The vertex is (3, −4). Since the coefficient is positive, the parabola opens up and −4 is the minimum value.
Example with a ≠ 1: y = 2x² + 8x + 5.
Factor 2 from the first two terms: y = 2(x² + 4x) + 5. Half of 4 is 2, and 2² = 4. Add and subtract 4 inside the bracket, remembering that the 4 you add inside is multiplied by 2:
y = 2(x² + 4x + 4 − 4) + 5 = 2(x + 2)² − 8 + 5 = 2(x + 2)² − 3.
The vertex is (−2, −3).
A shortcut gives the vertex directly: h = −b/(2a) and k = y(h). For y = 2x² + 8x + 5, h = −8/4 = −2, and k = 2(4) − 16 + 5 = −3. Both methods agree.
How does completing the square give the quadratic formula?
Apply the steps to the general equation ax² + bx + c = 0.
- 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/a)x + b²/(4a²) = b²/(4a²) − c/a.
- Write the left as a square and combine the right: (x + b/2a)² = (b² − 4ac)/(4a²).
- Take roots: x + b/2a = ±√(b² − 4ac) / 2a.
- Solve: x = (−b ± √(b² − 4ac)) / 2a.
That is the quadratic formula. It is simply completing the square done once for every quadratic.
What about circles?
The equation of a circle is (x − h)² + (y − k)² = r², where (h, k) is the center and r is the radius. If a circle is given in expanded form, complete the square in both variables to find the center and radius.
Example: x² + y² − 4x + 6y − 12 = 0.
Group: (x² − 4x) + (y² + 6y) = 12. Complete each: add 4 and 9 to both sides. (x − 2)² + (y + 3)² = 25. The center is (2, −3) and the radius is 5. The circle calculator works with radius, diameter, circumference and area once you have these.
What mistakes should you avoid?
- Adding to one side only. Whatever you add to complete the square, you must also add to (or subtract from) the other side.
- Forgetting to halve b. The term to add is (b/2)², not b².
- Dropping the a multiplier when a ≠ 1. Anything added inside a bracket multiplied by a changes the total by a times that amount.
- Sign errors. If b is negative, the bracket is (x − something).
- Leaving out ± when taking roots.
- Stopping before solving. Isolate x at the end.
A check is to expand your final bracket. (x − 3)² − 4 expands to x² − 6x + 5, which matches the original. The quadratic equation calculator can confirm roots too. With practice, the steps become automatic: halve, square, add, factor.
How can you use the vertex form to find a maximum or minimum?
Vertex form makes optimization problems easy, because the squared bracket is never negative. In y = a(x − h)² + k with a > 0, the smallest value of the bracket is 0 at x = h, so the minimum of y is k. If a < 0, the same reasoning gives a maximum of k.
Example. A ball is thrown and its height in meters after t seconds is h = −5t² + 20t + 1. Factor out −5 from the t terms: h = −5(t² − 4t) + 1. Half of −4 is −2, and (−2)² = 4, so h = −5(t² − 4t + 4 − 4) + 1 = −5(t − 2)² + 20 + 1 = −5(t − 2)² + 21. The ball reaches its maximum height of 21 m after 2 seconds. Reading that from the original form would have taken more work, which is why completing the square is a practical skill.