Key facts
- Completing the square turns ax² + bx + c into a(x − h)² + k, with h = −b ÷ 2a and k = c − b² ÷ 4a.
- x² + 6x + 5 = (x + 3)² − 4, so the vertex is (−3, −4) and the solutions are x = −1 and x = −5.
- The key step is adding and subtracting (b ÷ 2)² after dividing by a.
- If the number on the right is negative after you isolate the square, the solutions are complex: x² + 2x + 5 = 0 gives x = −1 ± 2i.
- The quadratic formula is what you get when you complete the square on ax² + bx + c = 0 in general.
The method, step by step
To solve ax² + bx + c = 0 by completing the square:
- Divide by a so the x² coefficient is 1: x² + (b/a)x + c/a = 0.
- Move the constant to the right: x² + (b/a)x = −c/a.
- Add (b ÷ 2a)² to both sides. The left side is now a perfect square.
- Write the square: (x + b/2a)² = (b² − 4ac) ÷ 4a².
- Take square roots of both sides, remembering ±.
- Solve for x.
The calculator shows each of these lines with your numbers, keeping fractions and radicals exact.
How to use the completing the square calculator
- Enter a, b and c from ax² + bx + c. Use negative numbers for subtraction (x² − 4x + 1 means a = 1, b = −4, c = 1).
- Read the vertex form, the vertex, the solutions and the discriminant.
- Follow the steps table to see how each line comes from the one before.
Worked examples: completing the square
Example 1: whole-number answers
x² + 6x + 5 = 0. Move 5: x² + 6x = −5. Half of 6 is 3, and 3² = 9, so add 9: x² + 6x + 9 = 4, or (x + 3)² = 4. Then x + 3 = ±2, giving x = −1 or x = −5.
Example 2: irrational answers
x² − 4x + 1 = 0. Then x² − 4x = −1, add 4: (x − 2)² = 3, so x = 2 ± √3 ≈ 3.732 or 0.268.
Example 3: a leading coefficient
2x² − 12x + 7 = 0. Divide by 2: x² − 6x + 3.5 = 0. Add 9 to both sides of x² − 6x = −3.5: (x − 3)² = 5.5 = 11/2. So x = 3 ± √(11/2) = 3 ± √22/2 ≈ 5.345 or 0.655. The vertex form is 2(x − 3)² − 11.
Example 4: complex answers
x² + 2x + 5 = 0 becomes (x + 1)² = −4. No real number squares to −4, so x = −1 ± 2i.
Why it works
(x + p)² = x² + 2px + p². So any expression x² + bx is a perfect square missing only p² where p = b ÷ 2. Adding that missing piece, and subtracting it again to keep things balanced, completes the square. Geometrically, x² + bx is a square with two rectangles attached; the missing corner is a small square of side b ÷ 2.
What the vertex form tells you
| Part | Meaning |
|---|---|
| a | Same as before: opens up if positive, down if negative |
| h | x-coordinate of the vertex and the axis of symmetry x = h |
| k | Minimum (a > 0) or maximum (a < 0) value of the quadratic |
When to use completing the square
- To find the vertex of a parabola without calculus.
- To solve quadratics that do not factor nicely.
- To derive the quadratic formula.
- To rewrite circle equations like x² + y² − 6x + 4y = 3 as (x − 3)² + (y + 2)² = 16, a circle of radius 4 centred at (3, −2).
- To set up integrals and inverse Laplace transforms later in calculus.
Common mistakes with completing the square
- Forgetting to divide by a first.
- Adding (b ÷ 2)² to only one side.
- Dropping the ± when taking the square root.
- Halving b before dividing by a.
For a one-step answer, use the quadratic formula calculator. To convert between forms with the focus and directrix, see the vertex form calculator, and to factor instead, the factoring trinomials calculator.
Completing the square, literally
The method is named for a picture. In the 9th century, al-Khwarizmi solved equations such as x² + 10x = 39 by drawing a square of side x, attaching rectangles of total area 10x, and then adding the small corner square of area 25 needed to "complete" a larger square of side x + 5; since the large square has area 39 + 25 = 64, its side is 8, so x = 3. The same idea appears geometrically in Book II of Euclid’s *Elements*, and it is how the quadratic formula is derived.
Completing the square is more than a solving technique. It converts a quadratic into vertex form, a(x − h)² + k, which shows a parabola’s turning point at once; it turns the general equation of a circle into centre-radius form; and in calculus and statistics it is the key step in integrating Gaussian functions behind the normal distribution. In US high schools, Common Core standards A-REI.B.4a and F-IF.C.8a ask students to complete the square to derive the quadratic formula and to reveal the maximum or minimum of a quadratic function. When a quadratic factors neatly, factoring the trinomial is quicker than completing the square. For the formula directly, use the quadratic formula calculator; to convert forms, the vertex form calculator; and for the discriminant, the discriminant calculator.
How this calculator works
- Divides ax² + bx + c by a, moves the constant, then adds (b ÷ 2a)² to both sides to form a perfect square.
- Writes the result as a(x − h)² + k with h = −b/2a and k = c − b²/4a, and shows each step.
- Solves by taking square roots: x = h ± √(−k/a), giving real or complex solutions.
- The discriminant and vertex are shown as a cross-check.
Frequently asked questions
What does completing the square mean?
Rewriting ax² + bx + c as a(x − h)² + k by adding and subtracting the number that makes a perfect square.
How do I complete the square for x² + 6x + 5?
Half of 6 is 3 and 3² = 9, so x² + 6x + 5 = (x + 3)² − 9 + 5 = (x + 3)² − 4.
What number do I add to complete the square?
(b ÷ 2)² after the x² coefficient has been made 1.
What if a is not 1?
Divide every term by a first, or factor a out of the x² and x terms.
What if I get a negative number under the square root?
The equation has no real solutions; the two solutions are complex conjugates such as −1 ± 2i.
How does completing the square give the vertex?
In a(x − h)² + k, the vertex is (h, k).
Is completing the square the same as the quadratic formula?
The quadratic formula is completing the square done once with letters, so both give the same answers.
When is completing the square better than factoring?
When the quadratic does not factor over the integers, or when you also want the vertex.