About the Completing the Square Calculator
This completing the square calculator takes a quadratic ax² + bx + c and rewrites it in vertex form a(x − h)² + k, showing each algebra step: factoring out a, halving the x-coefficient, adding and subtracting its square, and simplifying. Results are kept as exact fractions, so x² + 5x + 1 becomes (x + 5/2)² − 21/4 rather than a rounded decimal.
It is aimed at algebra students learning the method, teachers making worked examples, and anyone who needs the vertex of a parabola, its axis of symmetry or its minimum or maximum value. Because completing the square is how the quadratic formula is derived, the calculator also solves ax² + bx + c = 0 from the vertex form, giving exact roots with simplified square roots where possible.
Enter the three coefficients (decimals are fine — they are converted to exact fractions). The coefficient a must not be zero; if it is, the expression is linear and there is no square to complete.
How to use the completing the square calculator
- 1Enter a, b and c from your quadratic ax² + bx + c.
- 2Read the vertex form a(x − h)² + k at the top.
- 3Follow the steps table to see how the square is completed.
- 4Use the vertex, axis of symmetry and roots for graphing or solving.
Formula and method
Completing the square turns x² + px into a perfect square by adding (p/2)²: x² + px + (p/2)² = (x + p/2)². To keep the expression unchanged the same amount is subtracted again. When a ≠ 1, a is factored out of the x-terms first, so the amount added inside the bracket is really a × (b/2a)², which is why the constant becomes c − b²/(4a).
In the result a(x − h)² + k, h = −b/(2a) is the x-coordinate of the vertex and k = c − b²/(4a) is the minimum (a > 0) or maximum (a < 0) value. Setting the vertex form equal to zero and taking square roots gives x = h ± √(−k/a), which is exactly the quadratic formula.
- a, b, c
- Coefficients of ax² + bx + c
- h
- −b/(2a), x-coordinate of the vertex
- k
- c − b²/(4a), y-coordinate of the vertex
- b² − 4ac
- Discriminant: > 0 two roots, = 0 one, < 0 none (real)
Worked examples
x² + 6x + 5
Half of 6 is 3 and 3² = 9. Adding and subtracting 9 gives (x² + 6x + 9) − 9 + 5 = (x + 3)² − 4. Setting it to zero, (x + 3)² = 4, so x + 3 = ±2 and x = −5 or −1.
Leading coefficient: 2x² − 8x + 3
Factor out 2: 2(x² − 4x) + 3. Half of −4 is −2, squared is 4: 2(x² − 4x + 4 − 4) + 3 = 2(x − 2)² − 8 + 3 = 2(x − 2)² − 5. The vertex is (2, −5).
Fractions: x² + 5x + 1
Half of 5 is 5/2 and (5/2)² = 25/4. So x² + 5x + 1 = (x + 5/2)² − 25/4 + 1 = (x + 5/2)² − 21/4, and the roots are −5/2 ± √21/2.
No real roots: −x² + 4x − 7
Factor out −1: −(x² − 4x) − 7 = −(x² − 4x + 4 − 4) − 7 = −(x − 2)² + 4 − 7 = −(x − 2)² − 3. The parabola opens down with maximum −3, so it never crosses zero.
Frequently asked questions
What does completing the square mean?+
It means rewriting a quadratic so it contains a perfect square such as (x + 3)². You add the square of half the x-coefficient to make the perfect square and subtract it again so the value does not change.
How do you 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 when you move it outside. For 2x² − 8x + 3 this gives 2(x − 2)² − 5.
Why is completing the square useful?+
Vertex form shows the vertex, axis of symmetry and maximum or minimum instantly, solves any quadratic, and is the method used to derive the quadratic formula and the standard equations of circles and ellipses.
How do you solve an equation by completing the square?+
Write it as a(x − h)² + k = 0, rearrange to (x − h)² = −k/a, take the square root of both sides (remembering ±) and add h. If −k/a is negative the equation has no real solutions.
Is vertex form the same as completing the square?+
Vertex form a(x − h)² + k is the result of completing the square on y = ax² + bx + c. The two expressions are identical for every x; only the way they are written differs.