Integration by Substitution

## **Problem**

**Part 1:** Evaluate the indefinite integral

∫

1

x
2

2
x
7

d
x
.

{\displaystyle \int\frac{1}{x^2 + 2x + 7}\,dx. }

**Part 2:** Evaluate the indefinite integral

∫

4
x
1

x
2

2
x
7

d
x
.

{\displaystyle \int\frac{4x+1}{x^2 + 2x + 7}\,dx. }

**Part 3:** Evaluate the definite integral

∫

0

π

sin
⁡
x

1

cos
2

⁡
x

d
x
.

{\displaystyle \int\_{0}^{\pi} \frac{\sin x}{1+\cos^2 x}\,dx. }

## **Solution**

**Part 1**

This integral requires the use of completing the square for the denominator.

∫

1

x
2

2
x
7

d
# x
∫

1

(
x
1

)
2

6

d
x

{\displaystyle \int\frac{1}{x^2 + 2x + 7}\,dx = \int\frac{1}{(x+1)^2 + 6}\,dx }

Factor out

1
6

{\displaystyle \frac{1}{6}}

 and make the following manipulation:

∫

1

x
2

2
x
7

d
x

=

1
6

∫

1

(
x
1

)
2

6

1

d
x

=

1
6

∫

1

(

x
1

6

)

2

1

d
x

{\displaystyle \begin{align}
\int\frac{1}{x^2 + 2x + 7}\,dx &= \frac{1}{6}\int\frac{1}{\frac{(x+1)^2}{6} + 1}\,dx \\[5 pt]
&=\frac{1}{6}\int\frac{1}{\left(\frac{x+1}{\sqrt{6}}\right)^2 + 1}\,dx
\end{align} }

Make the substitution

# u

x
1

6

{\displaystyle u = \frac{x+1}{\sqrt{6}} }

 and

d
# u

1

6

d
x

{\displaystyle du = \frac{1}{\sqrt{6}}\, dx }

 to get

∫

1

x
2

2
x
7

d
x

=

6

6

∫

1

u
2

1

d
u

=

6

6

arctan
⁡
(
u
)
C

=

6

6

arctan
⁡

(

x
1

6

)

C
.

{\displaystyle \begin{align}
\int\frac{1}{x^2 + 2x + 7}\,dx &= \frac{\sqrt{6}}{6} \int \frac{1}{u^2 + 1} \,du \\[5pt]
&= \frac{\sqrt{6}}{6} \arctan(u) + C \\[5 pt]
&= \frac{\sqrt{6}}{6} \arctan \left(\frac{x+1}{\sqrt{6}}\right) + C.
\end{align} }

**Part 2**

Make the observation

∫

4
x
1

x
2

2
x
7

d
# x
∫

4
x
4

x
2

2
x
7

d
x
−
∫

3

x
2

2
x
7

d
x

{\displaystyle \int\frac{4x+1}{x^2 + 2x + 7}\,dx = \int\frac{4x+4}{x^2 + 2x + 7}\,dx - \int\frac{3}{x^2 + 2x + 7}\,dx }

The first integral can be determined using the substitution method.

∫

4
x
4

x
2

2
x
7

d
# x
2
∫

2
x
2

x
2

2
x
7

d
x

{\displaystyle \int\frac{4x+4}{x^2 + 2x + 7}\,dx = 2 \int\frac{2x+2}{x^2 + 2x + 7}\,dx }

Make the substitution

# u

x
2

2
x
7

{\displaystyle u = x^2 + 2x +7 }

 and

d
# u
2
x
2

d
x

{\displaystyle du = 2x + 2 \,dx }

 to get

∫

4
x
4

x
2

2
x
7

d
x

=
2
∫

1
u

d
u

=
2
ln
⁡
(
u
)

=
2
ln
⁡
(

x
2

2
x
7
)
C
.

{\displaystyle \begin{align}
\int\frac{4x+4}{x^2 + 2x + 7}\,dx &= 2 \int\frac{1}{u}\, du \\[5 pt]
&= 2 \ln(u) \\[5 pt]
& = 2 \ln (x^2 + 2x + 7) + C.
\end{align} }

The second integral is just three times the answer in part 1; therefore,

∫

4
x
1

x
2

2
x
7

d
# x
2
ln
⁡
(

x
2

2
x
7
)
−

6

2

arctan
⁡

(

x
1

6

)

C
.

{\displaystyle \int\frac{4x+1}{x^2 + 2x + 7}\,dx = 2 \ln (x^2 + 2x + 7) - \frac{\sqrt{6}}{2} \arctan \left(\frac{x+1}{\sqrt{6}}\right) + C. }

**Part 3**

Let

# u
cos
⁡
x

{\displaystyle u = \cos x }

, then

d
# u
−
sin
⁡
x

d
x

{\displaystyle du = -\sin x\, dx}

.

To change the bounds, we get

u

=
cos
⁡

(
π
)

=
−
1

u

=
cos
⁡

(
0
)

=

{\displaystyle \begin{align}
u &= \cos{(\pi)} = -1 \\[5 pt]
u &= \cos{(0)} = 1.
\end{align}
 }

Consequently,

∫

0

π

sin
⁡
x

1

cos
2

⁡
x

d
# x

∫

1

−
1

−
1

1

u
2

d
u
.

{\displaystyle \int\_{0}^{\pi} \frac{\sin x}{1+\cos^2 x}\,dx = \int\_{1}^{-1} \frac{-1}{1+u^2} \,du.}

By the integral property

∫

b

a

f
(
x
)

d
# x
−

∫

a

b

f
(
x
)

d
x

{\displaystyle \int\_{b}^{a} f(x) \,dx = -\int\_{a}^{b} f(x) \, dx}

∫

0

π

sin
⁡
x

1

cos
2

⁡
x

d
# x

∫

−
1

1

1

1

u
2

d
u

{\displaystyle \int\_{0}^{\pi} \frac{\sin x}{1+\cos^2 x} \,dx = \int\_{-1}^{1} \frac{1}{1+u^2}\, du}

∫

−
1

1

1

1

u
2

d
# u
arctan
⁡

(
1
)

−
arctan
⁡

(
−
1
)

{\displaystyle \int\_{-1}^{1} \frac{1}{1+u^2} \,du = \arctan{(1)} - \arctan{(-1)}}

∫

−
1

1

1

1

u
2

d
u

=

π
4

−

−
π

4

=

π
2

{\displaystyle \begin{align}
\int\_{-1}^{1} \frac{1}{1+u^2}\,du &= \frac{\pi}{4}-\frac{-\pi}{4} \\[5 pt]
& = \frac{\pi}{2}
\end{align}}

Therefore,

∫

0

π

sin
⁡
x

1

cos
2

⁡
x

d
# x

π
2

.

{\displaystyle \int\_{0}^{\pi} \frac{\sin x}{1+\cos^2 x} \,dx = \frac{\pi}{2}.}