Free Algebra Solver
Completing the square

Completing the Square Calculator

Enter a quadratic expression to rewrite it in vertex form, or an equation to solve it by completing the square.

Interpreted as: x^2 + 6x + 5 (Complete the square) Ready
Examples
Solution

Worked example: x^2 + 6x + 5

Worked example. Edit the problem above and press Complete the square to solve your own.

Problemx^2 + 6x + 5
  1. Identify a, b, and c

    Write the quadratic in the form ax² + bx + c.

    x² + 6x + 5
    Standard form
    a = 1, b = 6, c = 5
    Coefficients

    The method only changes how the expression is written, not its value.

  2. Add and subtract (b/2a)²

    Take half of the x-coefficient inside, 3, and square it: 9. Add it and subtract it so nothing changes.

    (6 ÷ 2)² = (3)² = 9
    The number that completes the square
    (x² + 6x + 9 − 9) + 5
    Add and subtract inside

    Adding zero (+9 − 9) keeps the value the same.

  3. Write the perfect square

    The first three terms inside form a perfect square. Move the extra term outside and combine constants.

    x² + 6x + 9 = (x + 3)²
    Perfect square trinomial
    k = c − b²/(4a) = −4
    Constant outside
    (x + 3)² − 4
    Vertex form a(x − h)² + k

    x² + 2px + p² = (x + p)², which is the identity behind the method.

  4. Read the vertex and axis of symmetry

    In a(x − h)² + k the vertex is (h, k) and the axis of symmetry is x = h.

    h = −b/(2a) = −3
    x-coordinate
    k = f(h) = −4
    y-coordinate
    Vertex (−3, −4), axis x = −3, opens up
    Key features

    The squared term is never negative, so the expression reaches its minimum when x = h.

Answer(x + 3)² − 4

Completing the square

How to use the completing the square calculator

This completing the square calculator rewrites ax² + bx + c as a(x − h)² + k and shows how it finds each number. Enter an equation with = 0 and it goes one step further and solves it.

How do you complete the square?

Take half of the x coefficient, square it, then add and subtract that number so the value doesn't change. The first three terms now form a perfect square. For x² + 6x + 5, half of 6 is 3 and 3² = 9, so x² + 6x + 9 − 9 + 5 = (x + 3)² − 4.

What does completing the square mean?

It means rewriting a quadratic so the x terms sit inside one squared bracket. You turn x² + bx into part of a perfect square trinomial like x² + 6x + 9, which equals (x + 3)².

The result is called vertex form. It shows the vertex of the parabola at a glance, and it lets you solve an equation by taking a square root instead of factoring.

The name comes from geometry. x² + 6x can be drawn as a square with two rectangles beside it, and the 9 you add is the small corner piece that fills in the full square.

Complete the square calculator example: x² + 6x + 5

The answer is (x + 3)² − 4. These are the lines the complete the square calculator walks through.

  1. Read the coefficients: a = 1, b = 6, c = 5.
  2. Halve b and square it: (6 ÷ 2)² = 3² = 9.
  3. Add and subtract 9: x² + 6x + 9 − 9 + 5.
  4. Group the perfect square: (x² + 6x + 9) − 4.
  5. Write it as a square: (x + 3)² − 4.

To check, expand it: (x + 3)² − 4 = x² + 6x + 9 − 4 = x² + 6x + 5. That matches the original, so nothing was lost.

Notice that 9 came from the x term alone. The original constant, 5, plays no part in picking the number. It just gets combined with −9 at the end.

What is the completing the square formula?

The general completing the square formula is ax² + bx + c = a(x + b/(2a))² + c − b²/(4a). In vertex form that means h = −b/(2a) and k = c − b²/(4a).

You rarely need to memorize this. Doing the steps with real numbers gives the same result, and the formula is mainly useful for checking h and k quickly.

General form
ax² + bx + c = a(x − h)² + k
Horizontal shift
h =−b2a
Constant
k = c − b²/(4a)

How do you complete the square when a is not 1?

Factor a out of the x² and x terms first, then complete the square inside the bracket. Whatever you subtract inside gets multiplied by a when it comes out.

Take 2x² − 8x + 3. Pull out 2 from the first two terms to get 2(x² − 4x) + 3. Half of −4 is −2, and (−2)² = 4. So you write 2(x² − 4x + 4 − 4) + 3, which becomes 2(x − 2)² − 8 + 3, or 2(x − 2)² − 5.

That −8 is where most people slip. The −4 inside the bracket is multiplied by 2 on the way out.

How do you solve an equation by completing the square?

Complete the square, move the constant to the other side, and take the square root of both sides with ±. For x² + 4x + 1 = 0 the solutions are x = −2 ± √3.

Start
x² + 4x + 1 = 0
Complete the square
(x + 2)² − 3 = 0
Move the constant
(x + 2)² = 3
Square root
x + 2 = ±√3
Solve
x = −2 − √3 or x = −2 + √3

This equation doesn't factor over whole numbers, which is the kind of problem where the method earns its keep.

What mistakes do students make when completing the square?

Adding the square without subtracting it is the most common one. If you add 9, you have changed the expression unless you also take 9 away (or add it to both sides of an equation).

Others include squaring b instead of half of b, forgetting the ± when you take a square root, and dropping the factor of a when a is not 1. Expanding your answer at the end catches all of these.

Why complete the square instead of factoring?

It works on every quadratic, including ones that do not factor nicely. It also gives you vertex form, which you need for graphing a parabola and for finding a maximum or minimum.

If you just want the roots and the numbers are friendly, factoring or the quadratic formula may be quicker.

How do you complete the square when a is negative?

Factor out the negative a, sign included, and carry on as usual. The minus sign stays in front of the bracket all the way to the end.

For −x² + 4x + 1, factor out −1 to get −(x² − 4x) + 1. Half of −4 is −2, and its square is 4. That gives −(x² − 4x + 4 − 4) + 1. When the −4 comes out of the bracket it is multiplied by −1, so it turns into +4: −(x − 2)² + 4 + 1 = −(x − 2)² + 5.

The same idea handles 3x² + 6x − 2. Factor out 3 to get 3(x² + 2x) − 2, add and subtract 1 inside, and the result is 3(x + 1)² − 5. The calculator shows this factoring step every time a is anything other than 1.

Frequently asked questions

Short answers to the questions people ask most about this topic.

How to complete the square step by step?

Make sure the x² coefficient is 1 (factor it out if not). Halve the x coefficient and square it. Add and subtract that number, then write the first three terms as a squared bracket and combine the constants.

What number completes the square for x² + 10x?

Half of 10 is 5, and 5² = 25. So x² + 10x + 25 = (x + 5)².

Does completing the square work if b is odd?

Yes. Half of an odd number is a fraction, so the square will include a fraction such as (x + 5/2)². The steps are the same, the arithmetic is just a little messier.

Is vertex form the same as completed square form?

Yes. a(x − h)² + k is both. The vertex of the parabola is the point (h, k).

Can I complete the square on an equation?

Yes. Enter it with = 0 and the calculator rewrites it in vertex form, isolates the square, and solves by taking square roots.

How is this related to the quadratic formula?

The quadratic formula comes from completing the square on ax² + bx + c = 0 with letters. Both methods always give the same roots.

Why add and subtract the same number?

Adding a number and then subtracting it is the same as adding zero, so the value of the expression doesn't change. It only changes how the expression is grouped, which lets you write part of it as a square.

What does the answer tell me about the graph?

In a(x − h)² + k, the point (h, k) is the vertex of the parabola. For x² + 6x + 5 = (x + 3)² − 4, the vertex is (−3, −4) and the parabola opens up.

Math keypad

Complete the square mode

Use the keypad below or tap the expression to use your phone keyboard.

Keyboard tips

Ctrl + Enter
Run the selected operation
^
Enter a power, such as x^2
sqrt(
Calculate an exact or simplified square root
a:b
Separate quantities in a ratio
12, 18
Separate integers in an LCM and GCD calculation
@ x =
Assign x when evaluating an expression
y =
Enter a polynomial function to graph
|
Wrap an absolute-value expression