COMPLETING THE SQUARE CALCULATOR

Completing the square calculator

Enter a, b and c, get vertex form or the roots — with every step shown.

2x² − 3x − 20 = 0

What does completing the square mean?

Rewriting ax² + bx + c as a(x − h)² + k, where h = −b ÷ 2a and k = c − b² ÷ 4a. The bracket is a perfect square, and (h, k) is the vertex of the parabola y = ax² + bx + c. For 2x² − 3x − 20: h = 3/4 and k = −169/8, so 2x² − 3x − 20 = 2(x − 3/4)² − 169/8.

How do I complete the square when a is not 1?

Factor a out of the x² and x terms first, then add and subtract the square of half the new x coefficient inside the bracket. The subtracted piece leaves the bracket multiplied by a. For 2x² − 3x − 20 = 2(x² − (3/2)x) − 20: half of 3/2 is 3/4, its square is 9/16, so 2(x² − (3/2)x + 9/16 − 9/16) − 20 = 2(x − 3/4)² − 9/8 − 20 = 2(x − 3/4)² − 169/8.

How do I solve a quadratic equation by completing the square?

Divide by a, move the constant to the right, add the square of half the x coefficient to both sides, write the left side as a perfect square, take the square root of both sides (± on the right), and solve for x. For 2x² − 3x = 20, that gives (x − 3/4)² = 169/16, x − 3/4 = ±13/4, so x = 4 or x = −5/2 (OpenStax Intermediate Algebra 2e, Example 9.19).

What happens if the right side is negative?

Then there is no real square root and the roots are complex. For x² + 4x = −21 the steps give (x + 2)² = −17, so x + 2 = ±i√17 and x = −2 ± i√17 (OpenStax Example 9.13). On the graph, the parabola never reaches the x-axis.

How is this different from the quadratic formula calculator?

Both give the same roots: the quadratic formula is what you get by completing the square once for general a, b and c. The quadratic formula calculator jumps straight to the roots, the discriminant and the factored form. This calculator shows each step of the method, the vertex form and the vertex, and gives exact fractions and radicals when a, b and c are whole numbers. To analyze the parabola itself — focus, directrix, intercepts — use the parabola calculator.

Worked example: three cases of the same method

First, x² + 6x + 5. Half of 6 is 3, its square is 9, so x² + 6x + 5 = (x + 3)² − 9 + 5 = (x + 3)² − 4; the vertex is (−3, −4), and since (x + 3)² = 4 the roots are x = −5 and x = −1. Second, −2x² + 8x − 3 has a negative leading coefficient: factor −2 out of the first two terms, complete the square inside, and the result is −2(x − 2)² + 5, so the vertex (2, 5) is a maximum, and the parabola opens downward. Third, x² − 6x + 9 gives (x − 3)² with k = 0: the right side is zero, so there is one repeated root, x = 3, and the parabola just touches the x-axis.

How does the vertex form help beyond solving?

The vertex form shows the extreme value directly. When a is positive the parabola opens upward and k is the minimum value of the expression, reached at x = h; when a is negative it opens downward and k is the maximum. It is also how the quadratic formula is derived: complete the square on ax² + bx + c = 0 in general, and the formula follows. The same technique rewrites the equation of a circle, x² + y² + Dx + Ey + F = 0, into (x − h)² + (y − k)² = r², which the circle equation calculator does.

Common mistakes when completing the square

Adding the square of half the coefficient inside the bracket without subtracting it, so that the expression changes value. When a is not 1, forgetting that the number added inside the bracket is multiplied by a, so a correction of a × (half)² has to be taken out, not just (half)². Taking half of b instead of half of b ÷ a. Getting the sign of h wrong: x² + 6x is (x + 3)², and the vertex is at x = −3. Forgetting the ± when taking the square root of both sides, which loses one of the two roots. Dividing only the left side by a when solving.

Where do the formulas come from?

From OpenStax Intermediate Algebra 2e, section 9.2 “Solve Quadratic Equations by Completing the Square”, which gives the procedure and the worked examples 9.13, 9.14, 9.18, 9.19 and 9.20 that are part of this calculator’s automated tests.

Sources: OpenStax Intermediate Algebra 2e, section 9.2. Only need the roots? Use the quadratic formula calculator; to study the curve, the parabola calculator; for circles, the circle equation calculator.