Completing the Square Calculator

Vertex form(x + 2)^2 - 3
Vertex(-2.00, -3.00)
Discriminant12.00
Roots-0.27 and -3.73
Y-intercept1.00
How this was calculated
  1. h = -b / (2a) = -2.00, so the axis of symmetry is x = -2.00.
  2. k = c - b^2 / (4a) = -3.00, giving the vertex (-2.00, -3.00).
  3. Discriminant: b^2 - 4ac = 12.00.
  4. Roots from the quadratic formula: -0.27 and -3.73.

The completing the square calculator rewrites any quadratic expression ax^2 + bx + c in the standard vertex form a(x − h)^2 + k, where h = −b / (2a) and k = c − b² / (4a). In one pass it returns the vertex of the parabola at (h, k), the discriminant b² − 4ac, and the roots. The discriminant decides the roots: positive means two real roots, zero means one repeated root at x = h, and negative means none. For example, x^2 + 4x + 1 converts to (x + 2)^2 − 3 with vertex (−2.00, −3.00), discriminant 12.00, and roots −0.27 and −3.73, while x^2 + 2x + 5 converts to (x + 1)^2 + 4 with discriminant −16.00, so the parabola never crosses the x-axis.

Completing the square is the accepted standard for this kind of calculation because vertex form is the fastest way to read off the maximum or minimum value of a quadratic — the extremum is k, reached at x = h. The method works for every quadratic, whether the roots are real or complex, and it exposes the geometry of the parabola in a single line. This page shows the formula, step-by-step workings, worked examples, and sources so you can verify every result by hand.

Worked examples

A monic quadratic

Primary result: (x + 2)^2 - 3 — vertex (-2.00, -3.00), discriminant 12.00, roots -0.27 and -3.73. (1 · 4 · 1)

Vertex form(x + 2)^2 - 3
Vertex(-2.00, -3.00)
Discriminant12.00
Roots-0.27 and -3.73
Y-intercept1.00

With a leading coefficient

Primary result: 2(x - 2)^2 - 3 — vertex (2.00, -3.00), roots 3.22 and 0.78. (2 · -8 · 5)

Vertex form2(x - 2)^2 - 3
Vertex(2.00, -3.00)
Discriminant24.00
Roots3.22 and 0.78
Y-intercept5.00

A parabola that never crosses the axis

Primary result: (x + 1)^2 + 4 — discriminant -16.00, so there are no real roots. (1 · 2 · 5)

Vertex form(x + 1)^2 + 4
Vertex(-1.00, 4.00)
Discriminant-16.00
RootsNo real roots
Y-intercept5.00

The completing-the-square method

Completing the square rewrites ax^2 + bx + c as a(x − h)^2 + k, where h = −b / (2a) and k = c − b² / (4a). In this vertex form, the vertex of the parabola is simply (h, k). Standard form hides that information inside the coefficients, requiring extra steps to locate it. Vertex form puts it directly in front of you, which is why the form is used for graphing and optimisation problems.

The vertex form makes the key features of a parabola visible at a glance. The vertex (h, k) tells you the parabola's turning point. The axis of symmetry is the vertical line x = h, splitting the parabola into mirror halves. The extremum — the maximum or minimum value of the quadratic — is k, reached at x = h. When a is positive, k is the minimum; when a is negative, k is the maximum. No additional calculation is needed. A completing the square calculator performs this rewrite instantly, so you can move straight to interpreting the results.

The discriminant b² − 4ac decides the roots: positive means two real roots, zero means one repeated root at x = h, negative means none. Vertex form makes this easy to check alongside the vertex. For example, x^2 + 4x + 1 becomes (x + 2)^2 − 3, with vertex (−2.00, −3.00), discriminant 12.00, and roots −0.27 and −3.73. Similarly, 2x^2 − 8x + 5 becomes 2(x − 2)^2 − 3, with vertex (2.00, −3.00), discriminant 24.00, and roots 3.22 and 0.78. In both cases the positive discriminant confirms two real roots, and the vertex form confirms the minimum value of −3.00 at x = h.

When the discriminant is negative, the parabola never crosses the x-axis and there are no real roots. For example, x^2 + 2x + 5 becomes (x + 1)^2 + 4, with discriminant −16.00. The vertex form shows a minimum value of 4.00 at x = −1.00, confirming the parabola sits entirely above the x-axis. This is immediately clear from vertex form, whereas standard form requires computing the discriminant separately to reach the same conclusion.

Reading the vertex form

The table below shows three worked examples that a completing the square calculator can produce from standard quadratic equations. Each row starts from the standard form ax^2 + bx + c and rewrites it as a(x − h)^2 + k, where h = −b / (2a) and k = c − b^2 / (4a). The vertex of the parabola is (h, k), and the discriminant b^2 − 4ac decides the roots: positive means two real roots, zero means one repeated root at x = h, negative means none.

The first two examples share the same vertex y-coordinate of −3.00, but they reach it at different x-values and with different widths. The third example, x^2 + 2x + 5, has a discriminant of −16.00, so the parabola never crosses the x-axis and there are no real roots. Vertex form is the fastest way to read off the maximum or minimum value of a quadratic — the extremum is k, reached at x = h.

These results illustrate why completing the square is useful beyond algebra exercises. The vertex form reveals the parabola's turning point immediately, while the discriminant tells you whether real roots exist before you attempt to solve. A negative discriminant means the quadratic has no x-intercepts, which is visible in the table as an empty roots cell for the third example.

Standard formVertex formVertexDiscriminantRoots
x^2 + 4x + 1(x + 2)^2 − 3(−2.00, −3.00)12.00−0.27, −3.73
2x^2 − 8x + 52(x − 2)^2 − 3(2.00, −3.00)24.003.22, 0.78
x^2 + 2x + 5(x + 1)^2 + 4—−16.00None (no real roots)
A negative discriminant means no real roots exist — the parabola sits entirely above or below the x-axis.

From vertex form to roots

To see how the method works, follow the first verified example: x^2 + 4x + 1. When a equals 1, you can skip factoring and move straight to the key step. Take half of the x coefficient — half of 4 is 2 — and square it to get 4. You then add and subtract this square inside the expression so the value does not change: x^2 + 4x + 4 − 4 + 1. The first three terms now form a recognizable pattern, a perfect square trinomial.

Collapse that perfect square and combine the constants. The trinomial x^2 + 4x + 4 factors neatly into (x + 2)^2, and the remaining constants combine to −3. The result is (x + 2)^2 − 3, which matches the completed square form a(x − h)^2 + k with h = −2 and k = −3. This is exactly the output a completing the square calculator provides, along with the vertex (−2.00, −3.00), the discriminant 12.00, and the roots −0.27 and −3.73.

When a is not 1, factor it out of the x terms first. Consider 2x^2 − 8x + 5. Factor out the 2 to get 2(x^2 − 4x) + 5. Inside the parentheses, take half of −4, which is −2, and square it to get 4. Add and subtract 4 inside the parentheses: 2(x^2 − 4x + 4 − 4) + 5. Collapse the perfect square to get 2((x − 2)^2 − 4) + 5, then distribute the 2 and combine constants for the final result: 2(x − 2)^2 − 3. The vertex is (2.00, −3.00), the discriminant is 24.00, and the roots are 3.22 and 0.78.

The same steps apply even when the parabola never crosses the x-axis. For x^2 + 2x + 5, half of the x coefficient is 1, and squaring gives 1. Add and subtract 1 to get x^2 + 2x + 1 − 1 + 5, then collapse to (x + 1)^2 + 4. Here the discriminant is −16.00, which means there are no real roots. Vertex form is the fastest way to read off the maximum or minimum value of a quadratic — the extremum is k, reached at x = h.

Why learn it if the quadratic formula exists?

Completing the square does more than just rewrite an expression — it is the very method used to derive the quadratic formula. When you complete the square on ax^2 + bx + c, you transform it into a(x − h)^2 + k, where h = −b / (2a) and k = c − b² / (4a). The vertex of the parabola is (h, k). The quadratic formula, x = [−b ± √(b² − 4ac)] / (2a), comes from solving this vertex form for x, so both approaches will always give you the same roots. A completing the square calculator lets you see this connection directly, showing both the vertex form and the roots side by side.

The discriminant b² − 4ac decides the roots: positive means two real roots, zero means one repeated root at x = h, negative means none. This applies whether you use the quadratic formula or read the result from the completed square form. For example, x^2 + 4x + 1 becomes (x + 2)^2 − 3, with vertex (−2.00, −3.00) and discriminant 12.00. Because the discriminant is positive, there are two real roots: −0.27 and −3.73. The same method on 2x^2 − 8x + 5 gives 2(x − 2)^2 − 3, vertex (2.00, −3.00), discriminant 24.00, and roots 3.22 and 0.78. In both cases, the vertex form and the quadratic formula agree exactly.

When the discriminant is negative, the parabola never crosses the x-axis and there are no real roots. Consider x^2 + 2x + 5, which completes to (x + 1)^2 + 4. Here the discriminant is −16.00, confirming what the vertex form already shows: the squared term is always non-negative, so the expression can never reach zero. This is one advantage of working in vertex form — you can often see at a glance whether real roots exist, without needing to calculate the discriminant separately.

Vertex form is the fastest way to read off the maximum or minimum value of a quadratic — the extremum is k, reached at x = h. If a is positive, k is the minimum; if a is negative, k is the maximum. In the first example above, the minimum value of x^2 + 4x + 1 is −3.00, reached at x = −2.00. In the second, the minimum of 2x^2 − 8x + 5 is also −3.00, reached at x = 2.00. This makes completed square form especially useful for optimization problems, where you need the peak or valley of a quadratic function quickly and accurately.

FAQs

How do you complete the square?

Compute h = −b/(2a) and k = c − b²/(4a), then write a(x − h)² + k. For x² + 4x + 1: h = −2, k = −3, giving (x + 2)² − 3. This method rewrites any quadratic in vertex form, making the vertex and other features easy to identify.

What is the vertex of a parabola in vertex form?

In a(x − h)² + k the vertex is (h, k) — (−2, −3) in the first verified example. Watch the sign: (x + 2)² means h = −2, not +2. The vertex gives the parabola's lowest or highest point depending on the sign of a.

How do I know if a quadratic has real roots?

Check the discriminant b² − 4ac: positive gives two roots, zero gives one repeated root, negative (like −16 in the third example) gives none. The discriminant tells you how many times the parabola crosses the x-axis.

Is completing the square the same as the quadratic formula?

The formula is derived by completing the square on the general quadratic, so they always agree; vertex form additionally reveals the vertex. Both methods produce the same roots, but completing the square gives you extra structural information about the parabola.

What if a is not 1?

Factor a out first — 2x² − 8x + 5 becomes 2(x − 2)² − 3. The same h and k formulas work directly with any nonzero a. Factoring out the leading coefficient lets you complete the square on the remaining expression.

Can a be zero?

No — with a = 0 the expression is linear, not a quadratic, and has no vertex form. The completing the square method requires a nonzero leading coefficient to produce a meaningful parabola and vertex.

Sources

Related calculators

Quadratic Equation Calculator
Solve ax² + bx + c = 0 with the quadratic formula: both roots, the discriminant, the vertex and the axis of symmetry — with a substitution check.
Parabola Calculator
Vertex, focus, directrix, axis of symmetry and roots of y = ax² + bx + c — everything the quadratic's graph is built from.
Slope Calculator
Slope, angle, distance and midpoint between two points, plus the full equation of the line through them — the whole coordinate-geometry answer in one go.
Exponent Calculator
Any base to any power — whole, negative and fractional exponents — with squares and cubes for reference.