Mathematics calculator

Completing the Square Calculator

Rewrite a quadratic in vertex form and identify its vertex, opening direction, and discriminant.

Calculator inputs

Enter your values

Quadratic vertex form
Calculated output

Result summary

Your result will appear here

Complete the required fields and select the calculate button.

A parabola labelled with its vertex h comma k and axis of symmetry
Vertex form makes the turning point (h, k) and the direction of opening easy to read.

What Does Completing the Square Mean?

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.

How to Enter a Quadratic Expression

  1. Write the expression as ax² + bx + c. Enter its signed Coefficient a, Coefficient b and Constant c.
  2. Enter 0 for a missing linear or constant term. The leading coefficient a must be nonzero; decimal coefficients are allowed.
  3. Choose Decimal places as an integer from 0 to 12. This field controls output rounding, not the underlying mathematical definition.
  4. Select Calculate. Read the featured vertex form with the vertex, separate h and k coordinates, discriminant and opening direction.

The calculator computes h = −b/(2a) and k = c − b²/(4a), then builds y = a(x − h)² + k. It rounds the displayed leading coefficient, h, k and discriminant to the selected number of decimal places. It does not display an input-specific algebra derivation, solve for roots or draw a new graph.

Choose enough decimal places to retain the coefficients you need. A small nonzero a can display as 0 if you choose too little precision, even though the opening direction still uses its original sign. The rounded expression can therefore differ substantially from the original. Keep exact fractions or unrounded coefficients for proof and precise substitution.

Completing the Square Formula

ax² + bx + c = a[x² + (b/a)x] + c

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

h = −b ÷ (2a); k = c − b² ÷ (4a)

Vertex form: y = a(x − h)² + k

Discriminant Δ = b² − 4ac

First factor a from the quadratic and linear terms. Half of the inside linear coefficient b/a is b/(2a). Adding its square inside the bracket also adds a times that amount to the full expression, so subtract b²/(4a) outside to keep equality.

The OpenStax quadratic equations chapter develops completing the square. The method requires a ≠ 0. It is an identity for every x, while solving ax² + bx + c = 0 asks for particular x values.

The vertex is (h, k), and the sign inside x − h is opposite to the sign of h. For example, x + 3 means h = −3. These formulas describe the unrounded quadratic; the displayed form may approximate it after rounding.

Coefficients, Vertex and Discriminant

Coefficient a
Nonzero coefficient of x². Its original sign determines Upward or Downward opening.
Coefficient b
Signed coefficient of x; use 0 if that term is absent.
Constant c
Term independent of x; use 0 when absent.
Decimal places
Integer from 0 through 12 controlling displayed coefficients and results.
Completed-square form
Featured y = a(x − h)² + k, using rounded display values.
Vertex (h, k)
Turning point. h is the horizontal coordinate and k is the vertical coordinate.
Discriminant Δ
b² − 4ac, displayed at the chosen precision. A rounded zero can hide a small nonzero value.
Parabola opens
Upward for original a > 0 and Downward for original a < 0. The illustration is static, not a plot of the entries.

Completing the Square Worked Example

Illustrative example. Rewrite 3x² − 12x + 7. Enter a = 3, b = −12, c = 7 and Decimal places = 4.

Factor the first two terms: 3(x² − 4x) + 7. Half of −4 is −2, whose square is 4. Add and subtract 4 inside: 3[(x − 2)² − 4] + 7.

Distribute and combine constants to obtain 3(x − 2)² − 5. The vertex is (2, −5), the opening is Upward and the discriminant is (−12)² − 4 × 3 × 7 = 60. Expanding the completed form returns 3x² − 12x + 7.

Calculation check. These illustrative values were checked independently against the formula and calculator response. Retain unrounded intermediate values when checking approximations.

Completing the Square Worked Example
ResultValue
Completed-square formy = 3(x − 2)² − 5
Vertex(2, −5)
Discriminant60
OpeningUpward

Vertex Form and the Discriminant

Vertex form identifies a turning point; the discriminant describes real roots when the quadratic is set equal to zero. Apply these rules to unrounded values, since a small discriminant can display as zero.

Vertex Form and the Discriminant
ConditionMeaning
a > 0Vertex gives a minimum; opens upward
a < 0Vertex gives a maximum; opens downward
Δ > 0Two distinct real roots
Δ = 0One repeated real root
Δ < 0No real roots; two nonreal complex roots

How to Read Vertex Form

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.

The discriminant describes roots of the corresponding equation ax² + bx + c = 0: positive means two distinct real roots, zero means one repeated real root, and negative means no real roots. Those statements apply to the unrounded discriminant. If a small positive or negative value rounds to zero, increase the precision before classifying roots.

A low-precision output is a display approximation, not a new exact identity. For example, a = 0.04 at zero decimal places displays a leading coefficient of 0. That output no longer preserves the original quadratic shape, so choose more places instead of using it as exact algebra.

Common Completing the Square 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.

Frequently Asked Questions

What does completing the square do?

It rewrites ax² + bx + c as a(x − h)² + k. The unrounded expressions are equal for every x, and the vertex is (h,k).

What if the coefficient of x² is not 1?

Factor a out of the quadratic and linear terms before completing the square inside. The constant correction must include that outside factor.

Why can a not be zero?

The expression would no longer be quadratic. The formulas h = −b/(2a) and k = c − b²/(4a) would also divide by zero.

How do I find the vertex from the answer?

Read h and k from a(x − h)² + k. A plus sign inside x + 3 means h = −3, not +3.

Does the calculator return quadratic roots?

No. It returns vertex form, the vertex, opening direction and discriminant. Solving the corresponding equation for x is a separate step.

What does a negative discriminant mean?

For real coefficients, the equation ax² + bx + c = 0 has no real roots and has two nonreal complex roots. Use the unrounded discriminant when classifying it.

Why does expanding the displayed form give different coefficients?

The page rounds a, h and k to your selected decimal places. Low precision can change the displayed expression. Increase precision or keep exact fractions when checking equality.

Can a nonzero leading coefficient display as zero?

Yes. For example, a = 0.04 rounds to 0 at zero decimal places. Choose enough places to retain the original quadratic coefficient before using the displayed form.

Sources and References