# Calculus/Integration techniques/Trigonometric Integrals

 ← Integration techniques/Trigonometric Substitution Calculus Integration techniques/Partial Fraction Decomposition → Integration techniques/Trigonometric Integrals

When the integrand is primarily or exclusively based on trigonometric functions, the following techniques are useful.

### Powers of Sine and Cosine

We will give a general method to solve generally integrands of the form ${\displaystyle \cos ^{m}(x)\cdot \sin ^{n}(x)}$  . First let us work through an example.

${\displaystyle \int \cos ^{3}(x)\sin ^{2}(x)dx}$

Notice that the integrand contains an odd power of cos. So rewrite it as

${\displaystyle \int \cos ^{2}(x)\sin ^{2}(x)\cos(x)dx}$

We can solve this by making the substitution ${\displaystyle u=\sin(x)}$  so ${\displaystyle du=\cos(x)dx}$  . Then we can write the whole integrand in terms of ${\displaystyle u}$  by using the identity

${\displaystyle \cos ^{2}(x)=1-\sin ^{2}(x)=1-u^{2}}$  .

So

 ${\displaystyle \int \cos ^{3}(x)\sin ^{2}(x)dx}$ ${\displaystyle =\int \cos ^{2}(x)\sin ^{2}(x)\cos(x)dx}$ ${\displaystyle =\int (1-u^{2})u^{2}du}$ ${\displaystyle =\int u^{2}du-\int u^{4}du}$ ${\displaystyle ={\frac {u^{3}}{3}}+{\frac {u^{5}}{5}}+C}$ ${\displaystyle ={\frac {\sin ^{3}(x)}{3}}-{\frac {\sin ^{5}(x)}{5}}+C}$

This method works whenever there is an odd power of sine or cosine.

To evaluate ${\displaystyle \int \cos ^{m}(x)\sin ^{n}(x)dx}$  when either ${\displaystyle m}$  or ${\displaystyle n}$  is odd.

• If ${\displaystyle m}$  is odd substitute ${\displaystyle u=\sin(x)}$  and use the identity ${\displaystyle \cos ^{2}(x)=1-\sin ^{2}(x)=1-u^{2}}$  .
• If ${\displaystyle n}$  is odd substitute ${\displaystyle u=\cos(x)}$  and use the identity ${\displaystyle \sin ^{2}(x)=1-\cos ^{2}(x)=1-u^{2}}$  .

#### Example

Find ${\displaystyle \int \limits _{0}^{\frac {\pi }{2}}\cos ^{40}(x)\sin ^{3}(x)dx}$  .

As there is an odd power of ${\displaystyle \sin }$  we let ${\displaystyle u=\cos(x)}$  so ${\displaystyle du=-\sin(x)dx}$  . Notice that when ${\displaystyle x=0}$  we have ${\displaystyle u=\cos(0)=1}$  and when ${\displaystyle x={\frac {\pi }{2}}}$  we have ${\displaystyle u=\cos({\tfrac {\pi }{2}})=0}$  .

 ${\displaystyle \int \limits _{0}^{\frac {\pi }{2}}\cos ^{40}(x)\sin ^{3}(x)dx}$ ${\displaystyle =\int \limits _{0}^{\frac {\pi }{2}}\cos ^{40}(x)\sin ^{2}(x)\sin(x)dx}$ ${\displaystyle =-\int \limits _{1}^{0}u^{40}(1-u^{2})du}$ ${\displaystyle =\int \limits _{0}^{1}u^{40}(2-u^{2})du}$ ${\displaystyle =\int \limits _{0}^{5}(u^{40}-u^{42})du}$ ${\displaystyle =\left({\frac {u^{41}}{41}}-{\frac {u^{43}}{43}}\right){\Bigg |}_{0}^{1}}$ ${\displaystyle ={\frac {1}{41}}-{\frac {1}{43}}}$

When both ${\displaystyle m}$  and ${\displaystyle n}$  are even, things get a little more complicated.

To evaluate ${\displaystyle \int \cos ^{m}(x)\sin ^{n}(x)dx}$  when both ${\displaystyle m}$  and ${\displaystyle n}$  are even.

Use the identities ${\displaystyle \sin ^{2}(x)={\frac {1-\cos(2x)}{2}}}$  and ${\displaystyle \cos ^{2}(x)={\frac {1+\cos(2x)}{2}}}$  .

#### Example

Find ${\displaystyle \int \sin ^{2}(x)\cos ^{4}(x)dx}$  .

As ${\displaystyle \sin ^{2}(x)={\frac {1-\cos(2x)}{2}}}$  and ${\displaystyle \cos ^{2}(x)={\frac {1+\cos(2x)}{2}}}$  we have

${\displaystyle \int \sin ^{2}(x)\cos ^{4}(x)dx=\int \left({\frac {1-\cos(2x)}{2}}\right)\left({\frac {1+\cos(2x)}{2}}\right)^{2}dx}$

and expanding, the integrand becomes

${\displaystyle {\frac {1}{8}}\int \left(1-\cos ^{2}(2x)+\cos(2x)-\cos ^{3}(2x)\right)dx}$

Using the multiple angle identities

 ${\displaystyle I}$ ${\displaystyle ={\frac {1}{8}}\left(\int 1dx-\int \cos ^{2}(2x)dx+\int \cos(2x)dx-\int \cos ^{3}(2x)dx\right)}$ ${\displaystyle ={\frac {1}{8}}\left(x-{\frac {1}{2}}\int {\Big (}1+\cos(4x){\Big )}dx+{\frac {\sin(2x)}{2}}-\int \cos ^{2}(2x)\cos(2x)dx\right)}$ TODO: CORRECT FORMULA${\displaystyle ={\frac {1}{164}}\left(x+\sin(2x)+\int \cos(4x)dx-2\int {\Big (}1-\sin ^{2}(2x){\Big )}\cos(2x)dx\right)}$

then we obtain on evaluating

${\displaystyle I={\frac {x}{16}}-{\frac {\sin(4x)}{64}}+{\frac {\sin ^{3}(2x)}{48}}+C}$

### Powers of Tan and Secant

To evaluate ${\displaystyle \int \tan ^{m}(x)\sec ^{n}(x)dx}$  .

1. If ${\displaystyle n}$  is even and ${\displaystyle n\geq 2}$  then substitute ${\displaystyle u=tan(x)}$  and use the identity ${\displaystyle \sec ^{2}(x)=1+\tan ^{2}(x)}$  .
2. If ${\displaystyle n}$  and ${\displaystyle m}$  are both odd then substitute ${\displaystyle u=\sec(x)}$  and use the identity ${\displaystyle \tan ^{2}(x)=\sec ^{2}(x)-1}$  .
3. If ${\displaystyle n}$  is odd and ${\displaystyle m}$  is even then use the identity ${\displaystyle \tan ^{2}(x)=\sec ^{2}(x)-1}$  and apply a reduction formula to integrate ${\displaystyle \sec ^{j}(x)dx}$  , using the examples below to integrate when ${\displaystyle j=1,2}$  .

#### Example 1

Find ${\displaystyle \int \sec ^{2}(x)dx}$  .

There is an even power of ${\displaystyle \sec(x)}$  . Substituting ${\displaystyle u=\tan(x)}$  gives ${\displaystyle du=\sec ^{2}(x)dx}$  so

${\displaystyle \int \sec ^{2}(x)dx=\int du=u+C=\tan(x)+C.}$

#### Example 2

Find ${\displaystyle \int \tan(x)dx}$  .

Let ${\displaystyle u=\cos(x)}$  so ${\displaystyle du=-\sin(x)dx}$  . Then

 ${\displaystyle \int \tan(x)dx}$ ${\displaystyle =\int {\frac {\sin(x)}{\cos(x)}}dx}$ ${\displaystyle =\int -{\frac {du}{u}}}$ ${\displaystyle =-\ln |u|+C}$ ${\displaystyle =-\ln {\Big |}\cos(x){\Big |}+C}$ ${\displaystyle =\ln {\Big |}\sec(x){\Big |}+C}$

#### Example 3

Find ${\displaystyle \int \sec(x)dx}$  .

The trick to do this is to multiply and divide by the same thing like this:

 ${\displaystyle \int \sec(x)dx}$ ${\displaystyle =\int \sec(x){\frac {\sec(x)+\tan(x)}{\sec(x)+\tan(x)}}dx}$ ${\displaystyle =\int {\frac {\sec ^{2}(x)+\sec(x)\tan(x)}{\sec(x)+\tan(x)}}dx}$

Making the substitution ${\displaystyle u=\sec(x)+\tan(x)}$  so ${\displaystyle du=\sec(x)\tan(x)+\sec ^{2}(x)dx}$  ,

 ${\displaystyle \int \sec(x)dx}$ ${\displaystyle =\int {\frac {du}{u}}}$ ${\displaystyle =\ln |u|+C}$ ${\displaystyle \ln {\Big |}\sec(x)+\tan(x){\Big |}+C}$

### More trigonometric combinations

For the integrals ${\displaystyle \int \sin(nx)\cos(mx)dx}$  or ${\displaystyle \int \sin(nx)\sin(mx)dx}$  or ${\displaystyle \int \cos(nx)\cos(mx)dx}$  use the identities

• ${\displaystyle \sin(a)\cos(b)={\frac {\sin(a+b)+\sin(a-b)}{2}}}$
• ${\displaystyle \sin(a)\sin(b)={\frac {\cos(a-b)-\cos(a+b)}{2}}}$
• ${\displaystyle \cos(a)\cos(b)={\frac {\cos(a-b)+\cos(a+b)}{2}}}$

#### Example 1

Find ${\displaystyle \int \sin(3x)\cos(5x)dx}$  .

We can use the fact that ${\displaystyle \sin(a)\cos(b)={\frac {\sin(a+b)+\sin(a-b)}{2}}}$  , so

${\displaystyle \sin(3x)\cos(5x)={\frac {\sin(8x)+\sin(-2x)}{2}}}$

Now use the oddness property of ${\displaystyle \sin(x)}$  to simplify

${\displaystyle \sin(3x)\cos(5x)={\frac {\sin(8x)-\sin(2x)}{2}}}$

And now we can integrate

 ${\displaystyle \int \sin(3x)\cos(5x)dx}$ ${\displaystyle =\int {\Big (}{\frac {\sin(8x)-\sin(2x)}{2}}{\Big )}dx}$ ${\displaystyle ={\frac {\cos(2x)}{4}}-{\frac {\cos(8x)}{16}}+C}$

#### Example 2

Find:${\displaystyle \int \sin(x)\sin(2x)dx}$  .

Using the identities

${\displaystyle \sin(x)\sin(2x)={\frac {\cos(-x)-\cos(3x)}{2}}={\frac {\cos(x)-\cos(3x)}{2}}}$

Then

 ${\displaystyle \int \sin(x)\sin(2x)dx}$ ${\displaystyle ={\frac {1}{2}}\int {\Big (}\cos(x)-\cos(3x){\Big )}dx}$ ${\displaystyle ={\frac {\sin(x)}{2}}-{\frac {\sin(3x)}{6}}+C}$
 ← Integration techniques/Trigonometric Substitution Calculus Integration techniques/Partial Fraction Decomposition → Integration techniques/Trigonometric Integrals