ThisCalculator

Math

Complete the Square Calculator: Steps & Examples

Updated · Standard formula, shown below

The calculator for this page is switched off while it is checked. The formula is below, and the worked example in the article shows how to use it by hand.

Complete the Square Calculator: Steps & Examples

This calculator completes the square for a quadratic expression of the form ax² + bx + c, rewriting it as a(x − h)² + k. You enter the coefficients a, b, and c, and the calculator returns the completed-square form, the vertex (h, k), and the discriminant. It shows the exact steps used, so you can check your own work or learn the method.

Formula

For a quadratic expression ax² + bx + c (with a ≠ 0), completing the square rewrites it as:

a(x − h)² + k

where:

  • h = −b / (2a)
  • k = c − b² / (4a)

All variables are real numbers. The coefficient a is the same in both forms. The vertex of the parabola is at (h, k). If a is positive, the parabola opens upward; if negative, it opens downward.

Worked Example

Using the default values: a = 1, b = 6, c = 8.

  1. Compute h = −b / (2a) = −6 / (2·1) = −3.
  2. Compute k = c − b² / (4a) = 8 − 36 / 4 = 8 − 9 = −1.
  3. Write the result: (x − (−3))² + (−1) = (x + 3)² − 1.

So the completed square is (x + 3)² − 1, and the vertex is (−3, −1). The discriminant is b² − 4ac = 36 − 32 = 4, which is positive, so the quadratic has two real roots.

Why Complete the Square?

Completing the square is a technique used to solve quadratic equations, graph parabolas, and evaluate integrals. It converts the standard form into vertex form, which directly reveals the maximum or minimum point of the parabola. This is useful in physics for projectile motion, in economics for profit maximization, and in geometry for finding the center of circles from their equations.

The method also helps derive the quadratic formula. By completing the square on the general quadratic equation ax² + bx + c = 0, you get the well-known solution x = (−b ± √(b² − 4ac)) / (2a). Understanding this derivation makes the formula easier to remember and trust.

How to Use the Calculator

Enter the coefficients a, b, and c from your quadratic expression. Make sure the expression is in standard form ax² + bx + c, with all terms on one side. For example, if you have 2x² − 8x + 5, enter a = 2, b = −8, c = 5. The calculator will output the completed square, the vertex, and the discriminant.

If your expression is not in standard form, rearrange it first. For instance, 3x² + 12x = 7 becomes 3x² + 12x − 7 = 0, so a = 3, b = 12, c = −7. The calculator works for any real numbers, including fractions and decimals.

Common Mistakes and Tips

  • Forgetting to factor out a: If a ≠ 1, you must factor it out before completing the square. For example, 2x² + 8x becomes 2(x² + 4x). The calculator does this automatically.
  • Sign errors: When b is negative, h becomes positive. Double-check the formula h = −b/(2a). For b = −6, h = 3.
  • Mixing up h and k: The vertex is (h, k), not (−h, k). In the completed form (x − h)² + k, the vertex is (h, k).
  • Rounding too early: If you round intermediate values, the final result may be inaccurate. Keep full precision until the end.

Limitations and When to Use Alternatives

Completing the square works for any quadratic, but it is not always the fastest method. If you only need the roots, factoring or the quadratic formula may be quicker. If you need the vertex, completing the square is ideal. For graphing, vertex form is easiest to plot.

This calculator assumes a is not zero. If a = 0, the expression is linear, not quadratic, and completing the square is not defined. Also, the discriminant tells you about roots: if positive, two real roots; if zero, one repeated root; if negative, no real roots (two complex roots). The calculator gives the discriminant but does not compute complex roots.

Frequently Asked Questions

What does “complete the square� mean?

It means rewriting a quadratic expression ax² + bx + c as a(x − h)² + k, where h and k are constants. This form makes the vertex obvious and is useful for solving equations and graphing.

Can I use this calculator for equations with fractions?

Yes, you can enter decimal or fractional coefficients. However, the calculator outputs decimals, so if you need an exact fraction form, you may need to convert manually. For example, entering a = 0.5, b = 1, c = 2 gives h = −1 and k = 1.5.

Why is the vertex (−h, k) and not (h, k)?

In the form a(x − h)² + k, the vertex is at (h, k). Some textbooks write a(x + p)² + q, where the vertex is (−p, q). The calculator uses the standard (x − h)² form, so the vertex is (h, k).

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

Set the quadratic equal to zero, complete the square to get a(x − h)² + k = 0, then isolate (x − h)², take the square root, and solve for x. For example, x² + 6x + 8 = 0 becomes (x + 3)² − 1 = 0, so (x + 3)² = 1, giving x = −2 or x = −4.

What if a is negative?

If a is negative, the parabola opens downward, and the vertex is a maximum. The formulas still work. For example, −x² + 4x − 1 has a = −1, b = 4, c = −1, giving h = 2, k = 3, so the vertex is (2, 3) and the maximum value is 3.

Does completing the square always work?

Yes, for any quadratic with a ≠ 0, the algebraic manipulation always works. It never fails, though it can be tedious for large coefficients. The calculator handles the arithmetic for you.

Related

Formula used
in a | a | - | 1 | 0
in b | b | - | 6 | 0
in c | c | - | 8 | 0
out form | Completed square | - | a*(x - (-b/(2*a)))^2 + (c - b^2/(4*a)) | 2
out vertex_x | Vertex x (h) | - | -b/(2*a) | 2
out vertex_y | Vertex y (k) | - | c - b^2/(4*a) | 2
out disc | Discriminant | - | b^2 - 4*a*c | 0

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.