Completing the Square Calculator

This tool shows how to complete the square to rewrite a quadratic into vertex form. Enter coefficients from $ax^2 + bx + c$ and get the transformed form $a(x - h)^2 + k$ with clear steps, including the vertex $(h, k)$ and axis of symmetry $x = h$. Vertex form is useful for graphing, comparing quadratics, and finding maximum or minimum values quickly. Completing the square is a core topic in Algebra.

Rewrite a quadratic into vertex form using completing the square:

$$ax^2 + bx + c = a(x-h)^2 + k$$

Must not be 0 for a quadratic equation.

What Does Completing the Square Do?

Completing the square rewrites a quadratic so it contains a perfect square. The goal is to convert $ax^2 + bx + c$ into $a(x - h)^2 + k$. This form makes the vertex easy to read and connects directly to graphing, solving, and identifying maximum or minimum values.

If you prefer solving directly for roots, the quadratic formula and discriminant method can be faster. Use the Quadratic Equation Solver when your goal is the roots. Completing the square is another standard method that often appears in algebra exams and textbooks and it also explains where the quadratic formula comes from.

Vertex Form and the Vertex

Vertex form is: $$a(x-h)^2 + k$$ The vertex of the parabola is $(h, k)$. The axis of symmetry is $x = h$. The sign of $a$ tells you whether the parabola opens up or down, and the value of $k$ is the minimum when $a > 0$ or the maximum when $a < 0$.

From standard form $ax^2 + bx + c$, the vertex can also be computed directly: $$h = -\frac{b}{2a} \quad\text{and}\quad k = c - \frac{b^2}{4a}$$ so the axis of symmetry is: $$x = -\frac{b}{2a}$$

How to Complete the Square

Start from: $$ax^2 + bx + c$$ If $a ≠ 1$, factor it from the $x^2$ and $x$ terms only. Then take half of the $x$-coefficient inside the brackets, square it, add and subtract it to keep the expression unchanged, and rewrite the trinomial as a perfect square. Finally, simplify the constant to reach vertex form.

The goal is to rewrite the quadratic so it contains a perfect square: $$ax^2 + bx + c = a(x-h)^2 + k$$ where $(h, k)$ is the vertex.

When a Is Not 1

If the coefficient $a$ is not $1$, factor it out from the $x^2$ and $x$ terms first, not from the constant term. Then complete the square inside the brackets and keep a outside. This avoids mistakes when the leading coefficient scales the perfect square.

$$ax^2 + bx + c = a\left(x^2 + \frac{b}{a}x\right) + c$$ $$= a\left[\left(x + \frac{b}{2a}\right)^2 - \left(\frac{b}{2a}\right)^2\right] + c$$ $$= a\left(x + \frac{b}{2a}\right)^2 + \left(c - \frac{b^2}{4a}\right)$$

If fractions show up, the GCD Calculator can help simplify, and the LCM Calculator helps when you need a common denominator.

Using Vertex Form to Solve

Completing the square is not only for rewriting. If you set the quadratic equal to zero, vertex form makes it easy to solve by taking square roots. If the value on the right side becomes negative, there are no real roots and the solutions are complex.

$$a(x-h)^2 + k = 0$$ $$(x-h)^2 = -\frac{k}{a}$$ $$x = h \pm \sqrt{-\frac{k}{a}}$$

For the same roots using the discriminant method, use the Quadratic Equation Solver.

Why Vertex Form Helps with Graphing

Vertex form shows the parabola's key features at a glance. The vertex is $(h, k)$, the axis of symmetry is $x = h$, and the sign of $a$ tells you whether it opens up or down. The value of $|a|$ controls how wide or narrow the curve is, and the vertex value $k$ gives the minimum when a is positive or the maximum when a is negative.

$$a(x-h)^2 + k \quad \Rightarrow \quad \text{vertex }(h,k),\ \text{axis }x=h$$

Common Mistakes to Avoid

Small sign and distribution errors are the most common issues when completing the square. Watch for these patterns when you check your steps.

  • Adding the square term but forgetting to subtract it, which changes the original expression.
  • Mixing signs between $x + \frac{b}{2a}$ and $x - h$, where $h = -\frac{b}{2a}$.
  • Factoring out $a$ incorrectly, or distributing it back into the bracket incorrectly at the end.
  • Dropping brackets when expanding to verify your result in standard form.

Worked Examples

Example 1: $a = 1$ (Simple case)

Use this when the leading coefficient is $1$. Half the $x$-coefficient, square it, then compensate in the constant term.

Rewrite: $$x^2 + 6x + 5$$ Take half of 6 (which is 3), square it (9), then adjust the constant.

$$x^2 + 6x + 5 = (x^2 + 6x + 9) + 5 - 9$$ $$= (x + 3)^2 - 4$$

Vertex form is: $$ (x + 3)^2 - 4 $$ Vertex is: $$ (-3,\; -4) $$

Example 2: $a \ne 1$ (Factor first)

Use this when $a$ is not $1$. Factor $a$ from the $x^2$ and $x$ terms first, then complete the square inside the brackets.

Rewrite: $$2x^2 + 8x + 1$$ Factor 2 from the first two terms: $$2(x^2 + 4x) + 1$$

Complete the square inside: $$2\big[(x^2 + 4x + 4) - 4\big] + 1$$ $$= 2(x + 2)^2 - 8 + 1$$ $$= 2(x + 2)^2 - 7$$

Vertex form is: $$2(x + 2)^2 - 7$$ Vertex is: $$(-2,\; -7)$$

Example 3: Perfect Square Trinomial

Use this when the trinomial is already a perfect square. You can rewrite it directly without adding or subtracting anything.

Rewrite: $$x^2 - 4x + 4$$ This is already a perfect square: $$x^2 - 4x + 4 = (x - 2)^2$$

Vertex form is: $$(x - 2)^2 + 0$$ Vertex is: $$(2,\; 0)$$

If you want to solve the related equation, set the expression equal to zero and solve. You can also compare this approach with the quadratic formula method.

Continue in Mathematics for related topics, or browse all Calculators on UtilityKits.

Questions About Completing the Square

Quick answers about vertex form, steps, and common cases.

Trusted by thousands of users every month. Fast, accurate and privacy-friendly tools.