On this concept: Formula

Not sure which lesson to do first? Find your level and get a plan →

Math · Algebra Fundamentals · Grade 9-12

Completing the Square

Completing the square rewrites ax2+bx+c as a(x−h)2+k by adding and subtracting (b2a)2 to manufacture a perfect-square trinomial.

x2+bx+c=(x+b2)2−b24+c Add and subtract (b2)2 to complete the square.

Quick Answer

Completing the square rewrites ax2+bx+c as a(x−h)2+k by adding and subtracting (b2a)2 to manufacture a perfect-square trinomial. Use it to turn standard form into vertex form, so the maximum or minimum shows, or to solve a quadratic that will not factor, such as x2+6x+2=0. Take half the x-coefficient, square it, add it to build (x+b2)2, and subtract the same amount so the value does not change. If a≠1, factor a out of the x2 and x terms first.

Why This Matters

It is the one method that works on every quadratic: it finds the vertex of x2+6x+2 and solves x2+6x+2=0 even though neither factors nicely. Done once on ax2+bx+c=0 in general, it produces the quadratic formula itself. Later the same move turns a scrambled circle equation into one that shows the centre and the radius.

Intuitive Explanation

Draw x2+6x as tiles: an x-by-x square plus a strip of area 6x. Cut the strip into two pieces, each 3 by x, and attach one to the right side of the square and one to the bottom. The shape is now almost a square of side x+3, missing only a small 3-by-3 corner. Add that corner, 9, and it is complete: x2+6x+9=(x+3)2.

The 9 was not in the original expression, so you cannot just add it. You add 9 and subtract 9 at the same time: x2+6x+2=(x2+6x+9)−9+2=(x+3)2−7. The value is unchanged, but it is now a square plus a constant, which is vertex form: the minimum is −7, at x=−3. The corner is always (b2)2, half the x-coefficient, squared.

When x2 has a coefficient, take it out of the first two terms before building the square. For 2x2+12x+5, write 2(x2+6x)+5, complete the square inside to get 2[(x+3)2−9]+5, then distribute: 2(x+3)2−13. The −9 was inside the bracket, so it becomes −18 when multiplied out.

Factoring also rewrites a quadratic, but as a product of brackets, and it only goes smoothly when the roots are nice numbers. Asked to factor x2+7x+10, find two numbers with product 10 and sum 7: (x+2)(x+5). Completing the square would give (x+72)2−94, which is true but is not a product.

Think of it like this. Completing the square is like finishing a jigsaw that is missing one corner piece: the x2 tile and two strips almost form a square, and (b2)2 is the missing corner. You borrow that piece, so you have to give it back by subtracting it. The tile picture works for positive b; for negative b the algebra is identical, but the drawing has to cut strips away.

Core idea. Completing the square adds and subtracts (b2)2 to turn x2+bx into a perfect square plus a leftover.


When to Use

Complete the square when you need vertex form from standard form, when a quadratic must be solved but will not factor over the integers, or when an equation with x2 and x terms (and maybe y2 and y terms) must be put into a recognizable shape, such as a circle. If it factors easily and you only need roots, factor. For the roots of a messy quadratic, the quadratic formula is usually quicker. If the quadratic is already a(x−h)2+k, just read it.

Tip. Ask: Am I manufacturing a perfect-square trinomial by adding and subtracting the same value to keep it equal?

How to Recognize It

Before completing the square, check what form you need at the end and whether an easier route, such as factoring, is already open.

  1. Does the question want vertex form, or the maximum or minimum, starting from ax2+bx+c?

    Yes is the main job of completing the square: x2−8x+3=(x−4)2−13, so the minimum is −13 at x=4. If the function is already a(x−h)2+k, just read it off.

  2. Is the leading coefficient something other than 1?

    Then factor it out of the x2 and x terms first: 2x2+12x+1=2(x2+6x)+1=2(x+3)2−17. Halving 12 directly, without taking out the 2, gives the wrong square.

  3. Do you only need the solutions of the equation?

    If it factors with whole numbers, factoring is faster; if not, the quadratic formula is usually quicker. Completing the square still works in both cases, and it is how the formula itself is built.

  4. Are both x2 and y2 present, as in x2+y2−6x+4y=12?

    Complete the square in x and in y separately: (x−3)2+(y+2)2=25, a circle with center (3,−2) and radius 5. If only x is squared, one completion gives a parabola in vertex form.

Completing the Square compared with Factoring, Quadratic formula, and Reading vertex form

All four rows can show up in one quadratic problem, and completing the square produces the vertex form that the last row reads. Ask what you need at the end: roots that factor, roots that will not, or the turning point written into the equation.

Completing the Square

Meaning
Use this when you want to convert a quadratic to vertex form or solve one that does not factor cleanly.
Key test
Am I manufacturing a perfect-square trinomial by adding and subtracting the same value to keep it equal?
Formula
x2+bx+c=(x+b2)2−b24+c Add and subtract (b2)2 to complete the square.
Example
Write x2+6x+1 in vertex form.

Factoring

Meaning
Needs nice integer roots; completing the square works even when factoring fails.
Key test
Use when the trinomial factors over the integers.
Formula
pq=ac,p+q=b
Example
x2+5x+6=(x+2)(x+3)

Quadratic formula

Meaning
Plugs into −b±b2−4ac2a; faster for just getting roots.
Key test
Use when you only want the solutions, not vertex form.
Formula
x=−b±b2−4ac2a
Example
Solve x2+5x+3=0

Reading vertex form

Meaning
Just interpreting a(x−h)2+k once it already exists.
Key test
Use when the square is already completed.
Formula
a(x−h)2+k
Example
(x−3)2−4 has vertex (3,−4)

Formula & Notation

x2+bx+c=(x+b2)2−b24+c Add and subtract (b2)2 to complete the square.
x2+bx+c=(x+b2)2+(c−b24). More generally, ax2+bx+c=a(x+b2a)2+c−b24a, valid ∀a≠0.

How to read it: (b2)2 is the value added and subtracted. The result is a perfect square (x+b2)2 plus a constant.

Worked Examples

Example 1 — Complete the square

Easy

Write x2+6x+1 in vertex form.
Show the steps and the answer
  1. Halve the x-coefficient and square it: 62=3, and 32=9.

    (x+3)2=x2+6x+9, so 9 is the constant that turns x2+6x into a perfect square.

  2. Add and subtract 9: x2+6x+9−9+1.

    Adding 9 and taking it away again leaves the value of the expression unchanged.

  3. Group and simplify: (x2+6x+9)−8=(x+3)2−8.

    The bracket is the perfect square, and −9+1=−8 is what is left outside it.

  4. Read the vertex: (x+3)2=(x−(−3))2, so it is (−3,−8). Check: (x+3)2−8=x2+6x+9−8=x2+6x+1.

    Expanding the answer gives back the original expression, so nothing was lost along the way.

Answer: (x+3)2−8, vertex (−3,−8)

Takeaway: Half the x-coefficient, squared, is the number to add and subtract.

Example 2 — Completing vs just factoring

Standard

Should you complete the square to put x2+7x+10 in factored form?
Show the steps and the answer
  1. Read what is asked: factored form, a product of brackets.

    Completing the square produces vertex form, a square plus a constant, which is a different output.

  2. Look for two numbers with product 10 and sum 7: 2 and 5.

    (x+p)(x+q)=x2+(p+q)x+pq, so the pair must multiply to c and add to b.

  3. Write (x+2)(x+5) and check: x2+5x+2x+10=x2+7x+10.

    The expansion matches the original, so the factoring is right.

  4. Compare with completing the square: x2+7x+10=(x+72)2−94.

    That form is correct and shows the vertex (−72,−94), but it needs fractions and is still not a product.

Answer: (x+2)(x+5)

Takeaway: Complete the square for vertex form or for quadratics that will not factor; when integer factors exist and a product is wanted, factor.

Example 3 — Find the mistake: halved but not squared

Application

Ella solves x2−8x+3=0 by completing the square and writes: "Half of −8 is −4, so x2−8x+3=(x−4)2−4+3=(x−4)2−1, and x=4±1." Find the mistake and correct it.
Show the steps and the answer
  1. Expand Ella's result: (x−4)2−1=x2−8x+16−1=x2−8x+15.

    A correct rewrite must expand back to x2−8x+3; hers is 12 too big.

  2. Find the slip: (x−4)2 contains +16, the square of −4, but she subtracted only 4.

    The amount to add and subtract is (b2)2=(−4)2=16, not b2 itself.

  3. Redo it: x2−8x+16−16+3=(x−4)2−13.

    Subtracting the same 16 that the square brings in keeps the expression equal.

  4. Solve (x−4)2=13: x−4=±13, so x=4±13, about 7.61 and 0.39.

    Both 13 and −13 square to 13, so taking the square root gives two solutions.

Answer: x=4±13 (about 7.61 and 0.39)

Takeaway: Add and subtract half the x-coefficient squared, then expand your result to catch a slip.

Where You'll See It

  • Finding a circle's centre from its equation

    Drawing software may store a circle as x2+y2−4x+6y=12. Completing the square in x and in y gives (x−2)2−4+(y+3)2−9=12, that is, (x−2)2+(y+3)2=25. So the circle is centred at (2,−3) with radius 5, which the original equation hid.

  • Fencing a plot against a wall

    With 20 m of fencing on three sides of a plot against a wall, a plot with sides x m out from the wall has area A=x(20−2x)=−2x2+20x. Completing the square: −2(x2−10x)=−2[(x−5)2−25]=−2(x−5)2+50. Sides of 5 m give the largest area, 50 m².

Common Mistakes

  1. The slip: Adding (b2)2 without also subtracting it

    Instead: you must keep the expression equal; add and subtract the same amount.

  2. The slip: Adding (b/2)2 without first factoring out a leading coefficient a≠1

    Instead: factor out a, complete the square inside, then distribute.

  3. The slip: Halving b but not squaring it

    Instead: the value added is the SQUARE of half the middle coefficient.


Mini Practice

Try these on your own. Tap Reveal when you want to check.

  1. Write x2−4x+7 in vertex form by completing the square.

    Hint: Take half of −4 and square it.

  2. Write x2+5x+1 in vertex form.

    Hint: Half of 5 is a fraction; square it carefully.

  3. Solve x2+6x−7=0 by completing the square.

    Hint: Move the 7 across, then add 9 to both sides.

  4. Write 2x2−12x+5 in vertex form.

    Hint: Factor 2 out of the first two terms before completing the square.

  5. You need the vertex of y=x2−10x+21, not its zeros. Factor or complete the square?

    Hint: Which method produces the form (x−h)2+k?

  6. A student writes x2+10x+2=(x+5)2+2. Find the mistake and fix it.

    Hint: Expand (x+5)2 and compare with the original.

Want the full set?

50 practice questions for this concept — free to try, every one with a complete worked solution showing the why, not just the answer.

Frequently Asked Questions

How does completing the square lead to the quadratic formula?

Do it on the general equation ax2+bx+c=0ax^2 + bx + c = 0. Divide by aa, move ca\frac{c}{a} across, and add (b2a)2\left(\frac{b}{2a}\right)^2 to both sides. The left side becomes (x+b2a)2\left(x + \frac{b}{2a}\right)^2 and the right side becomes b2−4ac4a2\frac{b^2 - 4ac}{4a^2}. Taking square roots and subtracting b2a\frac{b}{2a} gives x=−b±b2−4ac2ax = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}. So the formula is completing the square done once, for every quadratic at the same time.

What happens if the right side comes out negative?

Then there is no real solution. Solving x2+4x+13=0x^2 + 4x + 13 = 0 gives (x+2)2=−9(x+2)^2 = -9, and no real number squared is negative. The parabola never reaches the xx-axis: its lowest point is (−2,9)(-2, 9). If complex numbers are allowed, x+2=±3ix + 2 = \pm 3i, so x=−2±3ix = -2 \pm 3i. The negative number on the right is the discriminant at work, divided by 4a24a^2.

What do I do when b is odd, as in x2+5x?

Exactly the same steps, with fractions. Half of 5 is 52\frac{5}{2} and its square is 254\frac{25}{4}, so x2+5x=(x+52)2−254x^2 + 5x = \left(x + \frac{5}{2}\right)^2 - \frac{25}{4}. Decimals work too, (x+2.5)2−6.25(x + 2.5)^2 - 6.25, but fractions stay exact when the numbers get messier. Expanding the answer back out is a quick way to check the fraction arithmetic.

Learning Path

You need Quadratic Standard Form (reading a, b, c) and Expressions (expanding (x+3)2, combining like terms) first. Completing the square adds a reliable way to rebuild any quadratic around a perfect square. Next, Quadratic Vertex Form is the result it produces, the Quadratic Formula comes from completing the square on ax2+bx+c=0, and Conic Sections Overview uses it to find the centres of circles and ellipses.

See Also