Completing the square.

Take half of b, square it, and add it to x² + bx. That makes a perfect square, (x + b/2)², and a quadratic you can solve with a square root or read the vertex from.

x² + 6x + 5 (x² + 6x + 9) − 9 + 5 (x + 3)² − 4
  • half of b
  • that half, squared
  • the original constant
  • the leftover, k

Why it works. It is a missing corner.

x² + 6x is a square of side x with two 3 × x strips beside it. It is almost a bigger square. The missing corner is 3 × 3 = 9, which is (b/2)². Add it and the whole shape has side x + 3.

x² 3x 3x 9 x 3 x 3

x² + 6x + 9

= (x + 3)²

The 6x splits into two strips of 3x. Each strip is half of b wide. The corner is that half squared.

How to complete the square. Solve x² + 8x + 7 = 0.

Four moves, in this order. The coefficient of x² has to be 1 before you start.

  1. 1

    Move the constant.

    x² + 8x + 7 = 0 → x² + 8x = −7

  2. 2

    Halve it, then square it.

    8 ÷ 2 = 4 → 4² = 16

  3. 3

    Add it to both sides and factor.

    x² + 8x + 16 = −7 + 16 → (x + 4)² = 9

  4. 4

    Square root both sides. Keep the ±.

    x + 4 = ±3 → x = −4 + 3 = −1 or x = −4 − 3 = −7

Check: (−1)² + 8(−1) + 7 = 0 and (−7)² + 8(−7) + 7 = 49 − 56 + 7 = 0.

Completing the square when a ≠ 1. Deal with a first.

The perfect-square pattern only works on x² with a coefficient of 1. What you do about a depends on whether you are solving an equation or rewriting an expression.

Solving an equation

Divide every term by a.

2x² + 8x − 10 = 0

÷ 2  →  x² + 4x = 5

+ 4  →  (x + 2)² = 9

x = 1 or −5

Rewriting an expression

Factor a out of the x² and x terms only.

2x² + 8x + 1

= 2(x² + 4x + 4) + 1 − 8

= 2(x + 2)² − 7

The 4 sits inside 2( ), so you added 2 × 4 = 8. Subtract 8, not 4.

Check the equation: 2(1)² + 8(1) − 10 = 0 and 2(−5)² + 8(−5) − 10 = 50 − 40 − 10 = 0. Check the expression: 2(x + 2)² − 7 = 2x² + 8x + 8 − 7 = 2x² + 8x + 1.

Completing the square to get vertex form. Read the vertex off.

The same move turns y = ax² + bx + c into y = a(x − h)² + k. The vertex is (h, k). From the graph of y = x² + 6x + 5, the bottom point is (−3, −4), and the x-intercepts are −5 and −1.

(−3, −4) −5 −1 5

Standard form

y = x² + 6x + 5

Vertex form

y = (x + 3)² − 4

In general h = −b/(2a) and k = c − b²/(4a). Here h = −6/2 = −3 and k = 5 − 9 = −4.

Solving quadratics by completing the square. Three endings.

After the left side is (x + 3)², the number on the right decides how it ends. Same left side, three different right sides.

Positive

x² + 6x + 5 = 0
(x + 3)² = 4

x = −1 or x = −5

Two real solutions.

Zero

x² + 6x + 9 = 0
(x + 3)² = 0

x = −3

One repeated solution.

Negative

x² + 6x + 13 = 0
(x + 3)² = −4

x = −3 ± 2i

No real solutions. Two complex ones.

When b is odd, you get fractions, not a mistake. For x² + 5x + 1 = 0: half of 5 is 5/2, and (5/2)² = 25/4. Then (x + 5/2)² = 25/4 − 1 = 21/4, so x = (−5 ± √21) / 2. The quadratic formula gives the same answer because it is this method run once on ax² + bx + c.

Three slips. All of them cost the whole answer.

Adding to one side

x² + 8x + 16 = −7

x² + 8x + 16 = −7 + 16

Dropping the ±

x + 4 = 3 → x = −1

x + 4 = ±3 → −1 and −7

Halving before dividing by a

2x² + 8x: add (8/2)² = 16

x² + 4x: add (4/2)² = 4

Practice it on your own equations.

Completing the square is a pattern you learn by doing it on ten different equations, with a fraction and a negative a mixed in. Type or photograph the one from your homework in Stephen AI, and the tutor walks it one line at a time. For a check on how you solved it, see step-by-step algebra help, and compare with the quadratic formula.

Walking through a quadratic equation one line at a time

Completing the square questions.
Straight answers.

What is completing the square?

Completing the square rewrites a quadratic so that part of it is a perfect square, (x + p)². You add the number (b/2)² to x² + bx, which turns it into (x + b/2)². Because you cannot change the value of the expression, you either add the same number to the other side of an equation or subtract it again. The method solves quadratics, gives vertex form, and is how the quadratic formula is derived.

How do you complete the square step by step?

For x² + bx + c = 0: move c to the right side, so x² + bx = −c. Take half of b and square it. Add that number to both sides. Write the left side as (x + b/2)². Take the square root of both sides with a ±, then solve for x. Example: x² + 8x + 7 = 0 becomes x² + 8x = −7, add 16 to get (x + 4)² = 9, so x + 4 = ±3 and x = −1 or x = −7.

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

Get the x² coefficient to 1 first. When you are solving an equation, divide every term on both sides by a, then complete the square as usual. For 2x² + 8x − 10 = 0, divide by 2 to get x² + 4x − 5 = 0, then (x + 2)² = 9, so x = 1 or x = −5. When you are rewriting an expression instead, factor a out of the x² and x terms only: 2x² + 8x + 1 = 2(x² + 4x) + 1 = 2(x + 2)² − 7. Inside the bracket you added 4, but it sits inside 2( ), so you really added 8 and must subtract 8.

How do you complete the square to get vertex form?

Factor a out of the x² and x terms, add and subtract (b/2a)² inside the bracket, then pull the subtracted piece out (multiplied by a). The result is a(x − h)² + k with vertex (h, k). In general h = −b/(2a) and k = c − b²/(4a). For y = x² + 6x + 5, h = −3 and k = 5 − 9 = −4, so y = (x + 3)² − 4 and the vertex is (−3, −4).

Why do you add (b/2)² to both sides?

Because (x + b/2)² expands to x² + bx + (b/2)². The first two terms are already in the equation, so (b/2)² is the one missing piece that makes the left side a perfect square. An equation stays true only if you do the same thing to both sides, so the same number goes on the right. In area terms, x² + bx is a square with two strips attached, and (b/2)² is the small corner square that fills the gap.

What if the number on the right side is negative?

Then there is no real solution, because a real square cannot be negative. In Algebra 2 and college algebra you continue with i, where √(−1) = i. For x² + 6x + 13 = 0, you get (x + 3)² = −4, so x + 3 = ±2i and x = −3 ± 2i. If the right side is exactly 0, you get one repeated solution, such as (x + 3)² = 0 and x = −3.

Should I complete the square, factor, or use the quadratic formula?

Factor when the numbers factor quickly. Use the quadratic formula when the numbers are ugly and you only need the roots. Complete the square when the problem asks you to, or when you need vertex form, the center and radius of a circle, or an integral that needs a perfect square. The quadratic formula is just completing the square done once on ax² + bx + c = 0.

Halve it. Square it. Add it to both sides.

That is the whole method. The next equation, with its fractions and its negative a, is a good one to run through Stephen AI.

Stephen AI Get it for Free