Expand menu menu_open Minimize Go to startpage home Home History history History expand_more
{{ item.displayTitle }}
navigate_next
No history yet!
Progress & Statistics equalizer Progress expand_more
Student
navigate_next
Teacher
navigate_next
{{ filterOption.label }}
{{ item.displayTitle }}
{{ item.subject.displayTitle }}
arrow_forward
No results
{{ searchError }}
search
menu
{{ courseTrack.displayTitle }} {{ printedBook.courseTrack.name }} {{ printedBook.name }}
{{ statistics.percent }}% Sign in to view progress
search Use offline Tools apps
Digital tools Graphing calculator Geometry 3D Graphing calculator Geogebra Classic Mathleaks Calculator Codewindow
Course & Book Compare textbook Studymode Stop studymode Print course
Tutorials Video tutorials Formulary

Video tutorials

How Mathleaks works

Mathleaks Courses

How Mathleaks works

play_circle_outline
Study with a textbook

Mathleaks Courses

How to connect a textbook

play_circle_outline

Mathleaks Courses

Find textbook solutions in the app

play_circle_outline
Tools for students & teachers

Mathleaks Courses

Share statistics with a teacher

play_circle_outline

Mathleaks Courses

How to create and administrate classes

play_circle_outline

Mathleaks Courses

How to print out course materials

play_circle_outline

Formulary

Formulary for text courses looks_one

Course 1

looks_two

Course 2

looks_3

Course 3

looks_4

Course 4

looks_5

Course 5

Login account_circle menu_open

Completing the Square

Quadratic expressions, functions, and equations can all be manipulated in useful ways with a method called completing the square. This method is based on the concept of perfect square trinomials.
Concept

Perfect Square Trinomial

Sometimes, when factoring a quadratic trinomial, the resulting two binomials are identical. In these cases, the binomials can be written as a square. x2+2bx+b2(x+b)(x+b)(x+b)2\begin{gathered} x^2+2bx+b^2\\ \downarrow\\ (x + b)(x + b)\\ \downarrow\\ (x + b)^2 \end{gathered}

A trinomial that can be factored like this is called a perfect square trinomial. Rewriting quadratic expressions to include a perfect square trinomial can be useful when dealing with quadratic functions or quadratic equations.
Rule

Factoring a Perfect Square Trinomial

To be able to rewrite an expression to include a perfect square trinomial, it is first necessary to be able to recognize them. This can be achieved by expanding the square of a general binomial. The factoring is then done in the opposite direction. There are two kinds of perfect square trinomials, leading to different signs between the terms in the binomial.

Rule

info
a2+2ab+b2=(a+b)2a^2 + 2ab + b^2 = (a + b)^2

If a trinomial is in the form a2+2ab+b2,a^2 + 2ab + b^2, where aa and bb are variables or positive numbers, it is a perfect square trinomial that can be factored as (a+b)2.(a+b)^2. This is shown by expanding the squared binomial.

(a+b)2(a + b)^2
(a+b)(a+b)(a + b)(a + b)
aa+ab+ba+bba \cdot a + a \cdot b + b \cdot a + b \cdot b
a2+ab+ab+b2a^2 + ab + ab + b^2
a2+2ab+b2a^2 + 2ab + b^2

Thus, the trinomial and the square are equal.

Rule

info
a22ab+b2=(ab)2a^2 - 2ab + b^2 = (a - b)^2

If a trinomial instead is in the form a22ab+b2,a^2 - 2ab + b^2, it is also a perfect square trinomial and can be factored as (ab)2.(a-b)^2. This is shown by expanding the squared binomial.

(ab)2(a - b)^2
(ab)(ab)(a - b)(a - b)
aa+a(-b)+(-b)a+(-b)(-b)a \cdot a + a \cdot (\text{-} b) + (\text{-} b) \cdot a + (\text{-} b) \cdot (\text{-} b)
a2abab+b2a^2 - ab - ab + b^2
a22ab+b2a^2 - 2ab + b^2

The trinomial and the square are indeed equal.

Exercise

The expressions in the table below are perfect square trinomials. Complete the expressions to ensure equivalence between corresponding standard forms and factored forms.

standard form factored form
x22x+1x^2-2x+1 (x(x__ ___)2)^2
x2x^2-___x+x+___ (x7)2(x-7)^2
x210x+x^2-10x+___ (x(x__ ___)2)^2
x2+x^2+___x+100x+100 (x(x__ ___)2)^2
Solution

To begin, we'll write the expression in the first row in factored form without explicitly factoring it. If x22x+1x^2-2x+1 factors to be (x(x__s)2,s)^2, both of the following statements must be true. s+s=-2andss=1. s+s=\text{-} 2 \quad \text{and} \quad s \cdot s=1. It follows that s=-1.s=\text{-} 1. Thus, in factored form x22x+1=(x1)2. x^2-2x+1 = (x-1)^2. We can use this reasoning to complete the other perfect square trinomials in the table. Next, we'll consider the second row. Notice that -7+(-7)=-14and-7(-7)=49. \text{-} 7 +(\text{-} 7)=\text{-} 14 \quad \text{and} \quad \text{-} 7 (\text{-} 7) =49. Thus, x214x+49=(x7)2.x^2-14x+49=(x-7)^2. Moving on to the third row, we can see that we're given the coefficient of the xx-term. Since s+ss+s must equal -10,\text{-} 10, s=-5.s=\text{-} 5. The constant term of the trinomial can be found by squaring -5.\text{-} 5. Thus, x210x+25=(x5)2. x^2-10x+25=(x-5)^2. In the last row of the table, we're given the constant term of the trinomial. Since sss \cdot s must equal 100,100, it follows that s=10.s=10. The coefficient of the xx-term can be found by adding 1010 to itself. Thus, x2+20x+100=(x+10)2. x^2+20x+100=(x+10)^2. We'll summarize our results by adding the found values to the table.

standard form factored form
x22x+1x^2-2x+1 (x1)2(x-1)^2
x214x+49x^2-14x+49 (x7)2(x-7)^2
x210x+25x^2-10x+25 (x5)2(x-5)^2
x2+20x+100x^2+20x+100 (x+10)2(x+10)^2
info Show solution Show solution
Concept

Completing the Square

For an expression of the form x2+bx,x^2 + bx, where bb is some number, a constant cc can be added to create a perfect square trinomial. This process is called completing the square. If the value of cc is chosen with care, x2+bx+c x^2 + bx + c

is a perfect square trinomial and can be factored. Completing the square of a quadratic function in standard form turns it into its vertex form. It can also be used to solve any quadratic equation.
Method

Completing the Square to Rewrite a Quadratic Expression

All quadratic expressions in standard form can be rewritten by completing the square. One example of how this can be used in practice is to rewrite the function f(x)=2x2+12x+2 f(x) = 2x^2 + 12x + 2 in vertex form to determine the vertex.

1

Factor the coefficient of x2x^2

Completing the square is easiest done when the expression is written in the form x2+bx.x^2 + bx. Therefore, any coefficient of x2x^2 that does not equal 11 should be factored out. Here, this means factoring 22 out of the expression. f(x)=2x2+12x+2f(x)=2(x2+6x+1) f(x) = 2x^2 + 12x + 2 \quad \Leftrightarrow \quad f(x) = 2(x^2 + 6x + 1)

2

Identify the constant needed to complete the square

The constant cc that is necessary to complete the square can now be identified by focusing on the x2x^2- and xx- terms, while ignoring the rest. It's found either by comparing the binomial to the general perfect square trinomials, a2+2ab+b2anda22ab+b2, a^2 + 2ab + b^2 \quad \text{and} \quad a^2 - 2ab + b^2, or by squaring half the coefficient of x.x. The binomial that should be studied in ff is x2+6x.x^2 + 6x. Since the terms are added, it can be compared to the perfect square trinomial a2+2ab+b2. a^2 + 2ab + b^2. The second term of the trinomial consists of the factors 2,2, a,a, and b.b. Rewriting x2+6xx^2 + 6x so that its second term consists of three factors, 22 being the first, helps with identifying how to complete the square.

x2+6xx^2 + 6x
x2+23xx^2 + 2 \cdot 3x
x2+2x3x^2 + 2x \cdot 3

It can now be identified that xx corresponds to aa in the trinomial, and that 33 corresponds to b.b. Therefore, the missing constant is 32.3^2. Alternatively, it can be found by squaring half the coefficient of x,x, 66 in this case. (62)2=32 \left( \dfrac 6 2 \right)^2 = 3^2 With both methods, the missing constant is found to be 32.3^2. Leaving the constant as a power makes the next steps a bit quicker.


3

Complete the square

The square can now be completed by adding and subtracting the found constant. In the example, the constant 323^2 should be added and subtracted inside the parenthesis. f(x)=2[(x2+6x)+1]f(x)=2[(x2+6x+32)32+1] f(x) = 2 \left[ \left(x^2 + 6x \right) + 1 \right] \quad \Leftrightarrow \quad f(x) = 2 \left[ \left( x^2 + 6x + 3^2 \right) - 3^2 + 1 \right] The resulting trinomial, x2+6x+32,x^2 + 6x + 3^2, is now a perfect square.

4

Factor the perfect square trinomial

The perfect square trinomial can now be factored as normal.

f(x)=2[(x2+6x+32)32+1]f(x) = 2 \left[ \left( x^2 + 6x + 3^2 \right) - 3^2 + 1 \right]
f(x)=2[(x2+2x3+32)32+1]f(x) = 2 \left[ \left( x^2 + 2x \cdot 3 + 3^2 \right) - 3^2 + 1 \right]
f(x)=2[(x+3)232+1]f(x) = 2 \left[ (x + 3)^2 - 3^2 + 1 \right]


5

Simplify the expression

Finally, the expression can be simplified. For the example, the goal is to write the function in vertex form to determine the vertex. To achieve this, the terms have to be simplified.

f(x)=2[(x+3)232+1]f(x) = 2 \left[ (x + 3)^2 - 3^2 + 1 \right]
f(x)=2[(x+3)29+1]f(x) = 2 \left[ (x + 3)^2 - 9 + 1 \right]
f(x)=2[(x+3)28]f(x) = 2 \left[ (x + 3)^2 - 8 \right]
f(x)=2(x+3)216f(x) = 2(x + 3)^2 - 16

The function is now written in vertex form. It can be seen that the vertex is (-3,-16).(\text{-} 3, \text{-} 16).


When completing the square to solve an equation, it is possible to think of the process as a geometric one, instead of being purely algebraic.
Exercise

Consider the quadratic function f(x)=x2x0.75. f(x)=x^2-x-0.75. Complete the square to determine the vertex and zeros of the parabola. Then, use them to draw the graph.

Solution
To begin, we'll complete the square on ff by focusing on the coefficient of x,x, which is -1.\text{-} 1. Since (-12)2=0.25,\left( \frac{\text{-} 1}{2} \right)^2=0.25, 0.250.25 is the constant term that will create a perfect square trinomial.
f(x)=x2x0.75f(x)=x^2-x-0.75
f(x)=(x2x+0.25)0.750.25f(x)= \left( x^2-x+{\color{#0000FF}{0.25}} \right)-0.75-{\color{#0000FF}{0.25}}
f(x)=(x0.5)20.750.25f(x)=(x-0.5)^2 -0.75 -0.25
f(x)=(x0.5)21f(x)=(x-0.5)^2-1
Notice that ff is now written in vertex form. It can be seen that ff's vertex is (0.5,-1).(0.5,\text{-} 1). To find the zeros we can set f(x)f(x) equal to 00 and solve.
0=(x0.5)210=(x-0.5)^2-1
1=(x0.5)21=(x-0.5)^2
(x0.5)2=1(x-0.5)^2 = 1
x0.5=±1x-0.5 = \pm 1
x=0.5±1x = 0.5 \pm 1
x1=-0.5x2=1.5\begin{array}{l}x_1 = \text{-} 0.5 \\ x_2 = 1.5 \end{array}
Thus, the zeros of the parabola are x=-0.5x=\text{-} 0.5 and x=1.5.x=1.5. Lastly, we can use the vertex and the zeros to draw the graph of f.f.
info Show solution Show solution
{{ 'mldesktop-placeholder-grade-tab' | message }}
{{ 'mldesktop-placeholder-grade' | message }} {{ article.displayTitle }}!
{{ grade.displayTitle }}
{{ exercise.headTitle }}
{{ 'ml-tooltip-premium-exercise' | message }}
{{ 'ml-tooltip-programming-exercise' | message }} {{ 'course' | message }} {{ exercise.course }}
Test
{{ 'ml-heading-exercise' | message }} {{ focusmode.exercise.exerciseName }}
{{ 'ml-btn-previous-exercise' | message }} arrow_back {{ 'ml-btn-next-exercise' | message }} arrow_forward