Completing the Square Calculator

Form

Results

0
1

What is Completing the Square?

Completing the square rewrites a quadratic expression so that its squared part is visible. Instead of ax² + bx + c, you get a form such as a(x − h)² + k. These expressions describe the same quadratic, but the second form makes its turning point much easier to read.

This calculator takes the three coefficients and returns a completed-square expression. Use it to check algebra, identify a parabola’s vertex, or prepare an equation for solving by square roots. It rewrites the expression; it does not directly list the roots or draw a graph.

2

How to Use This Calculator

Write the quadratic in descending powers of x and enter its coefficients as a, b, and c. For x² + 6x + 5, enter 1, 6, and 5. Include the sign of each coefficient. If the linear term is missing, enter zero for b; if the constant is missing, enter zero for c.

Choose Precision as the number of decimal places used in the output, then select Calculate. Use an integer from zero through twelve. The leading coefficient a must be nonzero, because otherwise the expression is linear or constant and the completed-square formula would divide by zero. Decimal coefficients are allowed, but rounded output may be an approximation to the original expression.

3

Formula Used

The identity is ax² + bx + c = a(x + b/(2a))² + c − b²/(4a), for a ≠ 0. In vertex notation, h = −b/(2a) and k = c − b²/(4a), giving a(x − h)² + k.

The opposite sign inside the bracket matters. If h is −3, then x − h is x + 3. If h is 2, the bracket is x − 2. To derive the identity, factor a from the first two terms, take half the remaining linear coefficient, square it, and add and subtract the corresponding amount so the expression’s value stays unchanged.

4

Variables Explained

Symbol or inputMeaning
aCoefficient of x². It determines the vertical scaling and whether the parabola opens upward or downward. It cannot be zero.
bCoefficient of x, including its sign. Use zero when there is no linear term.
cConstant term. It equals the expression’s value at x = 0.
hHorizontal coordinate of the vertex: −b/(2a). The bracket is x − h.
kVertical coordinate of the vertex: c − b²/(4a).
PrecisionOutput rounding in decimal places. It does not change the underlying input coefficients.
5

Worked Example

For x² + 6x + 5, half the linear coefficient is 3 and its square is 9. Add and subtract 9: x² + 6x + 9 − 9 + 5. The first three terms make (x + 3)², leaving (x + 3)² − 4. The vertex is therefore (−3, −4).

Check by expanding: (x + 3)² − 4 = x² + 6x + 9 − 4 = x² + 6x + 5. This expansion checks both the bracket sign and the constant adjustment.

For 2x² − 8x + 3, first factor 2 from the quadratic and linear terms: 2(x² − 4x) + 3. Completing the inner square gives 2[(x − 2)² − 4] + 3 = 2(x − 2)² − 5. The vertex is (2, −5), and substituting x = 2 into the original expression confirms the value −5.

6

Why Use This Calculator?

When a is positive, a(x − h)² is never negative, so k is the minimum value and it occurs at x = h. When a is negative, k is the maximum value. The vertical line x = h is the axis of symmetry in either case.

To solve an equation, first set the completed expression equal to the required value. For (x + 3)² − 4 = 0, rearrange to (x + 3)² = 4. Taking both square roots gives x + 3 = ±2, so x = −1 or −5. That solving step is separate from the expression displayed by the calculator.

7

Common Mistakes

    Do not square half of b before accounting for a when a is not one. In 2x² − 8x + 3, the inner linear coefficient is −4 after factoring, so the square uses −2. Forgetting the outside factor also changes the constant correction.

    Keep both square-root signs when solving an equation. Rewriting a quadratic is an identity valid for every x; finding roots answers a different question about particular x values. Finally, use enough display precision for your purpose. If h or k is rounded, expanding the displayed expression may produce coefficients slightly different from the originals.

8

Frequently Asked Questions

Can the method handle a negative leading coefficient?

Yes. For −x² + 4x + 2, it gives −(x − 2)² + 6. The vertex is (2,6), and the parabola opens downward. A negative a changes the direction of opening, not whether completing the square is possible.

What if b is zero?

The expression is already a multiple of a square plus a constant: ax² + c = a(x − 0)² + c. Its vertex lies on the vertical axis at (0,c). You should still enter zero explicitly in the b field.

Does completing the square always give real roots?

The rewritten form exists for every real quadratic with a nonzero leading coefficient. Real roots are a separate matter. If solving requires a real square to equal a negative number, there are no real roots, although complex roots can be found.

Why does the vertex have the opposite sign to the bracket?

At the vertex, the squared bracket equals zero. For (x + 3)², that happens when x = −3. Reading the sign directly without setting the bracket to zero is a common reason for placing the vertex on the wrong side of the graph.

9

Sources & References