Processing math: 100%
Skip to main content
Library homepage
 

Text Color

Text Size

 

Margin Size

 

Font Type

Enable Dyslexic Font
Mathematics LibreTexts

1.8: Trigonometric Integrals

( \newcommand{\kernel}{\mathrm{null}\,}\)

Integrals of polynomials of the trigonometric functions sinx, cosx, tanx and so on, are generally evaluated by using a combination of simple substitutions and trigonometric identities. There are of course a very large number 1 of trigonometric identities, but usually we use only a handful of them. The most important three are:

Equation 1.8.1
sin2x+cos2x=1
Equation 1.8.2
sin(2x)=2sinxcosx
Equation 1.8.3
cos(2x)=cos2xsin2x=2cos2x1=12sin2x

Notice that the last two lines of Equation 1.8.3 follow from the first line by replacing either sin2x or cos2x using Equation 1.8.1. It is also useful to rewrite these last two lines:

Equation 1.8.4
sin2x=1cos(2x)2
Equation 1.8.5
cos2x=1+cos(2x)2

These last two are particularly useful since they allow us to rewrite higher powers of sine and cosine in terms of lower powers. For example:

sin4(x)=[1cos(2x)2]2by Equation 1.8.4=1412cos(2x)+14cos2(2x)do it againuse Equation 1.8.5=1412cos(2x)+18(1+cos(4x))=3812cos(2x)+18cos(4x)

So while it was hard to integrate sin4(x) directly, the final expression is quite straightforward (with a little substitution rule).

There are many such tricks for integrating powers of trigonometric functions. Here we concentrate on two families

sinmxcosnxdxandtanmxsecnxdx

for integer n,m. The details of the technique depend on the parity of n and m — that is, whether n and m are even or odd numbers.

Integrating sinmxcosnxdx

One of n and m is odd

Consider the integral sin2xcosxdx. We can integrate this by substituting u=sinx and du=cosxdx. This gives

sin2xcosxdx=u2du=13u3+C=13sin3x+C

This method can be used whenever n is an odd integer.

  • Substitute u=sinx and du=cosxdx.
  • This leaves an even power of cosines — convert them using cos2x=1sin2x=1u2.

Here is an example.

Example 1.8.6 sin2xcos3xdx

Start by factoring off one power of cosx to combine with dx to get cosxdx=du.

sin2xcos3xdx=sin2x=u2cos2x=1u2 cosxdx=duset u=sinx=u2 (1u2)du=u33u55+C=sin3x3sin5x5+C

Of course if m is an odd integer we can use the same strategy with the roles of sinx and cosx exchanged. That is, we substitute u=cosx, du=sinxdx and sin2x=1cos2x=1u2.

Both n and m are even

If m and n are both even, the strategy is to use the trig identities 1.8.4 and 1.8.5 to get back to the m or n odd case. This is typically more laborious than the previous case we studied. Here are a couple of examples that arise quite commonly in applications.

Example 1.8.7 cos2xdx

By 1.8.5

cos2xdx=12[1+cos(2x)]dx=12[x+12sin(2x)]+C

Example 1.8.8 cos4xdx

First we'll prepare the integrand cos4x for easy integration by applying 1.8.5 a couple times. We have already used 1.8.5 once to get

cos2x=12[1+cos(2x)]

Squaring it gives

cos4x=14[1+cos(2x)]2=14+12cos(2x)+14cos2(2x)

Now by 1.8.5 a second time

cos4x=14+12cos(2x)+14 1+cos(4x)2=38+12cos(2x)+18cos(4x)

Now it's easy to integrate

cos4xdx=38dx+12cos(2x)dx+18cos(4x)dx=38x+14sin(2x)+132sin(4x)+C

Example 1.8.9 cos2xsin2xdx

Here we apply both 1.8.4 and 1.8.5.

cos2xsin2xdx=14[1+cos(2x)][1cos(2x)]dx=14[1cos2(2x)]dx

We can then apply 1.8.5 again

=14[112(1+cos(4x))]dx=18[1cos(4x)]dx=18x132sin(4x)+C

Oof! We could also have done this one using 1.8.2 to write the integrand as sin2(2x) and then used 1.8.4 to write it in terms of cos(4x).

Example 1.8.10 π0cos2xdx and π0sin2xdx

Of course we can compute the definite integral π0cos2xdx by using the antiderivative for cos2x that we found in Example 1.8.7. But here is a trickier way to evaluate that integral, and also the integral π0sin2xdx at the same time, very quickly without needing the antiderivative of Example 1.8.7.

Solution

  • Observe that π0cos2xdx and π0sin2xdx are equal because they represent the same area — look at the graphs below — the darkly shaded regions in the two graphs have the same area and the lightly shaded regions in the two graphs have the same area.
  • Consequently,

    π0cos2xdx=π0sin2xdx=12[π0sin2xdx+π0cos2xdx]=12π0[sin2x+cos2x]dx=12π0dx=π2

Integrating tanmxsecnxdx

The strategy for dealing with these integrals is similar to the strategy that we used to evaluate integrals of the form sinmxcosnxdx and again depends on the parity of the exponents n and m. It uses 2

ddxtanx=sec2xddxsecx=secxtanx1+tan2x=sec2x

We split the methods for integrating tanmxsecnxdx into 5 cases which we list below. These will become much more clear after an example (or two).

  1. When m is odd and any n — rewrite the integrand in terms of sinx and cosx:

    tanmxsecnxdx=(sinxcosx)m(1cosx)ndx=sinm1xcosn+mx sinxdx

    and then substitute u=cosx, du=sinxdx, sin2x=1cos2x=1u2. See Examples 1.8.11 and 1.8.12.
  2. Alternatively, if m is odd and n1 move one factor of secxtanx to the side so that you can see secxtanxdx in the integral, and substitute u=secx, du=secxtanxdx and tan2x=sec2x1=u21. See Example 1.8.13.
  3. If n is even with n2, move one factor of sec2x to the side so that you can see sec2xdx in the integral, and substitute u=tanx, du=sec2xdx and sec2x=1+tan2x=1+u2. See Example 1.8.14.
  4. When m is even and n=0 — that is the integrand is just an even power of tangent — we can still use the u=tanx substitution, after using tan2x=sec2x1 (possibly more than once) to create a sec2x. See Example 1.8.16.
  5. This leaves the case n odd and m even. There are strategies like those above for treating this case. But they are more complicated and also involve more tricks (that basically have to be memorized). Examples using them are provided in the optional section entitled “Integrating secx, cscx, sec3x and csc3x”, below. A more straight forward strategy uses another technique called “partial fractions”. We shall return to this strategy after we have learned about partial fractions. See Example 1.10.5 and 1.10.6 in Section 1.10.

m is odd — odd power of tangent

In this case we rewrite the integrand in terms of sine and cosine and then substitute u=cosx,du=sinxdx.

Example 1.8.11 tanxdx

Solution

  • Write the integrand tanx=1cosxsinx.
  • Now substitute u=cosx, du=sinxdx just as we did in treating integrands of the form sinmxcosnx with m odd.

    tanxdx=1cosxsinxdxsubstitute u=cosx=1u(1)du=log|u|+C=log|cosx|+Ccan also write in terms of secant=log|cosx|1+C=log|secx|+C

Example 1.8.12 tan3xdx

Solution

  • Write the integrand tan3x=sin2xcos3xsinx.
  • Again substitute u=cosx, du=sinxdx. We rewrite the remaining even powers of sinx using sin2x=1cos2x=1u2.
  • Hence

    tan3xdx=sin2xcos3xsinxdxsubstitute u=cosx=1u2u3(1)du=u22+log|u|+C=12cos2x+log|cosx|+Crewrite in terms of secant=12sec2xlog|secx|+C

m is odd and n1 — odd power of tangent and at least one secant

Here we collect a factor of tanxsecx and then substitute u=secx and du=secxtanxdx. We can then rewrite any remaining even powers of tanx in terms of secx using tan2x=sec2x1=u21.

Example 1.8.13 tan3xsec4xdx

Solution

  • Start by factoring off one copy of secxtanx and combine it with dx to form secxtanxdx, which will be du.
  • Now substitute u=secx, du=secxtanxdx and tan2x=sec2x1=u21.
  • This gives

    tan3xsec4xdx=tan2xu21 sec3xu3 secxtanxdxdu=[u21]u3du=u66u44+C=16sec6x14sec4x+C

n2 is even — a positive even power of secant

In the previous case we substituted u=secx, while in this case we substitute u=tanx. When we do this we write du=sec2xdx and then rewrite any remaining even powers of secx as powers of tanx using sec2x=1+tan2x=1+u2.

Example 1.8.14 sec4xdx

Solution

  • Factor off one copy of sec2x and combine it with dx to form sec2xdx, which will be du.
  • Then substitute u=tanx, du=sec2xdx and rewrite any remaining even powers of secx as powers of tanx=u using sec2x=1+tan2x=1+u2.
  • This gives

    sec4xdx=sec2x1+u2 sec2xdxdu=[1+u2]du=u+u33+C=tanx+13tan3x+C

Example 1.8.15 tan3xsec4xdx — redux

Solution

Let us revisit this example using this slightly different approach.

  • Factor off one copy of sec2x and combine it with dx to form sec2xdx, which will be du.
  • Then substitute u=tanx, du=sec2xdx and rewrite any remaining even powers of secx as powers of tanx=u using sec2x=1+tan2x=1+u2.
  • This gives

    tan3xsec4xdx=tan3xu3sec2x1+u2 sec2xdxdu=[u3+u5]du=u44+u66+C=14tan4x+16tan6x+C

  • This is not quite the same as the answer we got above in Example 1.8.13. However we can show they are (nearly) equivalent. To do so we substitute v=secx and tan2x=sec2x1=v21:

    16tan6x+14tan4x=16(v21)3+14(v21)2=16(v63v4+3v21)+14(v42v2+1)=v66v42+v2216+v44v22+14=v66v44+0v2+(1416)=16sec6x14sec4x+112.

    So while 16tan6x+14tan4x16sec6x14sec4x, they only differ by a constant. Hence both are valid antiderivatives of tan3xsec4x.

m is even and n=0 — even powers of tangent

We integrate this by setting u=tanx. For this to work we need to pull one factor of sec2x to one side to form du=sec2xdx. To find this factor of sec2x we (perhaps repeatedly) apply the identity tan2x=sec2x1.

Example 1.8.16 tan4xdx

Solution

  • There is no sec2x term present, so we try to create it from tan4x by using tan2x=sec2x1.

    tan4x=tan2xtan2x=tan2x[sec2x1]=tan2xsec2xtan2xsec2x1=tan2xsec2xsec2x+1

  • Now we can substitute u=tanx, du=sec2xdx.

    tan4xdx=tan2xu2 sec2xdxdusec2xdxdu+dx=u2dudu+dx=u33u+x+C=tan3x3tanx+x+C

Example 1.8.17 tan8xdx

Solution

Let us try the same approach.

  • First pull out a factor of tan2x to create a sec2x factor: tan8x=tan6xtan2x=tan6x[sec2x1]=tan6xsec2xtan6x

    The first term is now ready to be integrated, but we need to reapply the method to the second term:

    =tan6xsec2xtan4x[sec2x1]=tan6xsec2xtan4xsec2x+tan4xdo it again=tan6xsec2xtan4xsec2x+tan2x[sec2x1]=tan6xsec2xtan4xsec2x+tan2xsec2xtan2xand again=tan6xsec2xtan4xsec2x+tan2xsec2x[sec2x1]
  • Hence

    tan8xdx=[tan6xsec2xtan4xsec2x+tan2xsec2xsec2x+1]dx=[tan6xtan4x+tan2x1]sec2xdx+dx=[u6u4+u21]du+x+C=u77u55+u33u+x+C=17tan7x15tan5x+13tan3xtanx+x+C

Indeed this example suggests that for integer k0:

tan2kxdx=12k1tan2k1(x)12k3tan2k3x+(1)ktanx+(1)kx+C

This last example also shows how we might integrate an odd power of tangent:

Example 1.8.18 tan7x

Solution

We follow the same steps

  • Pull out a factor of tan2x to create a factor of sec2x:

    tan7x=tan5xtan2x=tan5x[sec2x1]=tan5xsec2xtan5xdo it again=tan5xsec2xtan3x[sec2x1]=tan5xsec2xtan3xsec2x+tan3xand again=tan5xsec2xtan3xsec2x+tanx[sec2x1]=tan5xsec2xtan3xsec2x+tanxsec2xtanx

  • Now we can substitute u=tanx and du=sec2xdx and also use the result from Example 1.8.11 to take care of the last term: tan7xdx=[tan5xsec2xtan3xsec2x+tanxsec2x]dxtanxdx

    Now factor out the common sec2x term and integrate tanx via Example 1.8.11

    =[tan5xtan3x+tanx]secxdxlog|secx|+C=[u5u3+u]dulog|secx|+C=u66u44+u22log|secx|+C=16tan6x14tan4x+12tan2xlog|secx|+C

This example suggests that for integer k0:

tan2k+1xdx=12ktan2k(x)12k2tan2k2x+(1)k12tan2x+(1)klog|secx|+C

Of course we have not considered integrals involving powers of cotx and cscx. But they can be treated in much the same way as tanx and secx were.

Optional — Integrating secx, cscx, sec3x and csc3x

As noted above, when n is odd and m is even, one can use similar strategies as to the previous cases. However the computations are often more involved and more tricks need to be deployed. For this reason we make this section optional — the computations are definitely non-trivial. Rather than trying to construct a coherent “method” for this case, we instead give some examples to give the idea of what to expect.

Example 1.8.19 secxdx — by trickery

Solution

There is a very sneaky trick to compute this integral.

  • The standard trick for this integral is to multiply the integrand by 1=secx+tanxsecx+tanx

    secx=secx secx+tanxsecx+tanx=sec2x+secxtanxsecx+tanx

  • Notice now that the numerator of this expression is exactly the derivative its denominator. Hence we can substitute u=secx+tanx and du=(secxtanx+sec2x)dx.
  • Hence

    secxdx=secx secx+tanxsecx+tanxdx=sec2x+secxtanxsecx+tanxdx=1udu=log|u|+C=log|secx+tanx|+C

  • The above trick appears both totally unguessable and very hard to remember. Fortunately, there is a simple way 3 to recover the trick. Here it is.
    • The goal is to guess a function whose derivative is secx.
    • So get out a table of derivatives and look for functions whose derivatives at least contain secx. There are two:

      ddxtanx=sec2xddxsecx=tanxsecx

    • Notice that if we add these together we get

      ddx(secx+tanx)=(secx+tanx)secxddx(secx+tanx)secx+tanx=secx

    • We've done it! The right hand side is secx and the left hand side is the derivative of log|secx+tanx|.

There is another method for integrating secxdx, that is more tedious, but more straight forward. In particular, it does not involve a memorized trick. We first use the substitution u=sinx, du=cosxdx, together with cos2x=1sin2x=1u2. This converts the integral into

secxdx=1cosxdx=cosx dxcos2x=du1u2|u=sinx

The integrand 11u2 is a rational function, i.e. a ratio of two polynomials. There is a procedure, called the method of partial fractions, that may be used to integrate any rational function. We shall learn about it in Section 1.10 “Partial Fractions”. The detailed evaluation of the integral secxdx=du1u2 by the method of partial fractions is presented in Example 1.10.5 below.

In addition, there is a standard trick for evaluating du1u2 that allows us to avoid going through the whole partial fractions algorithm.

Example 1.8.20 secxdx — by more trickery

Solution

We have already seen that

secxdx=du1u2|u=sinx

The trick uses the obervations that

  • 11u2=1+uu1u2=11uu1u2
  • 11u has antiderivative log(1u) (for u<1)
  • The derivative ddu(1u2)=2u of the denominator of u1u2 is the same, up to a factor of 2, as the numerator of u1u2. So we can easily evaluate the integral of u1u2 by substituting v=1u2, dv=2udu.

    udu1u2=dv2v|v=1u2=12log(1u2)+C

Combining these observations gives

secxdx=[du1u2]u=sinx=[11uduu1u2du]u=sinx=[log(1u)+12log(1u2)+C]u=sinx=log(1sinx)+12log(1sin2x)+C=log(1sinx)+12log(1sinx)+12log(1+sinx)+C=12log1+sinx1sinx+C

Example 1.8.20 has given the answer

secxdx=12log1+sinx1sinx+C

which appears to be different than the answer in Example 1.8.19. But they are really the same since

1+sinx1sinx=(1+sinx)21sin2x=(1+sinx)2cos2x 12log1+sinx1sinx=12log(1+sinx)2cos2x=log|sinx+1cosx|=log|tanx+secx|

Oof!

Example 1.8.21 cscxdx — by the u=tanx2 substitution

Solution

The integral cscxdx may also be evaluated by both the methods above. That is either

  • by multiplying the integrand by a cleverly chosen 1=cotxcscxcotxcscx and then substituting u=cotxcscx, du=(csc2x+cscxcotx)dx, or
  • by substituting u=cosx, du=sinxdx to give cscxdx=du1u2 and then using the method of partial fractions.

These two methods give the answers

cscxdx=log|cotxcscx|+C=12log1+cosx1cosx+C

In this example, we shall evaluate cscxdx by yet a third method, which can be used to integrate rational functions  4 A rational function of sinx and cosx is a ratio with both the numerator and denominator being finite sums of terms of the form asinmxcosnx, where a is a constant and m and n are positive integers. of sinx and cosx.

  • This method uses the substitution

    x=2arctanui.e. u=tanx2and dx=21+u2du

    — a half-angle substitution.
  • To express sinx and cosx in terms of u, we first use the double angle trig identities (Equations 1.8.2 and 1.8.3 with xx2) to express sinx and cosx in terms of sinx2 and cosx2:

    sinx=2sinx2cosx2cosx=cos2x2sin2x2

  • We then use the triangle

    to express sinx2 and cosx2 in terms of u. The bottom and right hand sides of the triangle have been chosen so that tanx2=u. This tells us that

    sinx2=u1+u2cosx2=11+u2

  • This in turn implies that:

    sinx=2sinx2cosx2=2u1+u211+u2=2u1+u2cosx=cos2x2sin2x2=11+u2u21+u2=1u21+u2

    Oof!
  • Let's use this substitution to evaluate cscxdx.

    cscxdx=1sinxdx=1+u22u 21+u2du=1udu=log|u|+C=log|tanx2|+C

    To see that this answer is really the same as that in (), note that

    cotxcscx=cosx1sinx=2sin2(x/2)2sin(x/2)cos(x/2)=tanx2

Example 1.8.22 sec3xdx — by trickery

Solution

The standard trick used to evaluate sec3xdx is integration by parts.

  • Set u=secx, dv=sec2xdx. Hence du=secxtanxdx, v=tanx and

    sec3xdx=secxu sec2xdxdv=secxu tanxvtanxv secxtanxdxdu

  • Since tan2x+1=sec2x, we have tan2x=sec2x1 and

    sec3xdx=secx tanx[sec3xsecx]dx=secx tanx+log|secx+tanx|+Csec3xdx

    where we used secxdx=log|secx+tanx|+C, which we saw in Example 1.8.19.
  • Now moving the sec3xdx from the right hand side to the left hand side

    2sec3xdx=secxtanx+log|secx+tanx|+Cand sosec3xdx=12secxtanx+12log|secx+tanx|+C

    for a new arbitrary constant C (which is just one half the old one).

The integral sec3dx can also be evaluated by two other methods.

  • Substitute u=sinx, du=cosxdx to convert sec3xdx into du[1u2]2 and evaluate the latter using the method of partial fractions. This is done in Example 1.10.6 in Section 1.10.
  • Use the u=tanx2 substitution. We use this method to evaluate csc3xdx in Example 1.8.23, below.
Example 1.8.23 csc3xdx – by the u=tanx2 substitution

Solution

Let us use the half-angle substitution that we introduced in Example 1.8.21.

  • In this method we set

    u=tanx2dx=21+u2dusinx=2u1+u2cosx=1u21+u2

  • The integral then becomes

    csc3xdx=1sin3xdx=(1+u22u)3 21+u2du=141+2u2+u4u3du=14{u22+2log|u|+u22}+C=18{cot2x2+4log|tanx2|+tan2x2}+C

    Oof!
  • This is a perfectly acceptable answer. But if you don't like the x2's, they may be eliminated by using

    tan2x2cot2x2=sin2x2cos2x2cos2x2sin2x2=sin4x2cos4x2sin2x2cos2x2=(sin2x2cos2x2)(sin2x2+cos2x2)sin2x2cos2x2=sin2x2cos2x2sin2x2cos2x2since sin2x2+cos2x2=1=cosx14sin2xby 1.8.2 and 1.8.3

    and

    tanx2=sinx2cosx2=sin2x2sinx2cosx2=12[1cosx]12sinxby \knowl./knowl/eqTRGINTtrigidentityB.html1.8.2 and \knowl./knowl/eqTRGINTtrigidentityC.html1.8.3

    So we may also write

    csc3xdx=12cotxcscx+12log|cscxcotx|+C

That last optional section was a little scary — let's get back to something a little easier.

Exercises

Recall that we are using logx to denote the logarithm of x with base e. In other courses it is often denoted lnx.

Stage 1
1

Suppose you want to evaluate π/40sinxcosnxdx using the substitution u=cosx. Which of the following need to be true for your substitution to work?

  1. n must be even
  2. n must be odd
  3. n must be an integer
  4. n must be positive
  5. n can be any real number
2

Evaluate secnxtanxdx, where n is a strictly positive integer.

3

Derive the identity tan2x+1=sec2x from the easier-to-remember identity sin2x+cos2x=1.

Stage 2

Questions 4 through 10 deal with powers of sines and cosines. Review Section 1.8.1 in the notes for integration strategies.

Questions 12 through 21 deal with powers of tangents and secants. Review Section 1.8.2 in the notes for strategies.

4 (✳)

Evaluate cos3xdx.

5 (✳)

Evaluate π0cos2xdx.

6 (✳)

Evaluate sin36tcos3tdt.

7

Evaluate sin3xcos4xdx.

8

Evaluate π/30sin4xdx.

9

Evaluate sin5xdx.

10

Evaluate sin1.2xcosxdx.

11

Evaluate tanxsec2xdx.

12 (✳)

Evaluate tan3xsec5xdx.

13 (✳)

Evaluate sec4xtan46xdx.

14

Evaluate tan3xsec1.5xdx.

15

Evaluate tan3xsec2xdx.

16

Evaluate tan4xsec2xdx.

17

Evaluate tan3xsec0.7xdx.

18

Evaluate tan5xdx.

19

Evaluate π/60tan6xdx.

20

Evaluate π/40tan8xsec4xdx.

21

Evaluate tanxsecxdx.

22

Evaluate sec8θtaneθdθ.

Stage 3
23 (✳)

A reduction formula.

  1. Let n be a positive integer with n2. Derive the reduction formula

    tann(x)dx=tann1(x)n1tann2(x)dx.

  2. Calculate π/40tan6(x)dx.
24

Evaluate tan5xcos2xdx.

25

Evaluate 1cos2θdθ.

26

Evaluate cotxdx.

27

Evaluate exsin(ex)cos(ex)dx.

28

Evaluate sin(cosx)sin3xdx.

29

Evaluate xsinxcosxdx.

  1. The more pedantic reader could construct an infinite list of them.
  2. You will need to memorise the derivatives of tangent and secant. However there is no need to memorise 1+tan2x=sec2x. To derive it very quickly just divide sin2x+cos2x=1 by cos2x.
  3. We thank Serban Raianu for bringing this to our attention.

This page titled 1.8: Trigonometric Integrals is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by Joel Feldman, Andrew Rechnitzer and Elyse Yeager via source content that was edited to the style and standards of the LibreTexts platform.

  • Was this article helpful?

Support Center

How can we help?