CalculatorForEver
MATH / CALCULATOR

Completing the Square Calculator

Calculate completing the square with worked steps, clear input conventions and a result table.

The vertex form is a(x + b/(2a))² + c − b²/(4a). Thus h = −b/(2a) and k = c − b²/(4a). For 2x²+8x+3, the equivalent form is 2(x+2)²−5.

Your numbers

BROWSER-LOCAL INPUTS

Your inputs stay in this browser. No account needed.

RESULT

Your result

Enter your values and select Calculate.

Check the units and assumptions before using this result.

METHOD

How the completing the square calculator works

How to use this calculator

Enter the values in the stated format. Calculate and review the method, exact distinctions and any numerical limits before using the result.

What the result means

Completing the square rewrites a quadratic as a squared expression plus a constant. For ax²+bx+c with a nonzero, factor out a from the x terms, add the square needed inside the brackets, then compensate outside so the value stays unchanged. The resulting vertex form a(x−h)²+k makes the turning point visible. It can also support solving an equation, but rewriting an expression and setting that expression equal to zero are separate tasks.

The formula

ax²+bx+c = a(x + b/2a)² + c − b²/4a

A worked example

x² − 6x + 5 = (x − 3)² − 4.

Assumptions & methodology

Use consistent units and inspect the displayed working. Numerical results are rounded for display; unsupported or unstable inputs are rejected. Results are rounded for display; intermediate calculations retain precision. This tool is informational and does not replace institutional or professional guidance.

References

OpenStax: quadratic equations and completing the square

WORK THROUGH THE DETAILS

Using your completing the square result

Use vertex form to solve a related equation

If the task is 2x²+8x+3 = 0, substitute the completed form to get 2(x+2)²−5 = 0. Then (x+2)² = 2.5, so x = −2 ± √2.5. The two approximate roots are −0.418861 and −3.581139. The rewriting step itself is valid for all real x; the roots arise only after adding the equation’s zero condition. Preserve the plus-and-minus branches when taking the square root.

Work with fractions without premature rounding

For x²+3x+1, half of the linear coefficient is 3/2 and its square is 9/4. The expression becomes (x+3/2)²−5/4. Decimal form (x+1.5)²−1.25 describes the same values, but an early rounded approximation to a less convenient fraction can shift the constant. Keep b/(2a) and b²/(4a) intact until the final evaluation. If the coefficients came from measurements, extra displayed digits do not imply more accurate measurements.

Check a negative leading coefficient and a missing term

The expression −x²+6x−4 becomes −(x−3)²+5. Its vertex is (3,5), and it opens downward because a is −1. If b is zero, the horizontal shift is zero and the expression already has the form ax²+c. If a is zero, the input is linear rather than quadratic and this method’s divisions by a are undefined. Use Factoring when rational products answer the question more directly, or Quadratic when you primarily need roots.

Compare the vertex form with an expansion check

Expand 2(x+2)²−5 as 2(x²+4x+4)−5. Distribute the leading coefficient and combine constants to recover 2x²+8x+3. This check tests both the horizontal shift and the compensation term. For a general input, expanding a(x−h)²+k gives ax²−2ahx+ah²+k. The linear coefficient should equal b and the final constant should equal c. If either comparison fails, the rewritten expression is not equivalent. A plot can still look similar when coefficients differ slightly, so use algebraic substitution rather than appearance alone when validating a worked solution. Vertex form describes the same function at every x, not merely at its vertex. If the input has a negative c, preserve that sign during compensation. For x²+2x−3, the form is (x+1)²−4, because the square adds one before the outside constant removes four. Substituting x = 0 recovers the original constant −3 and supplies another quick check.

INTERPRETATION

Understanding completing the square results

Preserve equality while forming the square

Start with 2x²+8x+3 and take 2 outside the variable terms: 2(x²+4x)+3. Half of 4 is 2, and its square is 4. Replace x²+4x with (x+2)²−4, giving 2[(x+2)²−4]+3. Distributing the outside 2 gives 2(x+2)²−8+3, or 2(x+2)²−5. Forgetting that the compensation also gets multiplied by 2 would produce an unequal expression.

Read the sign inside the squared bracket

Vertex form uses x−h, so a bracket x+2 corresponds to h = −2. The constant outside is k = −5, giving vertex (−2,−5). Substitution confirms it: at x = −2, the square becomes zero. A positive a makes that value a minimum; a negative a makes it a maximum. The direction follows the sign of the coefficient multiplying the square, rather than the sign of h or k.

RELATED GUIDES

Related questions and worked examples

Read a worked explanation before trying another calculation.

QUESTIONS

Completing the Square questions

Does completing the square require integer roots?+

No. The rewrite works for real quadratic coefficients with nonzero a, even when an equation has irrational roots or no real roots.

Is the vertex always a minimum?+

Only when a is positive. With negative a, the squared term is multiplied by a negative number and the vertex is a maximum.