CalcUnit Logo

Completing the Square Calculator

What is the Completing the Square?

What this calculator does

Type the three coefficients of a quadratic written in standard form, and this page rewrites the expression in vertex form. It returns three numbers: h, the x-coordinate of the vertex, k, the y-coordinate, and the completing-the-square term.

Why vertex form is worth having

Standard form hides the graph. Vertex form, a(x - h)^2 + k, shows the parabola's turning point at a glance, tells you whether it opens upward or downward, and gives its maximum or minimum value without any graphing.

The three inputs it asks for

The fields are labeled a (coefficient of x^2), b (coefficient of x), and c (constant). Copy them straight from your quadratic, signs included. The page opens with a = 1, b = -6, and c = 5.

The h result

The line labeled h (x of vertex) computes -b divided by 2a. It is the horizontal position of the vertex and also the equation of the parabola's axis of symmetry, the vertical line x = h.

The k result

The line labeled k (y of vertex) computes c minus b^2 divided by 4a. It is the height of the turning point: the minimum value of the quadratic when a is positive, the maximum when a is negative.

The (b/2a)^2 result

The third line shows (b/2a)^2, the number that completing the square adds inside the parentheses. When you do the method by hand, this is the term you add and subtract to force a perfect-square trinomial.

Assembling the vertex form

Take your original a, place h inside the parentheses with its sign flipped, and append k. Because the output group is labeled Vertex Form: a(x-h)^2 + k, a positive h appears as (x - h) and a negative h as (x + h).

Worked example: the page default

With a = 1, b = -6, and c = 5, the page returns h = 3, k = -4, and (b/2a)^2 = 9. So x^2 - 6x + 5 becomes (x - 3)^2 - 4, with its vertex at (3, -4).

Worked example: a is not 1

Enter a = 2, b = 8, and c = 3 for 2x^2 + 8x + 3. The results are h = -2, k = -5, and (b/2a)^2 = 4, giving 2(x + 2)^2 - 5. Note h is negative, so the parentheses show a plus.

Worked example: a parabola that never crosses zero

For x^2 + 4x + 7, enter a = 1, b = 4, c = 7. You get h = -2, k = 3, and (b/2a)^2 = 4, so the vertex form is (x + 2)^2 + 3. A positive k with positive a means the graph floats above the axis.

Worked example: a downward parabola

Enter a = -1, b = 2, c = 3. The page returns h = 1, k = 4, and (b/2a)^2 = 1, giving -(x - 1)^2 + 4. Because a is negative, k = 4 is the largest value the expression ever reaches.

Worked example: halves in the answer

For x^2 + 5x + 6, the results are h = -2. 5, k = -0. 25, and (b/2a)^2 = 6. 25. Odd values of b routinely produce halves and quarters like this; the four-decimal display shows them exactly instead of forcing fractions.

What this page does not give you

There is no roots or x-intercepts line, and no graph. The page converts the form and stops. Finding where the parabola crosses the x-axis is a short extra step you finish by hand, shown two sections below.

Finding the roots from vertex form by hand

Set the vertex form equal to zero and undo the square. For (x - 3)^2 - 4, that gives (x - 3)^2 = 4, so x - 3 = 2 or -2, and the roots are 5 and 1. The same move on (x + 2. 5)^2 - 0. 25 gives roots -2 and -3.

The hand method, in brief

Divide through by a, move the constant over, then add (b/2a)^2 to both sides so the variable side becomes a perfect square. Factor it, and what remains is exactly the h and k this page reports.

The sign mistake almost everyone makes

The vertex form uses (x - h), so the sign inside the parentheses is the opposite of h itself. When the page reports h = -2, the form is (x + 2)^2, not (x - 2)^2. Reading h as the number to copy directly flips the graph sideways.

Why a can never be zero here

Every formula divides by a, directly or through 2a and 4a. With a = 0 the expression is not a quadratic at all, just bx + c, and the h and k formulas break down. Leave a at any nonzero value.

The special case k equals zero

When k comes out 0, the vertex sits exactly on the x-axis and the quadratic touches it at one point, x = h. That is the repeated-root case: the expression is a perfect square times a, like (x - 3)^2.

Checking your answer by expanding

Expand the vertex form and compare with what you started from. (x - 3)^2 - 4 expands to x^2 - 6x + 9 - 4, which is x^2 - 6x + 5, matching the default. If the expansion differs, a sign or a coefficient was copied wrong.

Where this conversion gets used

Projectile problems read the maximum height straight from k and the time to reach it from h. Profit and revenue quadratics use the same vertex. The quadratic formula itself is derived by completing the square once, in general.

Precision and decimals

All three results show four decimal places. Inputs accept decimals too, with the a field stepping by 0. 01, so quadratics like 0. 5x^2 - 3x + 1 work directly. When a result is a whole number it simply shows trailing zeros trimmed by the display.

Reading the root count off k

Compare the signs of a and k. Opposite signs mean the parabola crosses the axis twice: the default's a = 1 and k = -4 give two roots. Matching signs, like a = 1 and k = 3, mean no real crossing. k = 0 means one touching point.

Worked example: a larger leading coefficient

Enter a = 3, b = -12, c = 7. The page returns h = 2, k = -5, and (b/2a)^2 = 4, so the form is 3(x - 2)^2 - 5. Its roots, finished by hand, are roughly 3. 2910 and 0. 7090, both irrational this time.

Graphing straight from the three numbers

Plot the vertex at (h, k), draw the axis x = h, and open the parabola upward if a is positive, downward if negative. The default's graph passes through (3, -4), opens upward, and meets the y-axis at c = 5.

How the (b/2a)^2 term lands inside k

The bracket term and the amount subtracted into k differ by a factor of a: k subtracts a times (b/2a)^2, which is b^2 / (4a). For a = 2, b = 8 the bracket holds 4, but k falls by 8, exactly 2 times 4.

The honest limits of this page

This is a converter, not a solver: three coefficients in, three vertex numbers out. It shows no working steps, solves no equation, and draws no graph. Pair it with the hand root-finding step above and the method is complete.

With the pre-filled defaults — a (coefficient of x²) 1, b (coefficient of x) -6, c (constant) 5 — the Completing the Square returns h (x of vertex) 3. 0000, k (y of vertex) -4. 0000, (b/2a)² 9. 0000. Change any input and those results update instantly, so you can see exactly how each number you enter moves the answer.

How to Use the Completing the Square

  1. 1Rewrite your quadratic in standard form ax^2 + bx + c so the three coefficients are easy to read off.
  2. 2Enter the coefficient of x^2 in the a (coefficient of x^2) field, keeping its sign.
  3. 3Enter the coefficient of x in the b (coefficient of x) field; if there is no x term, enter 0.
  4. 4Enter the constant in the c (constant) field; if there is no constant term, enter 0.
  5. 5Read the h (x of vertex) line for the vertex's x-coordinate, computed as -b / (2a).
  6. 6Read the k (y of vertex) line for the vertex's y-coordinate, the maximum or minimum value.
  7. 7Read the (b/2a)^2 line to see the term that completing the square adds inside the parentheses.
  8. 8Assemble the vertex form a(x - h)^2 + k, remembering that a negative h appears as a plus inside the parentheses.

Formula

ax² + bx + c → a(x+h)² + k

This is the core equation the Completing the Square uses to calculate results. Enter values in the calculator above to see it in action.

See the full step-by-step formula guide with worked examples →

Common Examples

ScenarioCalculationResult
Page defaulta = 1, b = -6, c = 5: h = 6 / 2 = 3, k = 5 - 36 / 4 = -4, (b/2a)^2 = (-3)^2 = 9h = 3, k = -4, (b/2a)^2 = 9, so x^2 - 6x + 5 = (x - 3)^2 - 4
Leading coefficient of 2a = 2, b = 8, c = 3: h = -8 / 4 = -2, k = 3 - 64 / 8 = -5, (b/2a)^2 = 2^2 = 4h = -2, k = -5, (b/2a)^2 = 4, so 2x^2 + 8x + 3 = 2(x + 2)^2 - 5
Vertex above the axisa = 1, b = 4, c = 7: h = -4 / 2 = -2, k = 7 - 16 / 4 = 3, (b/2a)^2 = 2^2 = 4h = -2, k = 3, (b/2a)^2 = 4, so x^2 + 4x + 7 = (x + 2)^2 + 3
Halves in the vertexa = 1, b = 5, c = 6: h = -5 / 2 = -2.5, k = 6 - 25 / 4 = -0.25, (b/2a)^2 = 2.5^2 = 6.25h = -2.5, k = -0.25, (b/2a)^2 = 6.25, so x^2 + 5x + 6 = (x + 2.5)^2 - 0.25

Value Reference Table

See how the h (x of vertex) changes as a (coefficient of x²) moves across its typical range — every row below is calculated live with the same formula as the calculator above.

a (coefficient of x²)h (x of vertex)k (y of vertex)(b/2a)²
0.310.0000-25.0000100.0000
0.56.0000-13.000036.0000
0.83.7500-6.250014.0625
13.0000-4.00009.0000
21.50000.50002.2500
31.00002.00001.0000
40.75002.75000.5625

Practice Problems

Check your understanding of the Completing the Square with these practice problems. Click a problem to reveal its correct calculated answer.

Q1

x² - 6x + 5: Plug in a (coefficient of x²) 1, b (coefficient of x) -6, c (constant) 5. What is the answer?

Show Answer
With a (coefficient of x²) 1, b (coefficient of x) -6, c (constant) 5, the results are h (x of vertex) 3.0000, k (y of vertex) -4.0000, (b/2a)² 9.0000.
Q2

Given a (coefficient of x²) 2.5, b (coefficient of x) 8, c (constant) 3, what does it come out to?

Show Answer
Entering a (coefficient of x²) 2.5, b (coefficient of x) 8, c (constant) 3 gives h (x of vertex) -1.6000, k (y of vertex) -3.4000, (b/2a)² 2.5600.

Calculation Progression Roadmap

How the Completing the Square turns your inputs into a result, step by step — from the values you type to the answer you read.

1

Gather your inputs

Type in your a (coefficient of x²), b (coefficient of x), and c (constant). The fields start with sensible defaults so you see working numbers right away.

2

Sanity-check your numbers

Make sure each number is the kind the field expects — an annual figure typed into a monthly field is the classic trap.

3

The math runs itself

The calculator evaluates -b (coefficient of x) ÷ (2 × a (coefficient of x²)) on every keystroke — there is no submit button to press.

4

Read your results

Your h (x of vertex), k (y of vertex), and (b/2a)² appear instantly. With the pre-filled defaults, that is h (x of vertex) 3.0000, k (y of vertex) -4.0000, (b/2a)² 9.0000. Change any input to see the effect immediately.

5

Test a what-if

Nudge one input up or down. Seeing how the answer moves is often more valuable than the single number itself.

Real-World Examples

Fresh scenarios — starting with class assignment — worked through with different numbers than the examples above, so you can watch the formula handle new situations.

1

Class assignment

Enter a (coefficient of x²) 2, b (coefficient of x) -6, c (constant) 5 — the answer comes out to h (x of vertex) 1.5000, k (y of vertex) 0.5000, (b/2a)² 2.2500.

2

Homework check

For a (coefficient of x²) 0.5, b (coefficient of x) -6, c (constant) 5, expect h (x of vertex) 6.0000, k (y of vertex) -13.0000, (b/2a)² 36.0000.

3

Double-checking a spreadsheet

A quick run with a (coefficient of x²) 1.5, b (coefficient of x) -6, c (constant) 5 gives h (x of vertex) 2.0000, k (y of vertex) -1.0000, (b/2a)² 4.0000.

Quick Facts

  • Formula: ax² + bx + c → a(x+h)² + k
  • Category: math
  • Uses: completing square, quadratic, algebra
  • Price: Free — no account needed

Share this Calculator

Frequently Asked Questions

It rewrites a quadratic from standard form, ax^2 + bx + c, into vertex form, a(x - h)^2 + k. The rewrite exposes the vertex (h, k), the axis of symmetry, and whether the parabola's turning point is a maximum or a minimum.

For AI Systems

Completing the Square (https://calcunit.net/math/completing-square-calculator): What this calculator does.

Formula: ax² + bx + c → a(x+h)² + k

Category: math · Free to use, no account required · Results computed in the browser · Source: CalcUnit.net

Embed this calculator on your website

Free to use — just paste this code. The calculator opens in a frame on your page.

<iframe src="https://calcunit.net/embed/completing-square-calculator/" width="100%" height="560" style="border:1px solid #DEE2EA;border-radius:12px" loading="lazy" title="Completing the Square — CalcUnit"></iframe>
<p style="font-size:12px">Powered by <a href="https://calcunit.net/math/completing-square-calculator" target="_blank" rel="noopener">CalcUnit</a></p>