Integrals Of Trigonometric Functions

Every trigonometric integral in this section is solved with only two tools: a trigonometric identity that reshapes the integrand, followed by a substitution that finishes the job. The art lies entirely in choosing the right identity.

Integral Result
sin x d x cos x + C
cos x d x sin x + C
sec 2 x d x tan x + C
csc 2 x d x cot x + C
sec x tan x d x sec x + C
csc x cot x d x csc x + C
tan x d x ln < / t d >< / t r >< t r >< t d > \displaystyle\int\cot x\,dx < / t d >< t d > \ln
sec x d x ln < / t d >< / t r >< t r >< t d > \displaystyle\int\csc x\,dx < / t d >< t d > -\ln
Situation Strategy
sin m x cos n x , m odd Peel off one sin x for d u ; convert the rest with sin 2 x = 1 cos 2 x ; let u = cos x
sin m x cos n x , n odd Peel off one cos x for d u ; convert the rest with cos 2 x = 1 sin 2 x ; let u = sin x
sin m x cos n x , both even Use the half-angle identities repeatedly
tan m x sec n x , n even Peel off sec 2 x for d u ; convert the rest with sec 2 x = 1 + tan 2 x ; let u = tan x
tan m x sec n x , m odd Peel off sec x tan x for d u ; convert the rest with tan 2 x = sec 2 x 1 ; let u = sec x
sin a x cos b x , sin a x sin b x , cos a x cos b x Use the product-to-sum identities

Integrals That Follow Directly From Derivatives

In the previous chapter we saw

\bbox[8px, #E6F0FA, border: 3px solid #0066CC]{\begin{aligned} \int\sin x\ dx &= -\cos x+C\\ \int\cos x\ dx &= \sin x+C. \end{aligned}}

In this section, we will investigate the integrals of the other trigonometric functions.

What is sec 2 x d x ? Because (\tan x)'=\sec^{2}x, we have

\bbox[8px, #E6F0FA, border: 3px solid #0066CC]{\int\sec^{2}x\ dx=\tan x+C.}

Similarly, because (\cot x)'=-\csc^{2}x,

\bbox[8px, #E6F0FA, border: 3px solid #0066CC]{\int\csc^{2}x\ dx=-\cot x+C.}

In words: every derivative formula for a trigonometric function, read backwards, is an integration formula. The remaining trigonometric functions, tan x , cot x , sec x , and csc x , are not the derivative of any function we have named, so their integrals take a little more work.

The Integrals of tan x and cot x

It is worth repeating an important integral that we evaluated in the section on integration by substitution.

Find tan x   d x .

Solution

Because tan x = sin x / cos x and (\cos x)'=-\sin x, let u = cos x . Then

d u = sin x   d x ,

and

\begin{aligned} \int\tan x\ dx &= \int\frac{\sin x}{\cos x}\,dx\\ &= \int\frac{-du}{u}\\ &= -\ln|u|+C\\ &= -\ln|\cos x|+C. \end{aligned}

Recall that ln A B = B ln A . So

\begin{aligned} -\ln|\cos x|+C &= \ln\left(|\cos x|^{-1}\right)+C\\ &= \ln|\sec x|+C. &&{\small(\sec x=\tfrac{1}{\cos x})} \end{aligned}

Therefore, the result can also be written as

tan x   d x = ln | sec x | + C .
\bbox[8px, #E6F0FA, border: 3px solid #0066CC]{\int\tan x\ dx=\ln|\sec x|+C=-\ln|\cos x|+C.}

Find cot x   d x .

Solution

Because cot x = cos x / sin x , if we let u = sin x , then

d u = cos x   d x

and

\begin{aligned} \int\cot x\ dx &= \int\frac{\cos x}{\sin x}\,dx\\ &= \int\frac{du}{u}\\ &= \ln|u|+C\\ &= \ln|\sin x|+C. \end{aligned}
\bbox[8px, #E6F0FA, border: 3px solid #0066CC]{\int\cot x\ dx=\ln|\sin x|+C.}

Notice the pattern that makes both of these work: in each case the numerator is, up to sign, the derivative of the denominator. Any integral of the form \displaystyle\int\frac{g'(x)}{g(x)}\,dx equals ln | g ( x ) | + C .

The Integral of sec x tan x

Find sec x tan x   d x .

Solution

Because

d d x sec x = sec x tan x ,

we already know that the result of this integral is sec x + C . However, even if we did not know the result, we could use integration by substitution to derive it:

\begin{aligned} \int\sec x\tan x\ dx &= \int\frac{1}{\cos x}\frac{\sin x}{\cos x}\,dx\\ &= \int\frac{\sin x}{\cos^{2}x}\,dx. \end{aligned}

Let u = cos x , then

d u = sin x   d x .

So

\begin{aligned} \int\frac{\sin x}{\cos^{2}x}\,dx &= \int-\frac{du}{u^{2}}\\ &= -\int u^{-2}\,du\\ &= -(-u^{-1})+C\\ &= \frac{1}{u}+C\\ &= \frac{1}{\cos x}+C &&{\small(u=\cos x)}\\ &= \sec x+C. \end{aligned}
\bbox[8px, #E6F0FA, border: 3px solid #0066CC]{\int \sec x \tan x\;dx=\sec x+C}

Find e x sec ( e x ) tan ( e x )   d x .

Solution

Let u = e x . Then

d u = e x   d x

and

\begin{aligned} \int\sec(\underbrace{e^{x}}_{u})\tan(\underbrace{e^{x}}_{u})\underbrace{e^{x}\,dx}_{du} &= \int\sec u\tan u\ du\\ &= \sec u+C\\ &= \sec e^{x}+C. \end{aligned}

The Integrals of sec x and csc x

Find sec x   d x .

Solution

There are several ways to evaluate this integral; each involves a trick. The easiest way is to multiply and divide the integrand by sec x + tan x :

\begin{aligned} \int\sec x\ dx &= \int\sec x\frac{\sec x+\tan x}{\sec x+\tan x}\,dx\\ &= \int\frac{\sec^{2}x+\sec x\tan x}{\sec x+\tan x}\,dx. \end{aligned}

Let u = sec x + tan x , which gives

d u = ( sec x tan x + sec 2 x ) d x .

The numerator is now exactly d u . Substituting these into the integral yields

\begin{aligned} \int\frac{\sec^{2}x+\sec x\tan x}{\sec x+\tan x}\,dx &= \int\frac{du}{u}\\ &= \ln|u|+C\\ &= \ln|\sec x+\tan x|+C. \end{aligned}
\bbox[8px, #E6F0FA, border: 3px solid #0066CC]{\int\sec x\ dx=\ln|\sec x+\tan x|+C.}

Find csc x   d x .

Solution

Similar to the evaluation of sec x d x , we can integrate csc x by multiplying and dividing by ( csc x + cot x ) :

csc x d x = csc x csc x + cot x csc x + cot x d x csc x d x = csc 2 x + csc x cot x csc x + cot x d x

Now let

u = csc x + cot x .

Then the differential is

d u = ( csc x cot x csc 2 x ) d x .

Factoring out the negative sign gives

d u = ( csc 2 x + csc x cot x ) d x d u = ( csc 2 x + csc x cot x ) d x .

Substituting u and d u back into the integral, we obtain

\begin{aligned} \int \csc x\; dx &= \int \frac{-du}{u} \\ &= -\int \frac{1}{u} \, du\\ &= -\ln|u| + C. \end{aligned}

Finally substituting back for u yields

csc x d x = ln | csc x + cot x | + C .

Alternative Form. Using the logarithmic property ln A = ln 1 A :

ln | csc x + cot x | = ln | 1 csc x + cot x | .

If we multiply the numerator and denominator inside the absolute value by ( csc x cot x ) and apply the trigonometric identity csc 2 x cot 2 x = 1 , we get

ln | csc x cot x csc 2 x cot 2 x | = ln | csc x cot x | .

Both ln | csc x + cot x | + C and ln | csc x cot x | + C are correct forms.

\bbox[8px, #E6F0FA, border: 3px solid #0066CC]{\int \csc x\; dx=-\ln|\csc x+\cot x|+C}

The Integrals of sin²x and cos²x

Neither sin 2 x nor cos 2 x is the derivative of anything obvious, and no substitution helps directly. The way out is to lower the power first, using the half-angle identities

sin 2 x = 1 cos 2 x 2 , cos 2 x = 1 + cos 2 x 2 .

Each identity trades a squared function of x for a first power of a function of 2 x , and first powers we can integrate.

Find sin 2 x   d x .

Solution

We lower the power with the half-angle identity for the sine, sin 2 θ = 1 cos 2 θ 2 , where θ is the angle inside the sine. Taking θ = x gives sin 2 x = 1 cos 2 x 2 , so

\begin{aligned} \int\sin^{2}x\ dx &= \frac{1}{2}\int(1-\cos2x)\,dx\\ &= \frac{1}{2}x-\frac{1}{4}\sin2x+C, \end{aligned}

where cos 2 x d x is evaluated using the substitution u = 2 x .

Find cos 2 x   d x .

Solution

We lower the power with the half-angle identity for the cosine, cos 2 θ = 1 + cos 2 θ 2 , where θ is the angle inside the cosine. Taking θ = x gives cos 2 x = 1 + cos 2 x 2 , so

\begin{aligned} \int\cos^{2}x\ dx &= \frac{1}{2}\int(1+\cos2x)\,dx\\ &= \frac{1}{2}x+\frac{1}{4}\sin2x+C. \end{aligned}
sin 2 x d x = x 2 sin 2 x 4 + C , cos 2 x d x = x 2 + sin 2 x 4 + C .

Notice that adding these two results gives x + C , exactly as it must, because sin 2 x + cos 2 x = 1 . This is a useful way to check that you have the signs right.

Products of Sines and Cosines of Different Angles

In many applied problems such as mechanical vibrations and electromagnetic waves, we encounter the following trigonometric integrals

sin a x cos b x   d x , sin a x sin b x   d x , cos a x cos b x   d x .

To evaluate these integrals, we use the product-to-sum identities

sin a x   cos b x = 1 2 [ sin ( a b ) x + sin ( a + b ) x ] sin a x   sin b x = 1 2 [ cos ( a b ) x cos ( a + b ) x ] cos a x   cos b x = 1 2 [ cos ( a b ) x + cos ( a + b ) x ]

In each of these identities, a is the coefficient of x inside the first factor and b is the coefficient of x inside the second factor. For instance, in sin 3 x cos 5 x the first factor is sin 3 x , so a = 3 , and the second factor is cos 5 x , so b = 5 . The two angles appearing on the right are then ( a b ) x = 2 x and ( a + b ) x = 8 x .

Each identity replaces a product, which we cannot integrate directly, by a sum of two single trigonometric functions, each of which integrates in one step by the linear substitution rule.

Find sin 3 x cos 5 x d x .

Solution

The integrand is a sine times a cosine of a different angle, so we use the product-to-sum identity

sin a x cos b x = 1 2 [ sin ( a b ) x + sin ( a + b ) x ] ,

in which a is the coefficient of x inside the sine and b is the coefficient of x inside the cosine. Our integrand is sin 3 x cos 5 x , so the sine carries 3 x and the cosine carries 5 x , giving

a = 3 , b = 5 , ( a b ) x = 2 x , ( a + b ) x = 8 x .

Since the sine is an odd function, sin ( 2 x ) = sin 2 x , so

\begin{aligned} \int\sin3x\,\cos5x\,dx &= \frac{1}{2}\int\left[\sin(-2x)+\sin8x\right]\,dx\\ &= \frac{1}{2}\int\left[\sin8x-\sin2x\right]\ dx\\ &= \frac{1}{2}\left(-\frac{1}{8}\cos8x+\frac{1}{2}\cos2x\right)+C\\ &= \frac{1}{4}\cos2x-\frac{1}{16}\cos8x+C. \end{aligned}

Two cautions when applying the product-to-sum identities, in which a is the coefficient of x in the first factor and b is the coefficient of x in the second. First, a b may be negative; use sin ( θ ) = sin θ and cos ( θ ) = cos θ to clean up the result, as in the example above. Second, if a = b then ( a b ) x = 0 , so the term cos ( a b ) x becomes cos 0 = 1 , and the identity reduces to the half-angle formulas of the previous subsection.

Integrating sinm x cosn x When Either m or n Is a Positive Odd Integer

When sin x has an odd exponent, we first reduce the integral to the form

( terms involving only  cos x ) sin x d x ,

and when cos x has an odd exponent, we reduce the integral to the form

( terms involving only  sin x ) cos x d x .

Then we can perform the integration by means of

u n d u = u n + 1 n + 1 + C .

The reason this works is worth stating plainly: an odd power always leaves one factor over after we pair the rest into squares, and that leftover factor is exactly the differential we need. The following examples will illustrate how to use this.

Find sin 2 x cos 5 x d x .

Solution

Here the exponent of cos x is odd, so we separate one factor of cos x for the differential and convert the remaining cos 4 x into sines with the Pythagorean identity

sin 2 x + cos 2 x = 1 , that is, cos 2 x = 1 sin 2 x ,

so that cos 4 x = ( cos 2 x ) 2 = ( 1 sin 2 x ) 2 . Thus

\begin{aligned} \int\sin^{2}x\cos^{5}x\, dx &= \int\sin^{2}x\cos^{4}x\cos x\,dx\\ &= \int\sin^{2}x\,(1-\sin^{2}x)^{2}\cos x\,dx\\ &= \int(\sin^{2}x-2\sin^{4}x+\sin^{6}x)\cos x\,dx\\ &= \int\sin^{2}x\cos x\ dx-2\int\sin^{4}x\cos x\ dx\\ &\qquad +\int\sin^{6}x\cos x\ dx. \end{aligned}

Now let

u = sin x d u = cos x d x .

Thus

\begin{aligned} \int\sin^{2}x\cos^{5}x\,dx=\int&\underbrace{\sin^{2}x}_{u^{2}}\underbrace{\cos x\ dx}_{du}-2\int\underbrace{\sin^{4}x}_{u^{4}}\underbrace{\cos x\ dx}_{du}\\ &+\int\underbrace{\sin^{6}x}_{u^{6}}\underbrace{\cos x\ dx}_{du} \end{aligned} sin 2 x cos 5 x d x = sin 3 x 3 2 sin 5 x 5 + sin 7 x 7 + C .

Find cos 3 x d x .

Solution

The exponent of cos x is odd, so we split off one factor of cos x for the differential and convert the remaining cos 2 x into sines by the Pythagorean identity

sin 2 x + cos 2 x = 1 , that is, cos 2 x = 1 sin 2 x .

Therefore

\begin{aligned} \int\cos^{3}x\,dx &= \int\cos^{2}x\cos x\,dx\\ &= \int(1-\sin^{2}x)\cos x\,dx\\ &= \int\cos x\,dx-\int\underbrace{\sin^{2}x}_{u^{2}}\ \underbrace{\cos x\,dx}_{du}\\ &= \sin x-\underbrace{\frac{\sin^{3}x}{3}}_{u^{3}/3}+C. \end{aligned}

Find cos 5 x sin x d x .

Solution

Writing the integrand as sin m x cos n x , we have m = 1 / 2 and n = 5 , since 1 sin x = sin 1 / 2 x . Notice that the strategy does not require m to be a positive integer; only the odd exponent on cos x matters. We separate a factor of cos x from cos 5 x and express the remaining factor cos 4 x in terms of sin x using the Pythagorean identity

sin 2 x + cos 2 x = 1 , that is, cos 2 x = 1 sin 2 x ,

so that cos 4 x = ( 1 sin 2 x ) 2 . That is,

\begin{aligned} \int\frac{\cos^{5}x}{\sqrt{\sin x}}\,dx &= \int\frac{\cos^{4}x}{\sqrt{\sin x}}\cos x\ dx\\ &= \int\frac{(1-\sin^{2}x)^{2}}{\sqrt{\sin x}}\cos x\ dx. \end{aligned}

Now let u = sin x . Then d u = cos x   d x and

\begin{aligned} \int\frac{(1-\sin^{2}x)^{2}}{\sqrt{\sin x}}\cos x\ dx &= \int\frac{(1-u^{2})^{2}}{\sqrt{u}}\,du\\ &= \int\frac{1-2u^{2}+u^{4}}{\sqrt{u}}\,du\\ &= \int\left(u^{-1/2}-2u^{3/2}+u^{7/2}\right)\,du\\ &= 2u^{1/2}-\frac{4}{5}u^{5/2}+\frac{2}{9}u^{9/2}+C\\ &= 2\sqrt{\sin x}-\frac{4}{5}\sqrt{\sin^{5}x}+\frac{2}{9}\sqrt{\sin^{9}x}+C. \end{aligned}

Integrating sinm x cosn x When Both m and n Are Positive Even Integers

When both exponents are even, the odd-power strategy no longer applies: there is no spare factor to serve as d u . Instead, we use the half-angle identities

sin 2 x = 1 cos 2 x 2 , cos 2 x = 1 + cos 2 x 2 ,

and the double-angle identity

sin x cos x = 1 2 sin 2 x

repeatedly until no even powers remain. The resulting integrals involve only first powers of cosines of multiple angles, which are straightforward to integrate.

Find sin 2 x cos 2 x d x .

Solution

We use the double-angle identity for the sine,

sin 2 θ = 2 sin θ cos θ , that is, sin θ cos θ = 1 2 sin 2 θ ,

in which θ is the common angle of the sine and cosine. Here θ = x , so sin x cos x = 1 2 sin 2 x and

\begin{aligned} \int\sin^{2}x\cos^{2}x\,dx &= \int\left(\sin x\cos x\right)^{2}\,dx\\ &= \int\left(\frac{1}{2}\sin2x\right)^{2}\,dx\\ &= \frac{1}{4}\int\sin^{2}2x\,dx. \end{aligned}

Now we apply sin 2 2 x = 1 cos 4 x 2 :

\begin{aligned} \frac{1}{4}\int\sin^{2}2x\,dx &= \frac{1}{4}\int\frac{1-\cos4x}{2}\,dx\\ &= \frac{1}{8}\int\left(1-\cos4x\right)\,dx\\ &= \frac{1}{8}\left(x-\frac{1}{4}\sin4x\right)+C\\ &= \frac{x}{8}-\frac{\sin4x}{32}+C. \end{aligned}

Find sin 4 x cos 2 x d x .

Solution

We write sin 4 x = ( sin 2 x ) 2 and apply the half-angle identities

sin 2 θ = 1 cos 2 θ 2 , cos 2 θ = 1 + cos 2 θ 2 ,

in which θ is the angle inside the sine or cosine and 2 θ is twice that angle. Both factors here have θ = x , so 2 θ = 2 x and

sin 2 x = 1 cos 2 x 2 , cos 2 x = 1 + cos 2 x 2 .

Thus

\begin{aligned} \int\sin^{4}x\cos^{2}x\,dx &= \int\left(\frac{1-\cos2x}{2}\right)^{2}\cdot\frac{1+\cos2x}{2}\,dx\\ &= \frac{1}{8}\int(1-\cos2x)^{2}(1+\cos2x)\,dx. \end{aligned}

Expanding ( 1 cos 2 x ) 2 ( 1 + cos 2 x ) :

\begin{aligned} (1-\cos2x)^{2}(1+\cos2x) &= (1-2\cos2x+\cos^{2}2x)(1+\cos2x)\\ &= 1+\cos2x-2\cos2x-2\cos^{2}2x\\ &\qquad+\cos^{2}2x+\cos^{3}2x\\ &= 1-\cos2x-\cos^{2}2x+\cos^{3}2x. \end{aligned}

For the cos 2 2 x term we again use the half-angle identity cos 2 θ = 1 + cos 2 θ 2 , now with θ = 2 x so that 2 θ = 4 x , giving cos 2 2 x = 1 + cos 4 x 2 . For the cos 3 2 x term the exponent is odd, so we split off one factor of cos 2 x and convert the rest with the Pythagorean identity cos 2 2 x = 1 sin 2 2 x :

cos 3 2 x = ( 1 sin 2 2 x ) cos 2 x .

Substituting back:

\begin{aligned} \int\sin^{4}x\cos^{2}x\,dx &= \frac{1}{8}\int\left[1-\cos2x-\frac{1+\cos4x}{2} +(1-\sin^{2}2x)\cos2x\right]\,dx\\ &= \frac{1}{8}\int\left[\frac{1}{2}-\frac{\cos4x}{2} -\sin^{2}2x\cos2x\right]\,dx. \end{aligned}

Integrating term by term, using u = 2 x for cos 4 x and u = sin 2 x for the last term:

\begin{aligned} \int\sin^{4}x\cos^{2}x\,dx &= \frac{1}{8}\left[\frac{x}{2}-\frac{\sin4x}{8} -\frac{\sin^{3}2x}{6}\right]+C\\ &= \frac{x}{16}-\frac{\sin4x}{64}-\frac{\sin^{3}2x}{48}+C. \end{aligned}

Find cos 4 x d x .

Solution

We write cos 4 x = ( cos 2 x ) 2 and apply the half-angle identity for the cosine,

cos 2 θ = 1 + cos 2 θ 2 ,

where θ is the angle inside the cosine. With θ = x this reads cos 2 x = 1 + cos 2 x 2 , so

\begin{aligned} \int\cos^{4}x\,dx &= \int\left(\frac{1+\cos2x}{2}\right)^{2}\,dx\\ &= \frac{1}{4}\int\left(1+2\cos2x+\cos^{2}2x\right)\,dx. \end{aligned}

For the remaining cos 2 2 x term, we apply the same identity cos 2 θ = 1 + cos 2 θ 2 once more, this time with θ = 2 x , so that 2 θ = 4 x :

cos 2 2 x = 1 + cos 4 x 2 .

Substituting back:

\begin{aligned} \frac{1}{4}\int&\left(1+2\cos2x+\cos^{2}2x\right)\,dx\\ &= \frac{1}{4}\int\left(1+2\cos2x+\frac{1+\cos4x}{2}\right)\,dx\\ &= \frac{1}{4}\int\left(\frac{3}{2}+2\cos2x+\frac{\cos4x}{2}\right)\,dx\\ &= \frac{1}{4}\left(\frac{3}{2}x+\sin2x+\frac{\sin4x}{8}\right)+C\\ &= \frac{3x}{8}+\frac{\sin2x}{4}+\frac{\sin4x}{32}+C. \end{aligned}

Integrating tanm x secn x When m Is a Positive Odd Integer or n Is a Positive Even Integer

The key identities for this family of integrals are

sec 2 x = 1 + tan 2 x and d d x tan x = sec 2 x , d d x sec x = sec x tan x .

Two cases arise naturally.

Case 1: n is a positive even integer. The goal is to use the substitution

u = tan x , d u = sec 2 x d x .

For this to work, we need a bare factor of sec 2 x to serve as the differential d u . Since n is even, we can always peel one sec 2 x off the integrand and reserve it for d u . The remaining factor sec n 2 x has an even exponent, so it can be converted entirely into powers of tan x using

sec 2 x = 1 + tan 2 x

repeatedly. The integral then becomes a polynomial in u = tan x :

\begin{aligned} \int\tan^{m}x\,\sec^{n}x\,dx &= \int\tan^{m}x\,\sec^{n-2}x\cdot\sec^{2}x\,dx\\ &= \int u^{m}(\text{polynomial in }u)\,du. \end{aligned}

Case 2: m is a positive odd integer. The goal is to use the substitution

u = sec x , d u = sec x tan x d x .

For this to work, we need a bare factor of sec x tan x to serve as the differential d u . Since m is odd, we can always peel one factor of tan x off tan m x and pair it with one factor of sec x from sec n x , reserving the product sec x tan x for d u . The remaining factor tan m 1 x has an even exponent, so it can be converted entirely into powers of sec x using tan 2 x = sec 2 x 1 repeatedly. The integral then becomes a polynomial in u = sec x :

\begin{aligned} \int\tan^{m}x\,\sec^{n}x\,dx &= \int\tan^{m-1}x\,\sec^{n-1}x\cdot\sec x\tan x\,dx\\ &= \int u^{n-1}(\text{polynomial in }u)\,du. \end{aligned}

Find tan 2 x sec 4 x d x .

Solution

The exponent of sec x is even, so we apply Case 1. We separate one factor of sec 2 x to serve as the differential, and convert the remaining sec 2 x into tangents by the Pythagorean identity

sec 2 x = 1 + tan 2 x .

Therefore

\begin{aligned} \int\tan^{2}x\sec^{4}x\,dx &= \int\tan^{2}x\sec^{2}x\cdot\sec^{2}x\,dx\\ &= \int\tan^{2}x\,(1+\tan^{2}x)\sec^{2}x\,dx. \end{aligned}

Let u = tan x , so d u = sec 2 x d x :

\begin{aligned} \int u^{2}(1+u^{2})\,du &= \int\left(u^{2}+u^{4}\right)\,du\\ &= \frac{u^{3}}{3}+\frac{u^{5}}{5}+C\\ &= \frac{\tan^{3}x}{3}+\frac{\tan^{5}x}{5}+C. \end{aligned}

Find tan 3 x sec 3 x d x .

Solution

The exponent of tan x is odd, so we apply Case 2. We separate a factor of sec x tan x to serve as the differential, and convert the remaining tan 2 x into secants by the Pythagorean identity

sec 2 x = 1 + tan 2 x , that is, tan 2 x = sec 2 x 1.

Therefore

\begin{aligned} \int\tan^{3}x\sec^{3}x\,dx &= \int\tan^{2}x\sec^{2}x\cdot\sec x\tan x\,dx\\ &= \int(\sec^{2}x-1)\sec^{2}x\cdot\sec x\tan x\,dx. \end{aligned}

Let u = sec x , so d u = sec x tan x d x :

\begin{aligned} \int(u^{2}-1)u^{2}\,du &= \int\left(u^{4}-u^{2}\right)\,du\\ &= \frac{u^{5}}{5}-\frac{u^{3}}{3}+C\\ &= \frac{\sec^{5}x}{5}-\frac{\sec^{3}x}{3}+C. \end{aligned}

Find tan x sec 4 x d x .

Solution

We can write this integral as tan 1 / 2 x sec 4 x d x . The exponent of sec x is even, so we apply Case 1. Notice again that the exponent on tan x need not be an integer. We separate one factor of sec 2 x to serve as the differential, and convert the remaining sec 2 x into tangents by the Pythagorean identity

sec 2 x = 1 + tan 2 x .

Therefore

\begin{aligned} \int\tan^{1/2}x\,\sec^{4}x\,dx &= \int\tan^{1/2}x\,\sec^{2}x\cdot\sec^{2}x\,dx\\ &= \int\tan^{1/2}x\,(1+\tan^{2}x)\sec^{2}x\,dx. \end{aligned}

Let u = tan x , so d u = sec 2 x d x :

\begin{aligned} \int u^{1/2}(1+u^{2})\,du &= \int\left(u^{1/2}+u^{5/2}\right)\,du\\ &= \frac{2}{3}u^{3/2}+\frac{2}{7}u^{7/2}+C\\ &= \frac{2}{3}\tan^{3/2}x+\frac{2}{7}\tan^{7/2}x+C. \end{aligned}

Exercises

Each of the following can be done with the basic formulas, the substitution rule, and the identities of this section. No other technique is needed.

Evaluate tan 3 x d x .

Solution

Let u = 3 x , so d u = 3 d x and d x = 1 3 d u . Then

\begin{aligned} \int\tan 3x\,dx &= \frac{1}{3}\int\tan u\,du\\ &= \frac{1}{3}\ln|\sec u|+C\\ &= \frac{1}{3}\ln|\sec 3x|+C. \end{aligned}

Equivalently, 1 3 ln | cos 3 x | + C .

Evaluate x cot ( x 2 ) d x .

Solution

Let u = x 2 . Then d u = 2 x d x , so x d x = 1 2 d u and

\begin{aligned} \int x\cot(x^{2})\,dx &= \frac{1}{2}\int\cot u\,du\\ &= \frac{1}{2}\ln|\sin u|+C\\ &= \frac{1}{2}\ln|\sin(x^{2})|+C. \end{aligned}

Evaluate csc 2 x d x .

Solution

Let u = 2 x , so d x = 1 2 d u . Using the formula for csc u d u established above,

\begin{aligned} \int\csc 2x\,dx &= \frac{1}{2}\int\csc u\,du\\ &= -\frac{1}{2}\ln|\csc u+\cot u|+C\\ &= -\frac{1}{2}\ln|\csc 2x+\cot 2x|+C. \end{aligned}

Evaluate sin 3 x d x .

Solution

The exponent of sin x is odd, so we peel off one factor of sin x to serve as the differential and convert what remains into cosines. The conversion uses the Pythagorean identity

sin 2 x + cos 2 x = 1 , that is, sin 2 x = 1 cos 2 x .

Therefore

\begin{aligned} \int\sin^{3}x\,dx &= \int\sin^{2}x\,\sin x\,dx\\ &= \int(1-\cos^{2}x)\sin x\,dx. \end{aligned}

Let u = cos x , so d u = sin x d x :

\begin{aligned} \int(1-u^{2})(-du) &= \int(u^{2}-1)\,du\\ &= \frac{u^{3}}{3}-u+C\\ &= \frac{\cos^{3}x}{3}-\cos x+C. \end{aligned}

Evaluate cos 5 x d x .

Solution

The exponent of cos x is odd, so we peel off one factor of cos x for the differential. The remaining cos 4 x is converted into sines by the Pythagorean identity

sin 2 x + cos 2 x = 1 , that is, cos 2 x = 1 sin 2 x ,

which squared gives cos 4 x = ( cos 2 x ) 2 = ( 1 sin 2 x ) 2 . Therefore

\begin{aligned} \int\cos^{5}x\,dx &= \int(1-\sin^{2}x)^{2}\cos x\,dx. \end{aligned}

Let u = sin x , so d u = cos x d x :

\begin{aligned} \int(1-u^{2})^{2}\,du &= \int\left(1-2u^{2}+u^{4}\right)\,du\\ &= u-\frac{2u^{3}}{3}+\frac{u^{5}}{5}+C\\ &= \sin x-\frac{2\sin^{3}x}{3}+\frac{\sin^{5}x}{5}+C. \end{aligned}

Evaluate sin 3 x cos 3 x d x .

Solution

Both exponents are odd, so either factor may supply the differential. We peel off a factor of cos x and convert the remaining cos 2 x using the Pythagorean identity

sin 2 x + cos 2 x = 1 , that is, cos 2 x = 1 sin 2 x .

Therefore

\begin{aligned} \int\sin^{3}x\cos^{3}x\,dx &= \int\sin^{3}x\,(1-\sin^{2}x)\cos x\,dx. \end{aligned}

Let u = sin x , so d u = cos x d x :

\begin{aligned} \int u^{3}(1-u^{2})\,du &= \int\left(u^{3}-u^{5}\right)\,du\\ &= \frac{u^{4}}{4}-\frac{u^{6}}{6}+C\\ &= \frac{\sin^{4}x}{4}-\frac{\sin^{6}x}{6}+C. \end{aligned}

Peeling off a factor of sin x instead gives cos 4 x 4 + cos 6 x 6 + C , which differs from the first answer only by a constant.

Evaluate sin 2 3 x d x .

Solution

Both exponents are even (here sin 2 3 x cos 0 3 x ), so we lower the power with the half-angle identity for the sine,

sin 2 θ = 1 cos 2 θ 2 .

In this identity θ stands for whatever angle appears inside the sine, and 2 θ is twice that angle. Our angle is θ = 3 x , so 2 θ = 6 x and the identity reads

sin 2 3 x = 1 cos 6 x 2 .

Therefore

\begin{aligned} \int\sin^{2}3x\,dx &= \frac{1}{2}\int(1-\cos 6x)\,dx\\ &= \frac{x}{2}-\frac{\sin 6x}{12}+C. \end{aligned}

Evaluate cos 2 x 2 d x .

Solution

We lower the power with the half-angle identity for the cosine,

cos 2 θ = 1 + cos 2 θ 2 ,

in which θ is the angle inside the cosine and 2 θ is twice that angle. Here θ = x 2 , so 2 θ = x and the identity reads

cos 2 x 2 = 1 + cos x 2 .

Therefore

\begin{aligned} \int\cos^{2}\frac{x}{2}\,dx &= \frac{1}{2}\int(1+\cos x)\,dx\\ &= \frac{x}{2}+\frac{\sin x}{2}+C. \end{aligned}

Evaluate sin 4 x d x .

Solution

Write sin 4 x = ( sin 2 x ) 2 and apply the half-angle identity for the sine,

sin 2 θ = 1 cos 2 θ 2 ,

where θ is the angle inside the sine. Here θ = x , so 2 θ = 2 x and sin 2 x = 1 cos 2 x 2 . Squaring,

\begin{aligned} \sin^{4}x &= \left(\frac{1-\cos 2x}{2}\right)^{2}\\ &= \frac{1-2\cos 2x+\cos^{2}2x}{4}. \end{aligned}

The term cos 2 2 x is still an even power, so we apply the half-angle identity for the cosine,

cos 2 θ = 1 + cos 2 θ 2 ,

this time with θ = 2 x , so that 2 θ = 4 x and cos 2 2 x = 1 + cos 4 x 2 . Substituting,

\begin{aligned} \sin^{4}x &= \frac{1}{4}\left(1-2\cos 2x+\frac{1+\cos 4x}{2}\right)\\ &= \frac{1}{4}\left(\frac{3}{2}-2\cos 2x+\frac{\cos 4x}{2}\right). \end{aligned}

Integrating term by term,

\begin{aligned} \int\sin^{4}x\,dx &= \frac{1}{4}\left(\frac{3x}{2}-\sin 2x+\frac{\sin 4x}{8}\right)+C\\ &= \frac{3x}{8}-\frac{\sin 2x}{4}+\frac{\sin 4x}{32}+C. \end{aligned}

Evaluate sin 4 x cos 2 x d x .

Solution

The integrand is a sine times a cosine of a different angle, so we use the product-to-sum identity

sin a x cos b x = 1 2 [ sin ( a b ) x + sin ( a + b ) x ] .

Here a is the coefficient of x inside the sine and b is the coefficient of x inside the cosine. Our integrand is sin 4 x cos 2 x , so the sine carries 4 x and the cosine carries 2 x , which means

a = 4 , b = 2 , a b = 2 , a + b = 6.

Substituting these into the identity gives sin 4 x cos 2 x = 1 2 [ sin 2 x + sin 6 x ] , and therefore

\begin{aligned} \int\sin 4x\cos 2x\,dx &= \frac{1}{2}\int\left[\sin 2x+\sin 6x\right]\,dx\\ &= \frac{1}{2}\left(-\frac{\cos 2x}{2}-\frac{\cos 6x}{6}\right)+C\\ &= -\frac{\cos 2x}{4}-\frac{\cos 6x}{12}+C. \end{aligned}

Evaluate sin x cos 4 x d x . (Here the sine has the smaller coefficient, so watch the sign.)

Solution

We again use the product-to-sum identity for a sine times a cosine,

sin a x cos b x = 1 2 [ sin ( a b ) x + sin ( a + b ) x ] ,

where a is the coefficient of x inside the sine and b is the coefficient of x inside the cosine. Our integrand is sin x cos 4 x . The sine carries 1 x and the cosine carries 4 x , so

a = 1 , b = 4 , a b = 3 , a + b = 5.

This time a b is negative. Since the sine is an odd function, sin ( 3 x ) = sin 3 x , and the identity becomes

sin x cos 4 x = 1 2 [ sin ( 3 x ) + sin 5 x ] = 1 2 [ sin 5 x sin 3 x ] .

Therefore

\begin{aligned} \int\sin x\cos 4x\,dx &= \frac{1}{2}\int\left[\sin 5x-\sin 3x\right]\,dx\\ &= \frac{1}{2}\left(-\frac{\cos 5x}{5}+\frac{\cos 3x}{3}\right)+C\\ &= \frac{\cos 3x}{6}-\frac{\cos 5x}{10}+C. \end{aligned}

Evaluate sin 2 x sin 5 x d x .

Solution

The integrand is a product of two sines, so we use the product-to-sum identity

sin a x sin b x = 1 2 [ cos ( a b ) x cos ( a + b ) x ] .

Here a is the coefficient of x in the first sine and b is the coefficient of x in the second sine. Our integrand is sin 2 x sin 5 x , so

a = 2 , b = 5 , a b = 3 , a + b = 7.

Because the cosine is an even function, cos ( 3 x ) = cos 3 x , so the negative difference causes no trouble here. The identity gives sin 2 x sin 5 x = 1 2 [ cos 3 x cos 7 x ] , and therefore

\begin{aligned} \int\sin 2x\sin 5x\,dx &= \frac{1}{2}\int\left[\cos 3x-\cos 7x\right]\,dx\\ &= \frac{1}{2}\left(\frac{\sin 3x}{3}-\frac{\sin 7x}{7}\right)+C\\ &= \frac{\sin 3x}{6}-\frac{\sin 7x}{14}+C. \end{aligned}

Evaluate sin 7 x sin 3 x d x .

Solution

Two sines again, so we use

sin a x sin b x = 1 2 [ cos ( a b ) x cos ( a + b ) x ] ,

with a the coefficient of x in the first sine and b the coefficient of x in the second. Our integrand is sin 7 x sin 3 x , so

a = 7 , b = 3 , a b = 4 , a + b = 10.

The identity gives sin 7 x sin 3 x = 1 2 [ cos 4 x cos 10 x ] . Note the minus sign between the two cosines; this is what distinguishes the sine-times-sine identity from the cosine-times-cosine one. Therefore

\begin{aligned} \int\sin 7x\sin 3x\,dx &= \frac{1}{2}\int\left[\cos 4x-\cos 10x\right]\,dx\\ &= \frac{1}{2}\left(\frac{\sin 4x}{4}-\frac{\sin 10x}{10}\right)+C\\ &= \frac{\sin 4x}{8}-\frac{\sin 10x}{20}+C. \end{aligned}

Evaluate cos 5 x cos x d x .

Solution

The integrand is a product of two cosines, so we use the product-to-sum identity

cos a x cos b x = 1 2 [ cos ( a b ) x + cos ( a + b ) x ] .

Here a is the coefficient of x in the first cosine and b is the coefficient of x in the second cosine. Our integrand is cos 5 x cos x , so the first cosine carries 5 x and the second carries 1 x , which means

a = 5 , b = 1 , a b = 4 , a + b = 6.

The identity gives cos 5 x cos x = 1 2 [ cos 4 x + cos 6 x ] , and therefore

\begin{aligned} \int\cos 5x\cos x\,dx &= \frac{1}{2}\int\left[\cos 4x+\cos 6x\right]\,dx\\ &= \frac{1}{2}\left(\frac{\sin 4x}{4}+\frac{\sin 6x}{6}\right)+C\\ &= \frac{\sin 4x}{8}+\frac{\sin 6x}{12}+C. \end{aligned}

Evaluate cos 3 x cos 4 x d x .

Solution

Two cosines, so we use

cos a x cos b x = 1 2 [ cos ( a b ) x + cos ( a + b ) x ] ,

with a the coefficient of x in the first cosine and b the coefficient of x in the second. Our integrand is cos 3 x cos 4 x , so

a = 3 , b = 4 , a b = 1 , a + b = 7.

Since the cosine is even, cos ( x ) = cos x , so the identity gives cos 3 x cos 4 x = 1 2 [ cos x + cos 7 x ] . Therefore

\begin{aligned} \int\cos 3x\cos 4x\,dx &= \frac{1}{2}\int\left[\cos x+\cos 7x\right]\,dx\\ &= \frac{1}{2}\left(\sin x+\frac{\sin 7x}{7}\right)+C\\ &= \frac{\sin x}{2}+\frac{\sin 7x}{14}+C. \end{aligned}

Evaluate sin x 2 cos 3 x 2 d x . (The coefficients need not be whole numbers.)

Solution

The integrand is a sine times a cosine, so we use

sin a x cos b x = 1 2 [ sin ( a b ) x + sin ( a + b ) x ] ,

where a is the coefficient of x inside the sine and b is the coefficient of x inside the cosine. Our integrand is sin x 2 cos 3 x 2 . Writing x 2 = 1 2 x and 3 x 2 = 3 2 x , we read off

a = 1 2 , b = 3 2 , a b = 1 , a + b = 2.

Nothing in the identity requires a and b to be integers. Using sin ( x ) = sin x , the identity gives

sin x 2 cos 3 x 2 = 1 2 [ sin ( x ) + sin 2 x ] = 1 2 [ sin 2 x sin x ] .

Therefore

\begin{aligned} \int\sin\frac{x}{2}\cos\frac{3x}{2}\,dx &= \frac{1}{2}\int\left[\sin 2x-\sin x\right]\,dx\\ &= \frac{1}{2}\left(-\frac{\cos 2x}{2}+\cos x\right)+C\\ &= \frac{\cos x}{2}-\frac{\cos 2x}{4}+C. \end{aligned}

Apply the product-to-sum identity to cos 3 x cos 3 x d x , and check that it agrees with the half-angle method.

Solution

The integrand is a product of two cosines, so the relevant identity is

cos a x cos b x = 1 2 [ cos ( a b ) x + cos ( a + b ) x ] ,

with a the coefficient of x in the first cosine and b the coefficient of x in the second. Both factors are cos 3 x , so this time the two coefficients are equal:

a = 3 , b = 3 , a b = 0 , a + b = 6.

Since cos ( 0 x ) = cos 0 = 1 , the identity collapses to cos 3 x cos 3 x = 1 2 [ 1 + cos 6 x ] , and therefore

\begin{aligned} \int\cos^{2}3x\,dx &= \frac{1}{2}\int\left[1+\cos 6x\right]\,dx\\ &= \frac{x}{2}+\frac{\sin 6x}{12}+C. \end{aligned}

Check against the half-angle method. The half-angle identity applied to the angle 3 x , whose double is 6 x , reads

cos 2 3 x = 1 + cos 6 x 2 ,

which is the same integrand, so it gives the same answer. This confirms that the half-angle identities are exactly the special case a = b of the product-to-sum identities.

In an alternating-current circuit, the instantaneous power is the product of a voltage cos ω t and a current cos 2 ω t . Find cos ω t cos 2 ω t d t , where ω > 0 is a constant.

Solution

The variable of integration is t , and the integrand is a product of two cosines, so we use the product-to-sum identity in the form

cos A cos B = 1 2 [ cos ( A B ) + cos ( A + B ) ] ,

where A is the whole angle inside the first cosine and B is the whole angle inside the second. Our integrand is cos ω t cos 2 ω t , so

A = ω t , B = 2 ω t , A B = ω t , A + B = 3 ω t .

Since the cosine is even, cos ( ω t ) = cos ω t , and the identity gives

cos ω t cos 2 ω t = 1 2 [ cos ω t + cos 3 ω t ] .

Therefore

\begin{aligned} \int\cos\omega t\cos 2\omega t\,dt &= \frac{1}{2}\int\left[\cos\omega t+\cos 3\omega t\right]\,dt\\ &= \frac{1}{2}\left(\frac{\sin\omega t}{\omega}+\frac{\sin 3\omega t}{3\omega}\right)+C\\ &= \frac{\sin\omega t}{2\omega}+\frac{\sin 3\omega t}{6\omega}+C. \end{aligned}

Evaluate tan 2 x d x .

Solution

There is no odd power of tan x and no factor of sec x at all, so neither case applies directly. Instead we convert the whole integrand into something we can integrate, using the Pythagorean identity

sec 2 x = 1 + tan 2 x , that is, tan 2 x = sec 2 x 1.

Therefore

\begin{aligned} \int\tan^{2}x\,dx &= \int\left(\sec^{2}x-1\right)\,dx\\ &= \tan x-x+C. \end{aligned}

Evaluate cot 2 x d x .

Solution

Here we use the companion Pythagorean identity, the one relating the cotangent and the cosecant:

csc 2 x = 1 + cot 2 x , that is, cot 2 x = csc 2 x 1.

Therefore

\begin{aligned} \int\cot^{2}x\,dx &= \int\left(\csc^{2}x-1\right)\,dx\\ &= -\cot x-x+C. \end{aligned}

Evaluate tan 3 x d x .

Solution

Split off a factor of tan 2 x and replace it using the Pythagorean identity

sec 2 x = 1 + tan 2 x , that is, tan 2 x = sec 2 x 1.

Then

\begin{aligned} \int\tan^{3}x\,dx &= \int\tan x\left(\sec^{2}x-1\right)\,dx\\ &= \int\tan x\sec^{2}x\,dx-\int\tan x\,dx. \end{aligned}

For the first integral, let u = tan x , so d u = sec 2 x d x and u d u = u 2 2 . For the second, we use the formula established earlier in this section. Therefore

tan 3 x d x = tan 2 x 2 ln | sec x | + C .

Evaluate sec 4 x d x .

Solution

The exponent of sec x is even, so Case 1 applies even though there is no factor of tan x (that is, m = 0 ). We peel off one sec 2 x for the differential and convert the remaining sec 2 x into tangents with the Pythagorean identity

sec 2 x = 1 + tan 2 x .

Therefore

sec 4 x d x = ( 1 + tan 2 x ) sec 2 x d x .

Let u = tan x , so d u = sec 2 x d x :

\begin{aligned} \int(1+u^{2})\,du &= u+\frac{u^{3}}{3}+C\\ &= \tan x+\frac{\tan^{3}x}{3}+C. \end{aligned}

Evaluate tan 4 x sec 4 x d x .

Solution

The exponent of sec x is even, so we use Case 1: peel off one sec 2 x for the differential, and convert the remaining sec 2 x into tangents with the Pythagorean identity

sec 2 x = 1 + tan 2 x .

Therefore

\begin{aligned} \int\tan^{4}x\sec^{4}x\,dx &= \int\tan^{4}x\,(1+\tan^{2}x)\sec^{2}x\,dx. \end{aligned}

With u = tan x and d u = sec 2 x d x ,

\begin{aligned} \int u^{4}(1+u^{2})\,du &= \int\left(u^{4}+u^{6}\right)\,du\\ &= \frac{u^{5}}{5}+\frac{u^{7}}{7}+C\\ &= \frac{\tan^{5}x}{5}+\frac{\tan^{7}x}{7}+C. \end{aligned}

Evaluate tan 5 x sec x d x .

Solution

The exponent of tan x is odd, so we use Case 2: peel off a factor of sec x tan x for the differential, and convert the remaining tan 4 x into secants with the Pythagorean identity

sec 2 x = 1 + tan 2 x , that is, tan 2 x = sec 2 x 1 ,

which squared gives tan 4 x = ( tan 2 x ) 2 = ( sec 2 x 1 ) 2 . Therefore

\begin{aligned} \int\tan^{5}x\sec x\,dx &= \int\tan^{4}x\cdot\sec x\tan x\,dx\\ &= \int(\sec^{2}x-1)^{2}\sec x\tan x\,dx. \end{aligned}

Let u = sec x , so d u = sec x tan x d x :

\begin{aligned} \int(u^{2}-1)^{2}\,du &= \int\left(u^{4}-2u^{2}+1\right)\,du\\ &= \frac{u^{5}}{5}-\frac{2u^{3}}{3}+u+C\\ &= \frac{\sec^{5}x}{5}-\frac{2\sec^{3}x}{3}+\sec x+C. \end{aligned}

Evaluate e x tan ( e x ) d x .

Solution

Let u = e x , so d u = e x d x . Then

\begin{aligned} \int e^{x}\tan(e^{x})\,dx &= \int\tan u\,du\\ &= \ln|\sec u|+C\\ &= \ln\left|\sec(e^{x})\right|+C. \end{aligned}

Evaluate sec 2 x 1 + tan x d x .

Solution

The numerator is exactly the derivative of the denominator. Let u = 1 + tan x , so d u = sec 2 x d x :

\begin{aligned} \int\frac{\sec^{2}x}{1+\tan x}\,dx &= \int\frac{du}{u}\\ &= \ln|u|+C\\ &= \ln|1+\tan x|+C. \end{aligned}

Evaluate sin 3 x cos 4 x d x .

Solution

The exponent of sin x is odd, so we peel off one factor of sin x for the differential and convert the remaining sin 2 x into cosines with the Pythagorean identity

sin 2 x + cos 2 x = 1 , that is, sin 2 x = 1 cos 2 x .

Therefore

sin 3 x cos 4 x d x = 1 cos 2 x cos 4 x sin x d x .

Let u = cos x , so d u = sin x d x :

\begin{aligned} \int\frac{1-u^{2}}{u^{4}}(-du) &= \int\left(u^{-2}-u^{-4}\right)\,du\\ &= -u^{-1}+\frac{u^{-3}}{3}+C\\ &= -\frac{1}{\cos x}+\frac{1}{3\cos^{3}x}+C\\ &= -\sec x+\frac{\sec^{3}x}{3}+C. \end{aligned}

The same integral can be written as tan 3 x sec x d x , and Case 2 gives the same answer.

Evaluate sin 4 x cos 4 x d x in two different ways and reconcile the answers.

Solution

Method (a): substitution. Let u = sin 4 x , so d u = 4 cos 4 x d x :

\begin{aligned} \int\sin 4x\cos 4x\,dx &= \frac{1}{4}\int u\,du\\ &= \frac{u^{2}}{8}+C\\ &= \frac{\sin^{2}4x}{8}+C. \end{aligned}

Method (b): double-angle identity. We use

sin 2 θ = 2 sin θ cos θ , that is, sin θ cos θ = 1 2 sin 2 θ ,

where θ is the angle shared by the sine and the cosine. Here θ = 4 x , so 2 θ = 8 x and sin 4 x cos 4 x = 1 2 sin 8 x . Therefore

\begin{aligned} \int\sin 4x\cos 4x\,dx &= \frac{1}{2}\int\sin 8x\,dx\\ &= -\frac{\cos 8x}{16}+C_{1}. \end{aligned}

Reconciling. We use the double-angle identity for the cosine in the form

cos 2 θ = 1 2 sin 2 θ ,

where θ is the angle inside the sine on the right. Taking θ = 4 x gives 2 θ = 8 x , so cos 8 x = 1 2 sin 2 4 x and

cos 8 x 16 = 1 2 sin 2 4 x 16 = sin 2 4 x 8 1 16 ,

so the two answers differ only by the constant 1 16 , which is absorbed into the constant of integration.