Trigonometric Integrals

In this section, we'll revisit u-substitution, but specifically for trigonometric functions.

Specifically, we'll solve problems of the form sinmx cosnx dx\int \sin^m x\ \cos^n x\ dx and secmx tannx dx.\int \sec^m x\ \tan^n x\ dx.

To do all the examples in this section, we'll need to review some trig identities, as well as trig derivatives, but before we do, we'll start with a few simple examples.

Evaluate sin2x cosx dx\displaystyle\int \sin^2 x\ \cos x \ dx.


If we let u=sinxu=\sin x, then du=cosx dxdu = \cos x\ dx, so sin2x cosx dx=u2 du=13u3+C=13sin3x+C\begin{aligned} \int \sin^2 x\ \cos x \ dx &= \int u^2 \ du\ &= \dfrac{1}{3}u^3 + C\ &= \ans{\dfrac{1}{3}\sin^3 x + C} \end{aligned}

Evaluate sinxcos4x dx\displaystyle\int \dfrac{\sin x}{\cos^4 x}\ dx.


This time, let u=cosxu=\cos x so that du=sinx dxdu = -\sin x \ dx, or du=sinx dx-du = \sin x \ dx.

Then sinxcos4x dx=1u4 du=u4 du=13u3+C=13cos3x+C\begin{aligned} \int \dfrac{\sin x}{\cos^4 x} \ dx &= \int -\dfrac{1}{u^4} \ du\ &= \int -u^{-4}\ du\ &= \dfrac{1}{3}u^{-3} + C\ &= \ans{\dfrac{1}{3 \cos^3 x} + C} \end{aligned}

Evaluate tanx dx\displaystyle\int \tan x\ dx.


Once we rewrite tanx\tan x as sinxcosx\dfrac{\sin x}{\cos x}, this problem looks a lot like the previous one.

We can let u=cosxu=\cos x again, so that du=sinx dx-du = \sin x \ dx: tanx dx=sinxcosx dx=1u du=lnu+C=lncosx+C\begin{aligned} \int \tan x\ dx = \int \dfrac{\sin x}{\cos x} \ dx &= \int -\dfrac{1}{u} \ du\ &= -\ln u + C\ &= \ans{-\ln |\cos x| + C} \end{aligned}

Before we do more examples, let's review a few trigonometric identities.

Reviewing Identities

The most important trigonometric identity of all is sin2x+cos2x=1\sin^2 x + \cos^2 x = 1

Dividing that identity by cos2x\cos^2 x gives another variation: tan2x+1=sec2x\tan^2 x + 1 = \sec^2 x

Besides that, we need the half-angle identities: sin2x=1212cos(2x)cos2x=12+12cos(2x)\begin{aligned} \sin^2 x &= \dfrac{1}{2}-\dfrac{1}{2}\cos(2x)\ \cos^2 x &= \dfrac{1}{2}+\dfrac{1}{2}\cos(2x) \end{aligned}

Finally, recall the following derivatives: ddx[secx]=secxtanxddx[tanx]=sec2x\begin{aligned} \dfrac{d}{dx}[\sec x] &= \sec x \tan x\ \dfrac{d}{dx}[\tan x] &= \sec^2 x \end{aligned}

sinmx cosnx dx\displaystyle\int \sin^m x\ \cos^n x\ dx

In this form, uu will either be the sine or cosine function; we just need to figure out which one.

Take a look at the first examples we did: we want dudu to be the one that appears once. For instance, to evaluate sin2x cosx dx\int \sin^2 x\ \cos x\ dx we would want cosx\cos x to be dudu, so we'd let u=sinxu=\sin x. On the other hand, to evaluate sinx cos2x dx\int \sin x\ \cos^2 x\ dx we would let u=cosxu=\cos x so that dudu would involve sinx\sin x.

What about sin3x cos2x dx?\int \sin^3 x\ \cos^2 x\ dx?

If u=sinxu=\sin x and du=cosx dxdu=\cos x\ dx, there would be a leftover cosx\cos x after substituting, which is a problem. On the other hand, if u=cosxu=\cos x and du=sinx dx-du = \sin x \ dx, after substituting we'd have sin2x u2 du\int -\sin^2 x\ u^2\ du

We can deal with this leftover sin2x\sin^2 x by using the identity sin2x+cos2x=1\sin^2 x + \cos^2 x = 1 (1cos2x)u2 du=(1u2)u2 du\int -(1-\cos^2 x) u^2\ du = \int -(1-u^2)u^2\ du

Finally, we can integrate this: u2+u4 du=13u3+15u5+C=13cos3x+15cos5x+C\begin{aligned} \int -u^2+u^4\ du &= -\dfrac{1}{3}u^3+\dfrac{1}{5}u^5 + C\ &= -\dfrac{1}{3}\cos^3 x + \dfrac{1}{5}\cos^5 x + C \end{aligned}

Evaluate sin2x cos3x dx\displaystyle\int \sin^2 x\ \cos^3 x\ dx.


Following what we just saw, we want to split off a single cosx\cos x - that'll serve as dudu eventually, and the leftover cos2x\cos^2 x can be replaced with 1sin2x1-\sin^2 x. sin2x cos3x dx=sin2x cos2x cosx dx=sin2x (1sin2x) cosx dx\begin{aligned} \int \sin^2 x\ \cos^3 x\ dx &= \int \sin^2 x\ \cos^2 x\ \cos x\ dx\ &= \int \sin^2 x\ (1-\sin^2 x)\ \cos x\ dx \end{aligned}

Now let u=sinxu=\sin x so that du=cosx dxdu = \cos x \ dx. sin2x (1sin2x) cosx dx=u2(1u2) du=u2u4 du=13u315u5+C=13sin3x15sin5x+C\begin{aligned} \int \sin^2 x\ (1-\sin^2 x)\ \cos x\ dx &= \int u^2(1-u^2)\ du\ &= \int u^2-u^4\ du\ &= \dfrac{1}{3}u^3 - \dfrac{1}{5}u^5 + C\ &= \ans{\dfrac{1}{3}\sin^3 x - \dfrac{1}{5}\sin^5 x + C} \end{aligned}

Evaluate sin3x dx\displaystyle\int \sin^3 x\ dx.


This time, split off a sinx\sin x; the remaining sin2x\sin^2 x can be rewritten in terms of cosx\cos x and we'll make u=cosxu=\cos x.

sin3x dx=sin2x sinx dx=(1cos2x) sinx dx=(1u2) du=1+u2 du=u+13u3+C=cosx+13cos3x+C\begin{aligned} \int \sin^3 x\ dx &= \int \sin^2 x\ \sin x\ dx\ &= \int (1-\cos^2 x) \ \sin x\ dx\ &= \int -(1-u^2)\ du\ &= \int -1+u^2\ du\ &= -u + \dfrac{1}{3}u^3 + C\ &= \ans{-\cos x + \dfrac{1}{3}\cos^3 x + C} \end{aligned}

Conclusion: how to integrate sinmx cosnx dx\displaystyle\int \sin^m x\ \cos^n x\ dx

Even Powers

Evaluate cos2x dx\displaystyle\int \cos^2 x\ dx.


This one only has an even power, so we need to use a half-angle identity. Remember that cos2x=12+12cos(2x),\cos^2 x = \dfrac{1}{2} + \dfrac{1}{2}\cos(2x), so we can rewrite the integral as 12+12cos(2x) dx.\int \dfrac{1}{2} + \dfrac{1}{2}\cos(2x)\ dx.

The first part we can deal with directly, and for the second part, we can use u-substitution, with u=2xu=2x. Since cos(2x) dx=12sin(2x),\int \cos (2x)\ dx = \dfrac{1}{2}\sin (2x), we can get the final answer:

cos2x dx=12+12cos(2x) dx=12x+14sin(2x)+C\begin{aligned} \int \cos^2 x\ dx &= \int \dfrac{1}{2} + \dfrac{1}{2}\cos (2x) \ dx\ &= \ans{\dfrac{1}{2}x + \dfrac{1}{4}\sin(2x) + C} \end{aligned}

  1. sin3x cos2x dx\displaystyle\int \sin^3 x\ \cos^2 x\ dx

  2. Let u=cosxdu=sinx dxu=\cos x \longrightarrow -du = \sin x\ dx

    sin3x cos2x dx=sin2x cos2x sinx dx=(1cos2x) cos2x sinx dx=(1u2)u2 du=u2+u4 du=13u3+15u5+C=13cos3x+15cos5x+C\begin{aligned} \int \sin^3 x \ \cos^2 x \ dx &= \int \sin^2 x \ \cos^2 x \ \sin x \ dx\ &= \int (1-\cos^2 x) \ \cos^2 x \ \sin x \ dx\ &= \int -(1-u^2)u^2\ du\ &= \int -u^2+u^4\ du\ &= -\dfrac{1}{3}u^3 + \dfrac{1}{5}u^5 + C\ &= \ans{-\dfrac{1}{3}\cos^3 x + \dfrac{1}{5}\cos^5 x + C} \end{aligned}

  3. cos5(πx) dx\displaystyle\int \cos^5 (\pi x)\ dx

  4. Let u=sin(πx)1πdu=cos(πx) dxu=\sin (\pi x) \longrightarrow \dfrac{1}{\pi}du = \cos (\pi x)\ dx

    cos5(πx) dx=cos2(πx) cos2(πx) cos(πx) dx=(1sin2(πx))(1sin2(πx)) cos(πx) dx=1π(1u2)(1u2) du=1pi2πu2+1πu4 du=1πu23πu3+15πu5+C=1πsin(πx)23πsin3(πx)+15πsin5(πx)+C\begin{aligned} \int \cos^5 (\pi x) \ dx &= \int \cos^2 (\pi x) \ \cos^2 (\pi x) \ \cos (\pi x) \ dx\ &= \int (1-\sin^2 (\pi x)) (1-\sin^2 (\pi x)) \ \cos (\pi x) \ dx\ &= \int \dfrac{1}{\pi}(1-u^2)(1-u^2)\ du\ &= \int \dfrac{1}{pi}-\dfrac{2}{\pi}u^2+\dfrac{1}{\pi}u^4\ du\ &= \dfrac{1}{\pi}u - \dfrac{2}{3\pi}u^3 + \dfrac{1}{5\pi}u^5 + C\ &= \ans{\dfrac{1}{\pi}\sin(\pi x) - \dfrac{2}{3\pi} \sin^3 (\pi x) + \dfrac{1}{5\pi}\sin^5 (\pi x) + C} \end{aligned}

  5. sin2x cos2x dx\displaystyle\int \sin^2 x\ \cos^2 x\ dx

  6. sin2x cos2x dx=(1212cos(2x))(12+12cos(2x)) dx=1414cos2(2x) dx=1414(12+12cos(4x)) dx=1818cos(4x) dx=18x132sin(4x)+C\begin{aligned} \int \sin^2 x\ \cos^2 x\ dx &= \int \left(\dfrac{1}{2} - \dfrac{1}{2}\cos(2x)\right)\left(\dfrac{1}{2} + \dfrac{1}{2}\cos(2x)\right)\ dx\ &= \int \dfrac{1}{4} - \dfrac{1}{4}\cos^2(2x)\ dx\ &= \int \dfrac{1}{4} - \dfrac{1}{4}\left(\dfrac{1}{2} + \dfrac{1}{2}\cos(4x)\right)\ dx\ &= \int \dfrac{1}{8} - \dfrac{1}{8}\cos(4x)\ dx\ &= \ans{\dfrac{1}{8}x - \dfrac{1}{32} \sin (4x) + C} \end{aligned}

  7. sin2(2θ) dθ\displaystyle\int \sin^2 (2\theta)\ d\theta

  8. sin2(2θ) dθ=1212cos(4θ) dθ=12θ18sin(4θ)+C\begin{aligned} \int \sin^2 (2\theta)\ d\theta &= \int \dfrac{1}{2} - \dfrac{1}{2} \cos (4\theta)\ d\theta\ &= \ans{\dfrac{1}{2}\theta - \dfrac{1}{8} \sin (4\theta) + C} \end{aligned}

tanmx secnx dx\displaystyle\int \tan^m x\ \sec^n x\ dx

These examples will work similarly. Just like sine and cosine are a matched pair of derivatives, secant and tangent match each other's derivatives: ddx[secx]=secx tanxddx[tanx]=sec2x\begin{aligned} \dfrac{d}{dx}[\sec x] &= \sec x \ \tan x\ \dfrac{d}{dx}[\tan x] &= \sec^2 x \end{aligned}

We're either going to make u=secxu=\sec x, in which case du=secx tanx dxdu = \sec x \ \tan x \ dx, or we'll make u=tanxu=\tan x, so that du=sec2xdu = \sec^2 x.

Thus, we'll either split off secx tanx\sec x \ \tan x or sec2x\sec^2 x to serve as dudu, then rewrite the rest of the integral in terms of the appropriate function.

This boils down to the following:

Conclusion: how to integrate tanmx secnx dx\displaystyle\int \tan^m x \ \sec^n x \ dx

Evaluate tan6x sec4x dx\displaystyle\int \tan^6 x \ \sec^4 x\ dx.


The power of secant is even, so let u=tanxdu=sec2x dxu=\tan x \longrightarrow du = \sec^2 x \ dx.

tan6x sec4x dx=tan6x sec2x sec2x dx=tan6x (1+tan2x) sec2x dx=u6(1+u2) du=u6+u8 du=17u7+19u9+C=17tan7x+19tan9x+C\begin{aligned} \int \tan^6 x \ \sec^4 x \ dx &= \int \tan^6 x \ \sec^2 x \ \sec^2 x \ dx\ &= \int \tan^6 x \ (1+\tan^2 x) \ \sec^2 x \ dx\ &= \int u^6(1+u^2) \ du\ &= \int u^6 + u^8 \ du\ &= \dfrac{1}{7}u^7 + \dfrac{1}{9}u^9 + C\ &= \ans{\dfrac{1}{7}\tan^7 x + \dfrac{1}{9}\tan^9 x + C} \end{aligned}

Evaluate sec2x tanx dx\displaystyle\int \sec^2 x \ \tan x \ dx.

This one has both an even power of secant and an odd power of tangent, so we can actually solve it either way.

Solution 1

Let u=tanxu=\tan x, so du=sec2x dxdu=\sec^2 x\ dx. sec2x tanx dx=u du=12u2+C=12tan2x+C\begin{aligned} \int \sec^2 x \ \tan x \ dx &= \int u \ du\ &= \dfrac{1}{2}u^2 + C\ &= \ans{\dfrac{1}{2}\tan^2 x + C} \end{aligned}

Solution 2

Let u=secxu = \sec x, so du=secx tanx dxdu = \sec x \ \tan x \ dx. sec2x tanx dx=u du=12u2+C=12sec2x+C\begin{aligned} \int \sec^2 x \ \tan x \ dx &= \int u \ du\ &= \dfrac{1}{2}u^2 + C\ &= \ans{\dfrac{1}{2}\sec^2 x + C} \end{aligned}

That's odd: we got two different answers, but if we did everything correctly, both solutions should end up with the same answer. So what's the deal?

Remember, based on the identity 1+tan2x=sec2x1 + \tan^2 x = \sec^2 x the only difference between tan2x\tan^2 x and sec2x\sec^2 x is a constant. The arbitrary constants in the answers absorb that difference.

  1. tan5x sec7x dx\displaystyle\int \tan^5 x \ \sec^7 x \ dx

  2. Let u=secxdu=secx tanx dxu=\sec x \longrightarrow du = \sec x \ \tan x \ dx tan5x sec7x dx=tan4x sec6x secx tanx dx=(sec2x1)2 sec6x secx tanx dx=(u21)2u6 du=u102u8+u6 du=111u1129u9+17u7+C=111sec11x29sec9x+17sec7x+C\begin{aligned} \int \tan^5 x \ \sec^7 x \ dx &= \int \tan^4 x \ \sec^6 x \ \sec x \ \tan x \ dx\ &= \int (\sec^2 x - 1)^2 \ \sec^6 x \ \sec x \ \tan x \ dx\ &= \int (u^2-1)^2 u^6 \ du\ &= \int u^{10}-2u^8+u^6 \ du\ &= \dfrac{1}{11}u^{11} - \dfrac{2}{9}u^9 + \dfrac{1}{7}u^7 + C\ &= \ans{\dfrac{1}{11}\sec^{11} x - \dfrac{2}{9}\sec^9 x + \dfrac{1}{7}\sec^7 x + C} \end{aligned}

  3. tan5x sec4x dx\displaystyle\int \tan^5 x \ \sec^4 x \ dx

  4. Let u=tanxdu=sec2x dxu=\tan x \longrightarrow du = \sec^2 x \ dx tan5x sec4x dx=tan5x sec2x sec2x dx=tan5x (tan2x+1) sec2x dx=u5(u2+1) du=u7+u5 du=18u8+16u6+C=18tan8x+16tan6x+C\begin{aligned} \int \tan^5 x \ \sec^4 x \ dx &= \int \tan^5 x \ \sec^2 x \ \sec^2 x \ dx\ &= \int \tan^5 x \ (\tan^2 x + 1) \ \sec^2 x \ dx\ &= \int u^5(u^2+1) \ du\ &= \int u^7+u^5 \ du\ &= \dfrac{1}{8}u^{8} + \dfrac{1}{6}u^6 + C\ &= \ans{\dfrac{1}{8}\tan^{8} x + \dfrac{1}{6}\tan^6 x + C} \end{aligned}

  5. sec6t dt\displaystyle\int \sec^6 t \ dt

  6. Let u=tantdu=sec2t dtu=\tan t \longrightarrow du = \sec^2 t \ dt sec6t dt=sec4t sec2t dt=(tan2t+1)2 sec2t dt=(u2+1)2 du=u4+2u2+1 du=15u5+23u3+u+C=15tan5t+23tan3t+tant+C\begin{aligned} \int \sec^6 t \ dt &= \int \sec^4 t \ \sec^2 t \ dt\ &= \int (\tan^2 t + 1)^2 \ \sec^2 t \ dt\ &= \int (u^2+1)^2 \ du\ &= \int u^4+2u^2+1 \ du\ &= \dfrac{1}{5}u^{5} + \dfrac{2}{3}u^3 + u + C\ &= \ans{\dfrac{1}{5}\tan^{5} t + \dfrac{2}{3}\tan^3 t + \tan t + C} \end{aligned}