Skip to content

Completing the Square Calculator — Step-by-Step Solutions

The Completing the Square Calculator converts quadratic expressions from standard form (ax² + bx + c) to vertex form a(x - h)² + k. It finds the vertex, axis of symmetry, and solves the equation step by step.

Enter the coefficients a, b, and c to see the complete transformation, graph the parabola, and find the roots of the equation.

Enter coefficients for ax² + bx + c

Your calculations will appear here

How to Use the Completing the Square Calculator

  1. Enter the coefficients of your quadratic ax^2 + bx + c. The coefficient a cannot be 0. If your expression has no x term, enter b = 0.
  2. Choose a mode: Complete the Square writes the vertex form, Convert to Vertex Form lists the standard and vertex forms side by side with the vertex and y-intercept, Graph Parabola plots the curve, and Solve Equation solves ax^2 + bx + c = 0 by completing the square.
  3. Read the vertex form a(x - h)^2 + k and the vertex (h, k). The axis of symmetry is the line x = h.
  4. The step-by-step working shows how the constant is added and subtracted, so you can copy the method into your homework.

Formula and Theory

Completing the square rewrites a quadratic ax^2 + bx + c in vertex form a(x - h)^2 + k. The vertex of the parabola is the point (h, k), the axis of symmetry is x = h, and k is the minimum value if a is positive or the maximum if a is negative.

The method: factor a out of the x terms, giving a(x^2 + (b/a)x). Add and subtract the square of half the coefficient, (b / 2a)^2, inside the bracket. The first three terms become a perfect square (x + b/2a)^2, and the leftover constant gives k. The results are h = -b / 2a and k = c - b^2 / 4a.

To solve a quadratic equation this way, move k across and take square roots: a(x - h)^2 = -k leads to x = h plus or minus sqrt(-k / a). When -k / a is negative there are no real roots and the solutions are a pair of complex numbers. Completing the square on the general equation is exactly how the quadratic formula is derived.

Worked Examples

Example 1: Monic quadratic

Problem: Write x^2 + 6x + 5 in vertex form.

Solution: Half of 6 is 3, and 3^2 = 9. Add and subtract 9: x^2 + 6x + 9 - 9 + 5 = (x + 3)^2 - 4. So h = -3 and k = -4.

Answer: (x + 3)^2 - 4, vertex (-3, -4)

Example 2: Leading coefficient other than 1

Problem: Write 2x^2 - 8x + 3 in vertex form and find its roots.

Solution: Factor 2 from the x terms: 2(x^2 - 4x) + 3. Half of -4 is -2, and (-2)^2 = 4. Then 2(x^2 - 4x + 4 - 4) + 3 = 2(x - 2)^2 - 8 + 3 = 2(x - 2)^2 - 5. Roots: 2(x - 2)^2 = 5, so x - 2 = plus or minus sqrt(2.5) = plus or minus 1.5811.

Answer: 2(x - 2)^2 - 5, vertex (2, -5), roots x = 3.5811 and x = 0.4189

Example 3: Solving a quadratic equation

Problem: Solve x^2 + 4x - 12 = 0 by completing the square.

Solution: Move the constant: x^2 + 4x = 12. Add (4/2)^2 = 4 to both sides: x^2 + 4x + 4 = 16, so (x + 2)^2 = 16. Take square roots: x + 2 = plus or minus 4, so x = 2 or x = -6.

Answer: x = 2 or x = -6

Example 4: No real roots

Problem: Write x^2 + 2x + 5 in vertex form and describe its roots.

Solution: Half of 2 is 1, and 1^2 = 1. Then x^2 + 2x + 1 - 1 + 5 = (x + 1)^2 + 4. The square is never negative, so (x + 1)^2 + 4 is at least 4 and never reaches 0. Setting it to zero gives (x + 1)^2 = -4, so x = -1 plus or minus 2i.

Answer: (x + 1)^2 + 4, vertex (-1, 4), complex roots -1 + 2i and -1 - 2i

Frequently Asked Questions

What does completing the square mean?
It means rewriting a quadratic as a perfect square plus a constant. You add and subtract the square of half the x coefficient so that the x terms collapse into (x + something)^2.
How do I complete the square when a is not 1?
Factor a out of the x^2 and x terms first, complete the square inside the bracket, then multiply the leftover constant by a when you take it back out. Forgetting that multiplication is the most common mistake.
How do I find the vertex of a parabola?
Complete the square to get a(x - h)^2 + k. The vertex is (h, k). A shortcut is h = -b / 2a, then substitute h into the quadratic to find k.
Is completing the square the same as the quadratic formula?
They give the same roots. The quadratic formula is what you get by completing the square on the general equation ax^2 + bx + c = 0. Completing the square is better when you also want the vertex form.
What if the roots are complex?
When k and a have the same sign, the parabola never touches the x-axis. The equation then has two complex roots h plus or minus i sqrt(k / a), which the Solve Equation mode displays.
Why would I need vertex form?
It shows the maximum or minimum of the function and the axis of symmetry at once, which is useful for optimisation problems and for sketching the graph by transformation.

Related Algebra Calculators

Related Articles