Completing the Square Calculator
Rewrite ax² + bx + c as a(x + p)² + q, and see the square being completed as a picture.
Your Values
Try an example
Visualization
Results
Step-by-Step Solution
How Completing the Square Calculator Works?
The completing the square calculator divides the x² and x terms by a, adds and subtracts (b/2a)², and folds the perfect square trinomial into a(x + p)² + q.
- Enter a, b and c
- Factor a out of the x² and x terms
- Halve the x coefficient b/a
- Square the half: (b/2a)²
- Add and subtract the square
- Fold the trinomial into (x + p)²
- Solve by taking square roots
The diagram draws x² as a square and splits the x term into 2 equal strips along 2 sides. The missing corner has area (b/2a)², which is the number added to complete the square. The calculator then solves a(x + p)² + q = 0 for real or complex roots.
Completing the Square Formula
The completing the square formula is ax² + bx + c = a(x + b/2a)² + (c − b²/4a).
ax² + bx + c = a(x + p)² + q
- p
- p = b / 2a, half of the x coefficient
- q
- q = c − b² / 4a, the leftover constant
- (−p, q)
- the vertex of the parabola
- x
- x = −p ± √(−q/a)
Worked Example: x² + 6x + 5
- Half of 6 is 3, and 3² = 9.
- x² + 6x + 5 = (x² + 6x + 9) − 9 + 5.
- = (x + 3)² − 4.
- (x + 3)² = 4, so x + 3 = ±2.
- x = −1 or x = −5.
With a = 2, factor first: 2x² + 12x − 3 = 2(x² + 6x) − 3 = 2(x + 3)² − 18 − 3 = 2(x + 3)² − 21.
Completing the Square Calculator FAQ
Why Is It Called Completing the Square?
The method adds the 1 missing piece that turns x² + bx into a perfect square: x² is a square, the bx term forms 2 strips, and (b/2)² fills the empty corner.
When Should I Complete the Square Instead of Using the Quadratic Formula?
Complete the square when the question asks for the vertex or the turning point, or when b is even. The quadratic formula is faster for finding roots alone.
How Do I Complete the Square When a Is Not 1?
Factor a out of the x² and x terms first, complete the square inside the bracket, then multiply the subtracted square by a before combining it with c.
Can Completing the Square Give Complex Roots?
Yes, completing the square gives complex roots when q/a is positive. (x + 1)² + 4 = 0 gives (x + 1)² = −4, so x = −1 ± 2i.
How Does Completing the Square Find the Vertex?
The completed form a(x + p)² + q has its vertex at (−p, q). (x + 3)² − 4 has its vertex at (−3, −4).