Completing the Square Calculator

Completing the Square Calculator

Run Completing the Square Calculator

Completing the Square Calculator: Rewrite ax² + bx + c in vertex form, find the vertex, and solve the quadratic equation with clear step-by-step working.

ax² + bx + c = 0
Copied successfully!

Completing the Square Explained

The Idea

Completing the square rewrites a quadratic so that it contains a perfect square, such as (x + 3)². Once the equation is in that form, you can read the vertex directly and solve by taking square roots.

ax² + bx + c = a(x − h)² + k
h = −b ÷ (2a) · k = c − b² ÷ (4a)

Key Step

After dividing by a, add (b ÷ 2a)² to both sides. This value turns x² + (b/a)x into the perfect square (x + b/2a)².

What Does It Mean to Complete the Square?

A completing the square calculator rewrites a quadratic expression ax² + bx + c in the form a(x − h)² + k. This is called vertex form, and it reveals the vertex of the parabola, the axis of symmetry, and the solutions of the equation ax² + bx + c = 0.

Completing the square is one of the core techniques of algebra. It is the method behind the quadratic formula, it is used to graph parabolas, and it reappears later in the study of circles, ellipses, and other conic sections.

This calculator does more than give the answer. It shows each algebraic step, from dividing by a to taking square roots, so you can follow the reasoning and check your own work.

The sections below explain the method, work through examples with whole numbers, a leading coefficient, and complex solutions, and list the mistakes students make most often.

Completing the Square Calculator Online Web App.
Completing the Square Calculator Online Web App.

What Is a Perfect Square Trinomial?

A perfect square trinomial is a three-term expression that factors into a squared binomial:

x² + 2px + p² = (x + p)²

For example, x² + 6x + 9 = (x + 3)², because 2 × 3 = 6 and 3² = 9.

Completing the square means adding exactly the right constant to x² + bx so that it becomes a perfect square. For x² + bx, that constant is (b ÷ 2)².


How Does the Calculator Work?

  1. Enter a, b, and c for the equation ax² + bx + c = 0. Coefficient a cannot be zero.
  2. Divide by a so the x² term has coefficient 1.
  3. Move the constant to the right side.
  4. Add (b ÷ 2a)² to both sides to complete the square.
  5. Factor the left side into a squared binomial.
  6. Take square roots of both sides and solve for x.
  7. Write the vertex form a(x − h)² + k.

The key results come from these formulas:

h = −b ÷ (2a)

k = c − b² ÷ (4a)

Discriminant D = b² − 4ac

x = h ± √D ÷ (2|a|)


Example 1: x² + 6x + 5 = 0

Step 1: Move the constant

x² + 6x = −5

Step 2: Add (6 ÷ 2)² = 9 to both sides

x² + 6x + 9 = −5 + 9 = 4

Step 3: Factor

(x + 3)² = 4

Step 4: Take square roots

x + 3 = ±2

Step 5: Solve

x = −1 or x = −5

The vertex form is (x + 3)² − 4, so the vertex is (−3, −4) and the axis of symmetry is x = −3.


Example 2: 2x² − 8x + 3 = 0

When a is not 1, divide by a first.

Step 1: Divide by 2

x² − 4x + 1.5 = 0

Step 2: Move the constant

x² − 4x = −1.5

Step 3: Add (−4 ÷ 2)² = 4 to both sides

x² − 4x + 4 = 2.5

Step 4: Factor and solve

(x − 2)² = 2.5 → x − 2 = ±1.5811

x ≈ 3.5811 or x ≈ 0.4189

For the vertex form, use h = −(−8) ÷ (2 × 2) = 2 and k = 3 − 64 ÷ 8 = −5. The vertex form is 2(x − 2)² − 5, with vertex (2, −5).


Example 3: Complex Solutions

Consider x² + 2x + 5 = 0.

x² + 2x = −5

x² + 2x + 1 = −4

(x + 1)² = −4

A real number squared cannot be negative, so there are no real solutions. Using the imaginary unit i, where i² = −1:

x + 1 = ±2i → x = −1 ± 2i

The vertex form is (x + 1)² + 4. The vertex (−1, 4) lies above the x-axis and the parabola opens upward, which is why it never crosses the x-axis.


Example 4: A Perfect Square

For x² − 4x + 4 = 0, the expression is already a perfect square:

(x − 2)² = 0 → x = 2

The discriminant is 0, so there is exactly one repeated root, and the vertex (2, 0) touches the x-axis.


What the Discriminant Tells You

DiscriminantNumber of Real SolutionsGraph
D > 0Two distinct real solutionsCrosses the x-axis twice
D = 0One repeated real solutionTouches the x-axis at the vertex
D < 0No real solutions (two complex)Does not touch the x-axis

The calculator reports the discriminant so you can see immediately what kind of solutions to expect.


Understanding Vertex Form

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

  • (h, k) is the vertex, the turning point of the parabola.
  • x = h is the axis of symmetry.
  • a controls the direction and width: positive a opens upward, negative a opens downward, and larger |a| makes the parabola narrower.
  • k is the minimum value of y when a > 0 and the maximum value when a < 0.

Watch the sign of h. In (x − 2)², h = 2. In (x + 3)², h = −3, because x + 3 = x − (−3).


Completing the Square and the Quadratic Formula

The quadratic formula comes directly from completing the square on the general equation ax² + bx + c = 0:

  1. Divide by a: x² + (b/a)x + c/a = 0
  2. Move c/a: x² + (b/a)x = −c/a
  3. Add (b/2a)²: (x + b/2a)² = (b² − 4ac) ÷ (4a²)
  4. Take square roots: x + b/2a = ±√(b² − 4ac) ÷ (2a)
  5. Solve: x = (−b ± √(b² − 4ac)) ÷ (2a)

This connection is described in standard algebra texts such as OpenStax Elementary Algebra, which presents completing the square as a general method for solving any quadratic equation.


Alternative Method: Factoring Out a

Instead of dividing the whole equation by a, many teachers prefer to factor a out of the x terms only. This keeps whole numbers longer and leads directly to vertex form.

For y = 2x² − 8x + 3:

y = 2(x² − 4x) + 3

Inside the parentheses, add and subtract (−4 ÷ 2)² = 4:

y = 2(x² − 4x + 4 − 4) + 3

y = 2(x − 2)² − 8 + 3

Vertex time t = −64 ÷ (2 × −16) = 2 seconds

The −4 inside the parentheses is multiplied by 2 when it comes out, which is why 8 is subtracted. Both methods give the same vertex form.


Application: Finding a Maximum Height

Completing the square is useful for optimization. Suppose the height of a ball, in feet, after t seconds is h(t) = −16t² + 64t + 5.

h = −16 · 64 ÷ (2 × −16)… in other words, the vertex time is t = −64 ÷ (2 × −16) = 2 seconds

Maximum height k = 5 − 64² ÷ (4 × −16) = 5 + 64 = 69 feet

In vertex form, h(t) = −16(t − 2)² + 69. Because a is negative, the parabola opens downward, and the vertex (2, 69) is the highest point: the ball reaches 69 feet after 2 seconds.

Enter a = −16, b = 64, and c = 5 in the calculator to see the same vertex.


When to Use Completing the Square

  • To graph a parabola: Vertex form gives the vertex and axis immediately.
  • To find a maximum or minimum: The value k is the optimum value of the quadratic.
  • To solve equations that don’t factor nicely.
  • To derive or understand the quadratic formula.
  • To rewrite equations of circles and other conics in standard form.

Common Mistakes When Completing the Square

Forgetting to Divide by a

The (b ÷ 2)² rule only works when the x² coefficient is 1. Divide by a first, or factor a out of the x terms.

Adding the Constant to One Side Only

Whatever you add to the left side must also be added to the right side to keep the equation balanced.

Squaring Without Halving

The constant to add is (b ÷ 2)², not b².

Sign Errors in the Vertex

(x + 3)² corresponds to h = −3, not 3.

Forgetting the ± Sign

Taking the square root of both sides gives two possibilities: positive and negative.


Quick Reference

QuantityFormula
Value added to complete the square (after dividing by a)(b ÷ 2a)²
Vertex x-coordinate h−b ÷ (2a)
Vertex y-coordinate kc − b² ÷ (4a)
Discriminantb² − 4ac
Solutionsx = (−b ± √(b² − 4ac)) ÷ (2a)

Frequently Asked Questions About Completing the Square

What is completing the square?

It is a method of rewriting a quadratic so that it contains a perfect square binomial, producing the vertex form a(x − h)² + k.

How do I complete the square for x² + bx?

Add (b ÷ 2)². For example, x² + 6x becomes x² + 6x + 9 = (x + 3)².

What if the coefficient of x² is not 1?

Divide the whole equation by a first, or factor a out of the x² and x terms, then complete the square.

How do I find the vertex from vertex form?

In a(x − h)² + k, the vertex is (h, k). Be careful with signs: (x + 3)² means h = −3.

What is the vertex form of x² + 6x + 5?

(x + 3)² − 4, with vertex (−3, −4).

Can completing the square give complex solutions?

Yes. If the squared term equals a negative number, the solutions are complex, such as x = −1 ± 2i for x² + 2x + 5 = 0.

How is completing the square related to the quadratic formula?

Completing the square on ax² + bx + c = 0 produces the quadratic formula directly.

What does the discriminant tell me?

If b² − 4ac is positive there are two real solutions, if it is zero there is one repeated solution, and if it is negative there are two complex solutions.

Why can’t a be zero?

If a = 0, there is no x² term and the equation is linear, not quadratic.

Can the calculator handle decimals and negative coefficients?

Yes. Enter any real numbers for a, b, and c, as long as a is not zero.


What the Calculator Does Not Do

  • Solve cubic or higher-degree equations
  • Factor expressions with non-numeric coefficients
  • Simplify radicals into exact surd form (results are shown as decimals)
  • Graph the parabola on coordinate axes

Best Practices for Learning the Method

  1. Work the problem by hand first, then compare with the calculator’s steps.
  2. Always check that the x² coefficient is 1 before adding (b ÷ 2)².
  3. Keep the equation balanced at every step.
  4. Verify solutions by substituting them back into the original equation.
  5. Expand the vertex form to confirm it returns to ax² + bx + c.

Scientific Basis and Reliable Sources

The calculator applies the algebraic identity ax² + bx + c = a(x + b/2a)² + (c − b²/4a), the discriminant b² − 4ac, and the quadratic formula derived from completing the square.

OpenStax Elementary Algebra — Solve Quadratic Equations by Completing the Square

This free, peer-reviewed textbook section explains how to complete the square for equations of the form x² + bx + c = 0 and ax² + bx + c = 0.


Final Completing the Square Checklist

  • Coefficient a is not zero
  • Equation divided by a before completing the square
  • (b ÷ 2a)² added to both sides
  • Perfect square factored correctly with the right sign
  • ± included when taking square roots
  • Solutions checked by substitution

With the completing the square calculator, you can find vertex form, the vertex, and the solutions of any quadratic equation while learning every step of the method.

Found this calculator useful? Share it.
Scroll to Top