back to the math tutorial index back to the math tutorial index

Computing Integrals by Completing the Square

We will review the method of completing the square in the context of evaluating integrals.

Example

Let's start by evaluating

ó
õ
dx
2x2-12x+26
.

The denominator does not factor with rational coefficients, so partial fractions is not a viable option. There is also no obvious substitution to make. Instead, we will complete the square in the denominator to get a recognizable form for the integral.

Now

2x2-12x+26 = 2[x2-6x+13]
Factor out the
coefficient of x2
= 2[(x2-6x+9)+4]
1/2(-6) = -3
(-3)2 = 9
so group x2-6x+9
= 2[(x-3)2+4].
Factor your
perfect square.

Returning to the integral,

ó
õ
dx
2x2-12x+26
=
ó
õ
dx
2[(x-3)2+4]
=
1
2
ó
õ
dx
(x-3)2+22
    
ó
õ
du
u2 + a2
= 1
a
arctan æ
ç
è
u
a
ö
÷
ø
+C
=
1
2
é
ê
ë
1
2
arctan((x-3)/2) ù
ú
û
+C
=
1
4
arctan æ
ç
è
x-3
2
ö
÷
ø
+C.

Certain other types of integrals can be evaluated by this method as well:

Example

Consider

ó
õ


        dx         
   ________
Ö21-4x-x2
.


Now

21-4x-x2 = 21-[x2+4x]
Factor out the
coefficient (-1) of x2
= 21+4-[x2+4x+4]
1/2(4) = 2
22 = 4
so group x2+4x+4
= 25-(x+2)2.
Factor your
perfect square

Returning to the integral,

ó
õ


        dx         
   ________
Ö21-4x-x2
=

ó
õ


        dx         
   ________
Ö25-(x+2)2
    
ó
õ


      du       
   ______
Ö a2 - u2
= arcsin æ
ç
è
u
a
ö
÷
ø
+C
=
arcsin æ
ç
è
x+2
5
ö
÷
ø
+C.

Completing the square is a powerful method that is used to derive the quadratic formula:

We will find the roots of ax2+bx+c = 0.

ax2 + bx + c = 0
x2 + b
a
x + c
a
= 0
Divide through by a
x2 + b
a
x
=
- c
a
Move the constant
c
a
to the right)
x2 + b
a
x + b2
4a2
=
b2
4a2
- c
a
Add the square of
1/2[coefficient of x]
to both sides)
æ
ç
è
x + b
2a
ö
÷
ø
2

 
=
b2 - 4ac
4a2
Factor the left as a
perfect square;
simplify the right
x + b
2a
=
      ______
± Öb2 - 4ac

2a

Take the square root
of both sides)
x =
           ______
-b ± Öb2 - 4ac

2a

Solve for x
which is the familiar quadratic formula!


Key Concept

By completing the square, we may rewrite any quadratic polynomial

ax2 + bx + c
in the form
a[(x+k1)2+k2]
where k1 and k2 may be positive or negative. Integrals containing negative or non-integer powers of ax2+bx+c can often be computed using a trigonometric substitution or looked up in an integral table after being rewritten in this form.