ALG1-8.3

Completing the Square

Learn to complete the square in Algebra 1: build perfect-square trinomials, solve any quadratic equation, and rewrite standard form into vertex form to find the vertex.

What you'll do in this lesson

A voice-first session with the Crimsora tutor on Completing the Square, then targeted practice and FRQs — with the tutor adapting to where you get stuck.

What this lesson covers

Factoring only works when a quadratic happens to break apart into nice integer pieces, and taking square roots only works when the equation already looks like something squared equals a number. Completing the square is the technique that forces every quadratic into that square-root-friendly shape, whether or not it factors. It is also the bridge between the two ways you have seen quadratics written: standard form y=ax2+bx+cy = ax^2+bx+c, which shows the y-intercept, and vertex form y=a(xh)2+ky = a(x-h)^2+k, which shows the vertex (h,k)(h,k) instantly.

In this lesson you will learn the perfect-square pattern that makes the whole method work, use it to solve equations exactly, and use it again to rewrite functions in vertex form. The same algebra that solves x2+6x7=0x^2+6x-7=0 is what produces the quadratic formula in the next lesson, so getting comfortable here pays off twice.

The Perfect-Square Pattern Behind the Method

Everything starts with one identity:(x+p)2=x2+2px+p2(x+p)^2 = x^2 + 2px + p^2Read the right side carefully. The middle coefficient is 2p2p and the last term is p2p^2. So the constant is always the square of half the middle coefficient. If a trinomial has the form x2+bx+  x^2+bx+\underline{\ \ }, the number that completes the square is(b2)2\left(\frac{b}{2}\right)^2and the result factors as (x+b2)2\left(x+\frac{b}{2}\right)^2.
ExpressionHalf of bbAdd (b/2)2(b/2)^2Factored square
x2+8xx^2+8x441616(x+4)2(x+4)^2
x210xx^2-10x5-52525(x5)2(x-5)^2
x2+5xx^2+5x52\frac{5}{2}254\frac{25}{4}(x+52)2\left(x+\frac{5}{2}\right)^2
x223xx^2-\frac{2}{3}x13-\frac{1}{3}19\frac{1}{9}(x13)2\left(x-\frac{1}{3}\right)^2
Two details save a lot of trouble. First, the sign inside the parentheses matches the sign of bb, because you keep half of bb including its sign; the added constant is always positive since it is a square. Second, an odd bb does not mean you did something wrong. Half of 55 is 52\frac{5}{2}, and 254\frac{25}{4} is a perfectly legal constant. Students who round 52\frac{5}{2} to 22 or 33 destroy the equation. Keep fractions exact and the method works every time.

A quick check: expand your finished square mentally. (x5)2=x210x+25(x-5)^2 = x^2-10x+25 should match the trinomial you built.

Solving an Equation When the Leading Coefficient Is 1

To solve x2+bx+c=0x^2+bx+c=0, you rearrange so the xx-terms are alone, complete the square on both sides, then take square roots.

Solve x2+6x7=0x^2+6x-7=0.
StepResult
Move the constantx2+6x=7x^2+6x = 7
Half of 66 is 33; square it(62)2=9\left(\frac{6}{2}\right)^2 = 9
Add 99 to both sidesx2+6x+9=16x^2+6x+9 = 16
Factor the left side(x+3)2=16(x+3)^2 = 16
Square root propertyx+3=±4x+3 = \pm 4
Solve both branchesx=1x = 1 or x=7x = -7
The critical move is adding 99 to both sides. Completing the square changes the expression, so you must keep the equation balanced. Forgetting the right side is the single most common error in this lesson.

The second critical move is the ±\pm. Every positive number has two square roots, so (x+3)2=16(x+3)^2=16 gives x+3=4x+3=4 and x+3=4x+3=-4. Writing only x+3=4x+3=4 loses one of the two solutions.

When the number on the right is not a perfect square, leave it in radical form and simplify. For x24x6=0x^2-4x-6=0 you get (x2)2=10(x-2)^2 = 10, so x=2±10x = 2 \pm \sqrt{10}. When the number on the right is negative, as in (x+1)2=9(x+1)^2 = -9, there is no real solution, because no real number squares to a negative. That connects directly to the discriminant you meet later in the unit.

When the Leading Coefficient Is Not 1

The pattern (b2)2\left(\frac{b}{2}\right)^2 assumes the squared term is exactly x2x^2. If the equation starts with 3x23x^2 or 2x22x^2, you must deal with that coefficient first.

In an equation, the cleanest route is to divide every term by aa. From 3x2+12x15=03x^2+12x-15=0, divide by 33 to get x2+4x5=0x^2+4x-5=0, then complete the square as usual: x2+4x=5x^2+4x=5, (x+2)2=9(x+2)^2=9, x=1x=1 or x=5x=-5. Dividing works because the right side is zero or a single number, so scaling the whole equation changes nothing about the solutions.

In a function being rewritten in vertex form, you cannot divide — that would change the function. Instead you factor aa out of the first two terms only, complete the square inside the parentheses, and then compensate outside. Rewrite y=2x28x+1y = 2x^2 - 8x + 1:y=2(x24x)+1y = 2(x^2-4x) + 1Half of 4-4 is 2-2, and (2)2=4(-2)^2 = 4, so add 44 inside the parentheses. But the 22 out front multiplies that 44, meaning you really added 88 to the expression. Subtract 88 outside to keep the function the same:y=2(x24x+4)+18=2(x2)27y = 2(x^2-4x+4) + 1 - 8 = 2(x-2)^2 - 7The compensation step is where most mistakes happen. Students subtract 44 instead of 88 because they ignore the factor of aa. Always ask what the added constant becomes after it is multiplied by aa, and undo exactly that amount. Verify by expanding: 2(x24x+4)7=2x28x+87=2x28x+12(x^2-4x+4)-7 = 2x^2-8x+8-7 = 2x^2-8x+1.

Reading the Vertex and Choosing a Method

Once a function is written as y=a(xh)2+ky = a(x-h)^2 + k, the vertex is (h,k)(h,k) and the axis of symmetry is the line x=hx = h. Sign care matters: y=2(x2)27y = 2(x-2)^2-7 has vertex (2,7)(2,-7), while y=2(x+3)27y = 2(x+3)^2-7 means h=3h = -3, so the vertex is (3,7)(-3,-7). The form is xx minus hh, so a plus sign inside signals a negative hh.

The sign of aa tells you whether kk is a minimum or a maximum output. If a>0a>0 the parabola opens up and kk is the smallest yy-value; if a<0a<0 it opens down and kk is the largest. That is exactly what you use for questions about maximum height or minimum cost in the modeling lesson.

A useful check on your vertex: the xx-coordinate must equal b2a-\frac{b}{2a} from the original standard form. For y=2x28x+1y = 2x^2-8x+1, 82(2)=2-\frac{-8}{2(2)} = 2, matching the h=2h = 2 you found. That is not a coincidence — completing the square in general is what proves the formula.
SituationBest tool
x2=49x^2 = 49 or (x3)2=20(x-3)^2=20Square roots directly
Factors easily, like x2+7x+12=0x^2+7x+12=0Factoring
Need the vertex from standard formCompleting the square
Messy coefficients, only need solutionsQuadratic formula
Completing the square always works, but it is the preferred tool when you want the vertex or when a problem specifically asks you to show the square-root structure.

Where Students Actually Go Wrong

Four errors account for most incorrect work on this topic.

Adding to only one side. Writing x2+6x=7x^2+6x = 7 and then (x+3)2=7(x+3)^2 = 7 changes the equation. Whatever you add on the left must appear on the right.

Dropping the negative root. From (x1)2=25(x-1)^2 = 25, both x1=5x-1 = 5 and x1=5x-1 = -5 are valid, giving x=6x = 6 and x=4x = -4. A quadratic with a positive number on the right after completing the square has two real solutions.

Mishandling the factor of aa in vertex form. If you factor out 3-3 and add 44 inside the parentheses, you actually added 12-12, so you must add 1212 back outside. Sign errors with a negative aa are especially common.

Rounding fractions. Half of 77 is 72\frac{7}{2}, not 33 or 44. The completed constant is 494\frac{49}{4}. If you need a decimal answer, convert at the very end.

Two habits prevent nearly all of this. First, expand your vertex form and compare it term by term with the original — if it does not match exactly, you know immediately. Second, substitute your solutions back into the original equation. For x=7x = -7 in x2+6x7=0x^2+6x-7=0: 49427=049 - 42 - 7 = 0, confirmed. These checks take under a minute and catch arithmetic slips that would otherwise carry through a whole problem set.

Key terms

Perfect-square trinomial.
A trinomial that factors as the square of a binomial, such as x2+10x+25=(x+5)2x^2+10x+25 = (x+5)^2. Its constant term equals the square of half its middle coefficient.
Completing the square.
Adding (b2)2\left(\frac{b}{2}\right)^2 to an expression of the form x2+bxx^2+bx so it becomes a perfect-square trinomial, compensating elsewhere to keep the equation or function unchanged.
Standard form.
A quadratic written as y=ax2+bx+cy = ax^2+bx+c. It shows the y-intercept (0,c)(0,c) directly but hides the vertex.
Vertex form.
A quadratic written as y=a(xh)2+ky = a(x-h)^2+k, where the vertex is (h,k)(h,k) and the axis of symmetry is x=hx = h.
Square root property.
If (xh)2=d(x-h)^2 = d with d0d \ge 0, then xh=±dx-h = \pm\sqrt{d}. The ±\pm produces both solutions.
Axis of symmetry.
The vertical line x=hx = h through the vertex, about which the parabola is a mirror image; it also equals x=b2ax = -\frac{b}{2a}.
Compensating term.
The amount added or subtracted outside the parentheses to offset the constant introduced inside, equal to a(b2a)2a\left(\frac{b}{2a}\right)^2 when aa has been factored out.

Worked example

For the function y=2x212x+5y = 2x^2 - 12x + 5: (a) rewrite it in vertex form and state the vertex, and (b) solve 2x212x+5=02x^2-12x+5=0 by completing the square, giving exact answers.
Part (a). Factor 22 out of the first two terms only, leaving the constant alone: y=2(x26x)+5y = 2(x^2-6x)+5.

Inside the parentheses, b=6b = -6, so half of bb is 3-3 and (3)2=9(-3)^2 = 9. Add 99 inside. Because the 22 out front multiplies it, you have actually added 29=182 \cdot 9 = 18 to the function, so subtract 1818 outside:y=2(x26x+9)+518y = 2(x^2-6x+9) + 5 - 18y=2(x3)213y = 2(x-3)^2 - 13Check by expanding: 2(x26x+9)13=2x212x+1813=2x212x+52(x^2-6x+9)-13 = 2x^2-12x+18-13 = 2x^2-12x+5, which matches. The vertex is (3,13)(3,-13), and since a=2>0a = 2 > 0 the parabola opens up, so 13-13 is the minimum value. Confirm the xx-coordinate with b2a=124=3-\frac{b}{2a} = -\frac{-12}{4} = 3.

Part (b). Use the vertex form you already built: 2(x3)213=02(x-3)^2 - 13 = 0, so 2(x3)2=132(x-3)^2 = 13 and (x3)2=132(x-3)^2 = \frac{13}{2}.

Apply the square root property:x3=±132=±132=±262x - 3 = \pm\sqrt{\frac{13}{2}} = \pm\frac{\sqrt{13}}{\sqrt{2}} = \pm\frac{\sqrt{26}}{2}So x=3±262x = 3 \pm \frac{\sqrt{26}}{2}, approximately x5.55x \approx 5.55 and x0.45x \approx 0.45.

Sanity check: the two roots should be symmetric about the axis x=3x = 3, and they are — each sits 2622.55\frac{\sqrt{26}}{2} \approx 2.55 units away.

Practice questions

Which expression is equivalent to y=x28x+3y = x^2 - 8x + 3?
  1. y=(x4)2+3y = (x-4)^2 + 3
  2. y=(x4)213y = (x-4)^2 - 13
  3. y=(x8)261y = (x-8)^2 - 61
  4. y=(x+4)213y = (x+4)^2 - 13

Answer: y=(x4)213y = (x-4)^2 - 13

Half of 8-8 is 4-4, and (4)2=16(-4)^2 = 16, so x28x+16=(x4)2x^2-8x+16 = (x-4)^2. Since you added 1616 to build the square, subtract 1616 from the original constant: 316=133 - 16 = -13. Expanding (x4)213(x-4)^2-13 gives x28x+1613=x28x+3x^2-8x+16-13 = x^2-8x+3, confirming the match. The choice (x4)2+3(x-4)^2+3 is what you get if you forget to compensate, and (x+4)213(x+4)^2-13 flips the sign of hh.
Solve x25x2=0x^2 - 5x - 2 = 0 by completing the square. Give exact answers.

Answer: x=5±332x = \frac{5 \pm \sqrt{33}}{2}

Move the constant: x25x=2x^2-5x = 2. Half of 5-5 is 52-\frac{5}{2}, and (52)2=254\left(-\frac{5}{2}\right)^2 = \frac{25}{4}. Add 254\frac{25}{4} to both sides: x25x+254=2+254=84+254=334x^2-5x+\frac{25}{4} = 2 + \frac{25}{4} = \frac{8}{4}+\frac{25}{4} = \frac{33}{4}. Factor: (x52)2=334\left(x-\frac{5}{2}\right)^2 = \frac{33}{4}. Take square roots with ±\pm: x52=±332x-\frac{5}{2} = \pm\frac{\sqrt{33}}{2}, so x=5±332x = \frac{5 \pm \sqrt{33}}{2}. The odd middle coefficient is not a problem as long as you keep 254\frac{25}{4} as a fraction rather than rounding.
A model for the height of a thrown object is h=3t2+12t5h = -3t^2 + 12t - 5. Rewrite it in vertex form and state the maximum height and when it occurs.

Answer: h=3(t2)2+7h = -3(t-2)^2 + 7; the maximum height is 7 units, reached at t=2t = 2.

Factor 3-3 from the first two terms: h=3(t24t)5h = -3(t^2-4t) - 5. Half of 4-4 is 2-2 and (2)2=4(-2)^2 = 4, so add 44 inside. Because of the 3-3 out front, that adds 12-12 overall, so add 1212 outside to compensate: h=3(t24t+4)5+12=3(t2)2+7h = -3(t^2-4t+4) - 5 + 12 = -3(t-2)^2 + 7. Since a=3<0a = -3 < 0, the parabola opens downward and the vertex (2,7)(2,7) is the highest point. Watch the compensation sign — adding 44 inside a negative-coefficient parentheses requires adding, not subtracting, outside.

FAQ

Why do I add (b/2)2(b/2)^2 and not something else?
Because expanding (x+p)2(x+p)^2 gives x2+2px+p2x^2+2px+p^2. The middle coefficient is twice pp, so pp must be half of bb, and the constant is pp squared. Adding (b2)2\left(\frac{b}{2}\right)^2 is the only constant that makes x2+bx+  x^2+bx+\underline{\ \ } a perfect square.
If the quadratic formula always works, why learn completing the square?
Two reasons. First, the quadratic formula is derived by completing the square on ax2+bx+c=0ax^2+bx+c=0, so this method is the reason that formula exists. Second, the formula gives you roots but not the vertex; completing the square converts standard form into vertex form, which is what you need for graphing, maximum and minimum problems, and transformations.
What if the middle coefficient is odd?
Nothing changes except that you work with fractions. For x2+7xx^2+7x, half of 77 is 72\frac{7}{2} and you add 494\frac{49}{4}, giving (x+72)2\left(x+\frac{7}{2}\right)^2. Keep the fractions exact through the whole problem and convert to a decimal only at the end if the question asks for one.
Why do I divide by aa when solving an equation but factor aa out when rewriting a function?
An equation set equal to zero stays equivalent if you divide every term by the same nonzero number, so dividing is legal and simplifies the work. A function is not an equation you can scale — dividing y=2x28x+1y = 2x^2-8x+1 by 22 would produce a different function. So instead you factor 22 out of the first two terms and compensate outside the parentheses, leaving the output values unchanged.

Learn this with a teacher, not a page

The Crimsora tutor teaches Completing the Square live — explaining on a whiteboard, asking you questions, and adapting to where you get stuck.