# Trigonometric Integrals

For trigonometric integrals of the form
$$\int \sin ^m x \cdot \cos ^n x \; dx,$$
if

• $$m$$ is odd, then retain a factor of $$\sin x$$ and use the identity $$\sin^2 x = 1- \cos^2 x$$ to rewrite the remaining power of $$\sin x$$ in terms of $$\cos x$$
• $$n$$ is odd, then retain a factor of $$\cos x$$ and use the identity $$\cos^2 = 1 – \sin^2 x$$ to rewrite the remaining power of $$\cos x$$ in terms of $$\sin x$$
• $$m$$ and $$n$$ are both even, then apply the identities
$$\sin^2 x = \frac{1- \cos(2x)}{2} \text{ and } \cos^2 x = \frac{1+ \cos(2x)}{2}$$
$$\sin^2 x = \frac{1- \cos(2x)}{2}$$
and
$$\cos^2 x = \frac{1+ \cos(2x)}{2}$$
$$\sin^2 x = \frac{1- \cos(2x)}{2}$$
and
$$\cos^2 x = \frac{1+ \cos(2x)}{2}$$

to reduce the powers.

Then apply $$u$$-substitution.

For trigonometric integrals of the form
$$\int \sec^m x \cdot \tan^n x \; dx,$$
if

• $$n$$ is odd, then retain a factor of $$\sec x \tan x$$ and use the identity $$\tan^2 x = \sec^2x -1$$ to rewrite the remaining power of $$\tan x$$ in terms of $$\sec x$$.
• $$m$$ is even, then retain a factor of $$\sec^2 x$$ and use the identity $$\sec^2x = \tan^2 x +1$$ to rewrite the remaining power of $$\sec x$$ in terms of $$\tan x$$.

Then apply $$u$$-substitution.

Find
$$\int \sin^7 x \cos^4 x \; dx.$$

\begin{aligned} \int \sin^7 x \cos^4 x \; dx & = \int \sin x (\sin^6 x) \cos ^4 x \; dx \\ & = \int \sin x (\sin^2 x )^3 \cos^4 x \; dx \\ & = \int \sin x (1- \cos^2 x)^3 \cos^4 x \; dx \\ & = \int \sin x (1- u^2)^3 u^4 \frac{du}{- \sin x} \\ & = -\int (1- u^2)^3 u^4 \; du \\ & = -\int (1-3u^2+3u^4 +u^6) u^4 \; du \\ & = -\int u^4-3u^6+3u^8 +u^{10} \; du \\ & = -\frac{u^5}{5}+\frac{3u^7}{7}-\frac{u^9}{3} -\frac{u^{11}}{11}+C \\ & = -\frac{\cos^5x}{5}+\frac{3\cos^7x}{7}-\frac{\cos^9x}{3} -\frac{\cos^{11}x}{11}+C \\ \end{aligned}
\begin{aligned} \int & \sin^7 x \cos^4 x \; dx \\ & = \int \sin x (\sin^6 x) \cos ^4 x \; dx \\ & = \int \sin x (\sin^2 x )^3 \cos^4 x \; dx \\ & = \int \sin x (1- \cos^2 x)^3 \cos^4 x \; dx \\ & = \int \sin x (1- u^2)^3 u^4 \frac{du}{- \sin x} \\ & = -\int (1- u^2)^3 u^4 \; du \\ & = -\int (1-3u^2+3u^4 +u^6) u^4 \; du \\ & = -\int u^4-3u^6+3u^8 +u^{10} \; du \\ & = -\frac{u^5}{5}+\frac{3u^7}{7}-\frac{u^9}{3} -\frac{u^{11}}{11}+C \\ & = -\frac{\cos^5x}{5}+\frac{3\cos^7x}{7}-\frac{\cos^9x}{3} -\frac{\cos^{11}x}{11}+C \end{aligned}
\begin{aligned} & \int \sin^7 x \cos^4 x \; dx \\ & = \int \sin x (\sin^6 x) \cos ^4 x \; dx \\ & = \int \sin x (\sin^2 x )^3 \cos^4 x \; dx \\ & = \int \sin x (1- \cos^2 x)^3 \cos^4 x \; dx \\ & = \int \sin x (1- u^2)^3 u^4 \frac{du}{- \sin x} \\ & = -\int (1- u^2)^3 u^4 \; du \\ & = -\int (1-3u^2+3u^4 +u^6) u^4 \; du \\ & = -\int u^4-3u^6+3u^8 +u^{10} \; du \\ & = -\frac{u^5}{5}+\frac{3u^7}{7}-\frac{u^9}{3} -\frac{u^{11}}{11}+C \\ & = -\frac{\cos^5x}{5}+\frac{3\cos^7x}{7}-\frac{\cos^9x}{3} \\ & \qquad -\frac{\cos^{11}x}{11}+C \\ \end{aligned}

# Trigonometric Substitution

For integrals involving Use the substitution Use the identity
$$\sqrt{a^2-x^2}, \; a>0$$ $$x = a \sin \theta, \; \frac{-\pi}{2} \leq \theta \leq \frac{\pi}{2}$$ $$1- \sin^2 \theta = \cos^2 \theta$$
$$\sqrt{a^2+x^2}, \; a>0$$ $$x = a \tan \theta, \; \frac{-\pi}{2} < \theta < \frac{\pi}{2}$$ $$1+\tan^2 \theta = \sec^2 \theta$$
$$\sqrt{x^2-a^2}, \; a>0$$ $$x = a \sec \theta, \; 0 \leq \theta < \frac{\pi}{2} \text{ or } \frac{\pi}{2} < \theta \leq \pi$$ $$\sec^2 \theta – 1 = \tan^2 \theta$$

# Trigonometric Substitution

For integrals involving Use the substitution Use the identity
$$\sqrt{a^2-x^2}, \; a>0$$ $$x = a \sin \theta, \; \frac{-\pi}{2} \leq \theta \leq \frac{\pi}{2}$$ $$1- \sin^2 \theta = \cos^2 \theta$$
$$\sqrt{a^2+x^2}, \; a>0$$ $$x = a \tan \theta, \; \frac{-\pi}{2} < \theta < \frac{\pi}{2}$$ $$1+\tan^2 \theta = \sec^2 \theta$$
$$\sqrt{x^2-a^2}, \; a>0$$ $$x = a \sec \theta, \; 0 \leq \theta < \frac{\pi}{2} \text{ or } \frac{\pi}{2} < \theta \leq \pi$$ $$\sec^2 \theta – 1 = \tan^2 \theta$$

# Trigonometric Substitution

• For integrals involving $$\sqrt{a^2-x^2}, \; a>0$$
• use the subsitution
$$x = a \sin \theta,$$
where $$\frac{-\pi}{2} \leq \theta \leq \frac{\pi}{2}$$
• and the identity
$$1- \sin^2 \theta = \cos^2 \theta$$
• For integrals involving $$\sqrt{a^2+x^2}, \; a>0$$
• use the substitution
$$x = a \tan \theta,$$
where $$\frac{-\pi}{2} < \theta < \frac{\pi}{2}$$
• and the identity
$$1+\tan^2 \theta = \sec^2 \theta$$
• For integrals involving $$\sqrt{x^2-a^2}, \; a>0$$
• use the substitution
$$x = a \sec \theta,$$
where $$0 \leq \theta < \frac{\pi}{2}$$ or $$\frac{\pi}{2} < \theta \leq \pi$$
• and the identity
$$\sec^2 \theta – 1 = \tan^2 \theta$$
Find
$$\int \frac{1}{(4+x^2)^2} \; dx$$

Let $$x = 2\tan \theta$$ then $$dx = 2\sec^2 \theta \; d \theta$$ and

\begin{aligned} \int \frac{1}{(4+x^2)^2} \; dx & = \int \frac{1}{((4+ (2 \tan \theta )^2)^2} 2\sec^2 \theta \; d \theta \\ & = \int \frac{1}{16(1+\tan^2 \theta)^2} 2\sec^2 \theta \; d \theta \\ & = \int \frac{1}{16 \sec^4 \theta} 2\sec^2 \theta \; d \theta \\ & = \int \frac{1}{8 \sec^2 \theta} \; d \theta = \frac{1}{8}\int \cos^2 \theta \; d \theta \\ & = \frac{1}{8}\int \frac{1+ \cos(2 \theta)}{2} \; d \theta \\ & = \frac{1}{16}\int 1+ \cos(2 \theta) \; d \theta \\ & = \frac{1}{16}\left( \theta+ \frac{\sin(2 \theta)}{2} \right) + C \\ & = \frac{1}{16}\left( \theta+ \frac{2\sin(\theta) \cos(\theta) }{2} \right) + C \\ \end{aligned}
\begin{aligned} \int \frac{1}{(4+x^2)^2} \; dx & = \int \frac{1}{((4+ (2 \tan \theta )^2)^2} 2\sec^2 \theta \; d \theta \\ & = \int \frac{1}{16(1+\tan^2 \theta)^2} 2\sec^2 \theta \; d \theta \\ & = \int \frac{1}{16 \sec^4 \theta} 2\sec^2 \theta \; d \theta \\ & = \int \frac{1}{8 \sec^2 \theta} \; d \theta = \frac{1}{8}\int \cos^2 \theta \; d \theta \\ & = \frac{1}{8}\int \frac{1+ \cos(2 \theta)}{2} \; d \theta \\ & = \frac{1}{16}\int 1+ \cos(2 \theta) \; d \theta \\ & = \frac{1}{16}\left( \theta+ \frac{\sin(2 \theta)}{2} \right) + C \\ & = \frac{1}{16}\left( \theta+ \frac{2\sin(\theta) \cos(\theta) }{2} \right) + C \\ \end{aligned}
\begin{aligned} \int & \frac{1}{(4+x^2)^2} \; dx \\ & = \int \frac{1}{((4+ (2 \tan \theta )^2)^2} 2\sec^2 \theta \; d \theta \\ & = \int \frac{1}{16(1+\tan^2 \theta)^2} 2\sec^2 \theta \; d \theta \\ & = \int \frac{1}{16 \sec^4 \theta} 2\sec^2 \theta \; d \theta \\ & = \int \frac{1}{8 \sec^2 \theta} \; d \theta = \frac{1}{8}\int \cos^2 \theta \; d \theta \\ & = \frac{1}{8}\int \frac{1+ \cos(2 \theta)}{2} \; d \theta \\ & = \frac{1}{16}\int 1+ \cos(2 \theta) \; d \theta \\ & = \frac{1}{16}\left( \theta+ \frac{\sin(2 \theta)}{2} \right) + C \\ & = \frac{1}{16}\left( \theta+ \frac{2\sin(\theta) \cos(\theta) }{2} \right) + C \\ \end{aligned}

Since $$x = 2 \tan \theta$$, $$\tan \theta = \frac{x}{2}$$ and $$\theta = \tan^{-1}\left( \frac{x}{2} \right)$$. Also
$$\sin \theta = \frac{x}{\sqrt{4+x^2}} \text{ and } \cos \theta = \frac{2}{\sqrt{4+x^2}}.$$
So,

\begin{aligned} \int \frac{1}{(4+x^2)^2} \; dx & = \frac{1}{16}\left( \tan^{-1}\left( \frac{x}{2} \right)+ \frac{2\frac{x}{\sqrt{4+x^2}} \frac{2}{\sqrt{4+x^2}}}{2} \right) + C \\ & = \frac{1}{16} \left(\tan^{-1}\left( \frac{x}{2} \right)+ \frac{2x}{\sqrt{4+x^2}} \right) + C \end{aligned}
\begin{aligned} \int & \frac{1}{(4+x^2)^2} \; dx \\ & = \frac{1}{16}\left( \tan^{-1}\left( \frac{x}{2} \right)+ \frac{2\frac{x}{\sqrt{4+x^2}} \frac{2}{\sqrt{4+x^2}}}{2} \right) + C \\ & = \frac{1}{16} \left(\tan^{-1}\left( \frac{x}{2} \right)+ \frac{2x}{\sqrt{4+x^2}} \right) + C \end{aligned}
\begin{aligned} & \int \frac{1}{(4+x^2)^2} \; dx \\ & = \frac{1}{16}\left( \tan^{-1}\left( \frac{x}{2} \right)+ \frac{2\frac{x}{\sqrt{4+x^2}} \frac{2}{\sqrt{4+x^2}}}{2} \right) + C \\ & = \frac{1}{16} \left(\tan^{-1}\left( \frac{x}{2} \right)+ \frac{2x}{\sqrt{4+x^2}} \right) + C \end{aligned}

# Partial Fractions

A rational function
$$\frac{P(x)}{Q(x)}$$
with the degree of $$P(x)$$ less than the degree of $$Q(x)$$, can be rewritten as a sum of fractions as follows:

• For each factor of $$Q(x)$$ of the form $$(ax+b)^m$$, introduce terms
$$\frac{A_1}{ax +b} + \frac{A_2}{(ax+b)^2}+ \cdots +\frac{A_m}{(ax+b)^m}$$
$$\frac{A_1}{ax +b} + \frac{A_2}{(ax+b)^2}+ \cdots +\frac{A_m}{(ax+b)^m}$$
\begin{aligned} & \frac{A_1}{ax +b} + \frac{A_2}{(ax+b)^2} \\ & \qquad+ \cdots +\frac{A_m}{(ax+b)^m} \end{aligned}
• For each factor of $$Q(x)$$ of the form $$(ax^2+bx+c)^m$$, introduce terms
$$\frac{A_1 x + B_1}{ax^2+bx+c}+\frac{A_1 x + B_1}{(ax^2+bx+c)^2}+ \cdots +\frac{A_1 x + B_1}{(ax^2+bx+c)^m}$$
\begin{aligned} & \frac{A_1 x + B_1}{ax^2+bx+c}+\frac{A_1 x + B_1}{(ax^2+bx+c)^2} \\ &+ \cdots +\frac{A_1 x + B_1}{(ax^2+bx+c)^m} \end{aligned}
\begin{aligned} & \frac{A_1 x + B_1}{ax^2+bx+c}+\frac{A_1 x + B_1}{(ax^2+bx+c)^2} \\ &+ \cdots +\frac{A_1 x + B_1}{(ax^2+bx+c)^m} \end{aligned}

where $$A_i$$’s and $$B_i$$’s are constants. At times, for ease of notation, we will use $$A,B,C,D,…$$ in place of $$A_1, B_1,$$ etc… If the degree of $$P(x)$$ is not less than the degree of $$Q(x)$$, long divide first.

Find
$$\int \frac{6x^3-20x^2+53x-87}{x^4-5x^3+15x^2-45x+54}$$
Hint: $$x^2+9$$ is a factor of the denominator.

Since the degree of the numerator is less than the degree the denominator, we start by factoring the denominator completely. Long division of $$x^4-5x^3+15x^2-45x+54$$ by $$x^2 + 9$$ yields:
$$x^2-5x+6$$
which factors as $$(x-3)(x-2)$$. So,

$$\frac{6x^3-20x^2+53x-87}{x^4-5x^3+15x^2-45x+54} = \frac{6x^3-20x^2+53x-87}{(x-3)(x-2)(x^2+9)}$$
\begin{aligned} & \frac{6x^3-20x^2+53x-87}{x^4-5x^3+15x^2-45x+54} \\ & \qquad = \frac{6x^3-20x^2+53x-87}{(x-3)(x-2)(x^2+9)} \end{aligned}
\begin{aligned} & \frac{6x^3-20x^2+53x-87}{x^4-5x^3+15x^2-45x+54} \\ & \qquad = \frac{6x^3-20x^2+53x-87}{(x-3)(x-2)(x^2+9)} \end{aligned}

The partial fractions decomposition of the integrand will be

$$\frac{A}{x-3}+\frac{B}{x-2} + \frac{Cx+D}{x^2+9},$$

where the constants $$A,B,C,$$ and $$D$$ satisfy

$$\frac{6x^3-20x^2+53x-87}{x^4-5x^3+15x^2-45x+54} = \frac{A}{x-3}+\frac{B}{x-2} + \frac{Cx+D}{x^2+9}.$$
\begin{aligned} & \frac{6x^3-20x^2+53x-87}{x^4-5x^3+15x^2-45x+54} \\ & \qquad = \frac{A}{x-3}+\frac{B}{x-2} + \frac{Cx+D}{x^2+9}. \end{aligned}
\begin{aligned} & \frac{6x^3-20x^2+53x-87}{x^4-5x^3+15x^2-45x+54} \\ & \qquad = \frac{A}{x-3}+\frac{B}{x-2} + \frac{Cx+D}{x^2+9}. \end{aligned}

By clearing the denominator we obtain:

\begin{aligned}6 & x^3 -20x^2+53x-87 \\ & = A(x-2)(x^2+9)+B(x-3)(x^2+9) \\ & \qquad + (Cx+D)(x-2)(x-3) \end{aligned}

Evaluate this equation at $$x = 1,2, 3,$$ and $$4$$:

\begin{array}{c | c } x & \begin{aligned}6 & x^3 -20x^2+53x-87 \\ & = A(x-2)(x^2+9)+B(x-3)(x^2+9) \\ & \; \; + (Cx+D)(x-2)(x-3) \end{aligned}\\ \hline 1 & \begin{aligned} & -48 = -10 A – 20 B + 2 C + 2D \\ \Rightarrow & -48 = -30 – 20 + 2C + 2D \\ \Rightarrow & 1 = C+D \end{aligned} \\ \hline 2 & -13 = -13B \Rightarrow B = 1 \\ \hline 3 & 54 = 18A \Rightarrow A = 3 \\ \hline 4 & \begin{aligned} & 189 = 50 A + 25 B + 8C + 2D \\ \Rightarrow & 189 = 150 + 25 + 8C +2D \\ \Rightarrow & 7= 4C+ D \end{aligned} \\ \end{array}
\begin{array}{c | c } x & \begin{aligned}6 & x^3 -20x^2+53x-87 \\ & = A(x-2)(x^2+9)+B(x-3)(x^2+9) \\ & \; \; + (Cx+D)(x-2)(x-3) \end{aligned}\\ \hline 1 & \begin{aligned} & -48 = -10 A – 20 B + 2 C + 2D \\ \Rightarrow & -48 = -30 – 20 + 2C + 2D \\ \Rightarrow & 1 = C+D \end{aligned} \\ \hline 2 & -13 = -13B \Rightarrow B = 1 \\ \hline 3 & 54 = 18A \Rightarrow A = 3 \\ \hline 4 & \begin{aligned} & 189 = 50 A + 25 B + 8C + 2D \\ \Rightarrow & 189 = 150 + 25 + 8C +2D \\ \Rightarrow & 7= 4C+ D \end{aligned} \\ \end{array}
\begin{array}{|c | c |} \hline \scriptstyle x & \begin{aligned}& \scriptstyle 6 x^3 -20x^2+53x-87 \\ & \scriptstyle \quad = A(x-2)(x^2+9)+B(x-3)(x^2+9) \\ & \scriptstyle \qquad + (Cx+D)(x-2)(x-3) \end{aligned}\\ \hline 1 & \begin{aligned} & -48 = -10 A – 20 B + 2 C + 2D \\ \Rightarrow & -48 = -30 – 20 + 2C + 2D \\ \Rightarrow & 1 = C+D \end{aligned} \\ \hline 2 & -13 = -13B \Rightarrow B = 1 \\ \hline 3 & 54 = 18A \Rightarrow A = 3 \\ \hline 4 & \begin{aligned} & 189 = 50 A + 25 B + 8C + 2D \\ \Rightarrow & 189 = 150 + 25 + 8C +2D \\ \Rightarrow & 7= 4C+ D \end{aligned} \\ \hline \end{array}

So, $$A = 3$$ and $$B = 1$$. To find $$C$$ and $$D$$, solve the system:
$$\begin{cases} 1 & = C &+ D \\ 7 & = 4C &+ D \end{cases}$$

This system has solutions $$C = 2$$ and $$D = -1$$.

So,

\begin{aligned} & \int \frac{6x^3-20x^2+53x-87}{x^4-5x^3+15x^2-45x+54} \; dx \\ &= \int \left(\frac{A}{x-3}+\frac{B}{x-2} + \frac{Cx+D}{x^2+9} \right) \; dx\\ &= \int \left(\frac{3}{x-3}+\frac{1}{x-2} + \frac{2x-1}{x^2+9} \right) \; dx\\ &= \int \frac{3}{x-3} \; dx + \int \frac{1}{x-2} \; dx + \int \frac{2x-1}{x^2+9} \; dx \\ & = 3\ln|x-3| + \ln|x-2| + \int \frac{2x}{x^2+9} \; dx \\ & \qquad- \int \frac{1}{x^2+9} \; dx \\ & = 3 \ln|x-3| + \ln|x-2| + \ln|x^2+9| \\ & \qquad – \frac{1}{3}\tan^{-1}\left(\frac{x}{3} \right) + C \end{aligned}
\begin{aligned} & \int \frac{6x^3-20x^2+53x-87}{x^4-5x^3+15x^2-45x+54} \; dx \\ &= \int \left(\frac{A}{x-3}+\frac{B}{x-2} + \frac{Cx+D}{x^2+9} \right) \; dx\\ &= \int \left(\frac{3}{x-3}+\frac{1}{x-2} + \frac{2x-1}{x^2+9} \right) \; dx\\ &= \int \frac{3}{x-3} \; dx + \int \frac{1}{x-2} \; dx + \int \frac{2x-1}{x^2+9} \; dx \\ & = 3\ln|x-3| + \ln|x-2| + \int \frac{2x}{x^2+9} \; dx \\ & \qquad- \int \frac{1}{x^2+9} \; dx \\ & = 3 \ln|x-3| + \ln|x-2| + \ln|x^2+9| \\ & \qquad – \frac{1}{3}\tan^{-1}\left(\frac{x}{3} \right) + C \end{aligned}
\begin{aligned} & \int \frac{6x^3-20x^2+53x-87}{x^4-5x^3+15x^2-45x+54} \; dx \\ & = \int \left(\frac{A}{x-3}+\frac{B}{x-2} + \frac{Cx+D}{x^2+9} \right) \; dx\\ & = \int \left(\frac{3}{x-3}+\frac{1}{x-2} + \frac{2x-1}{x^2+9} \right) \; dx\\ & = \int \frac{3}{x-3} \; dx + \int \frac{1}{x-2} \; dx \\ & \qquad + \int \frac{2x-1}{x^2+9} \; dx \\ & = 3\ln|x-3| + \ln|x-2| + \int \frac{2x}{x^2+9} \; dx \\ & \qquad – \int \frac{1}{x^2+9} \; dx \\ & = 3 \ln|x-3| + \ln|x-2| + \ln|x^2+9| \\ & \qquad – \frac{1}{3}\tan^{-1}\left(\frac{x}{3} \right) + C \end{aligned}