Integrating products of trigonometric functions is a common challenge in calculus. Unlike other integrals, these require strategic use of identities, substitutions, and other techniques to rewrite expressions before integration. In this guide on how to integrate products of trigonometric functions, we’ll explore key techniques and tricks.

If you haven’t already, please read my articles Basic Integration Problems for Beginners, The Ultimate Step-by-Step Guide to Solving Integrals Using Substitution, and Integration by Parts Explained with Examples: A Step-by-Step Guide. This article will use the techniques covered in these articles.

Please check out my Trigonometric Integrals Infographic for a visual illustration of this method.

Products of the Form \( \sin^m{x}\cos^n{x} \)

The procedure for evaluating integrals of the form \( \int \sin^m{x}\cos^n{x} dx \), where m and n are nonnegative integers, varies based on the parity of m and n. We consider 4 cases.
In the first 3 cases, we make use of the Pythagorean identity
$$ \sin^2{x} + \cos^2{x} = 1. $$

Case 1: m is Odd, and n is Even

In this case, we factor out a sine and convert the remaining sines into cosines using the Pythagorean identity. We then use the substitution \( u = \cos{x} \).

Example 1: Evaluate \( \int \sin^3{x}\cos^2{x} dx \).

Solution: Factoring out a sine and applying the Pythagorean identity gives

$$\int \sin{x}\sin^2{x}\cos^2{x} dx$$

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

Let \( u = \cos{x} \) then \( du = -\sin{x}dx \) which implies \( -du = \sin{x}dx \). Hence we have

$$-\int (1 – u^2)u^2du = \int u^4 – u^2 du = \frac{1}{5}u^5 – \frac{1}{3}u^3 + C.$$

Which is, upon back substitution

$$\frac{1}{5}\cos^5{x} – \frac{1}{3}\cos^3{x} + C.$$

Case 2: m is Even, and n is Odd

In this case, we factor out a cosine and convert the remaining cosines into sines using the Pythagorean identity. We then use the substitution \( u = \sin{x} \).
Example 2: Evaluate \( \int \sin^4{x}\cos^5{x} dx \).

Solution: Factoring out a cosine and applying the Pythagorean identity gives

$$\int \sin^4{x}\cos^4{x}\cos{x} dx$$

$$\int \sin^4{x}(1 – \sin^2{x})^2\cos{x} dx$$

Let \( u = \sin{x} \) then \( du = \cos{x}dx \). Hence we have

$$\int (1 – u^2)^2u^4du = \int u^4(u^4 – 2u^2 + 1) du = \int u^8 – 2u^6 + u^4 du = \frac{1}{9}u^9 – \frac{2}{7}u^7 + \frac{1}{5}u^5 + C.$$

Which is, upon back substitution

$$\frac{1}{9}\sin^9{x} – \frac{2}{7}\sin^7{x} + \frac{1}{5}\sin^5{x} + C.$$

Case 3: m and n are Both Odd.

If m < n, proceed as you would in case 1. If m > n, proceed as in case 2. If m = n, you can proceed as in cases 1 or 2.

Example 3: Evaluate:
(a) \( \int \sin^3{x}\cos{x} dx \)

Solution: Let \( u = \sin{x} \) then \( du = \cos{x}dx \). Hence we have

$$\int u^3du = \frac{1}{4}u^4 + C.$$

Which is, upon back substitution

$$\frac{1}{4}\sin^4{x} + C.$$

(b) \( \int \sin^3{x}\cos^5{x} dx \)

Solution: Factoring out a sine and applying the Pythagorean identity gives

$$\int \sin{x}\sin^2{x}\cos^5{x} dx$$

$$\int \sin{x}(1 – \cos^2{x})\cos^5{x} dx$$

Let \( u = \cos{x} \) then \( du = -\sin{x}dx \) which implies \( -du = \sin{x}dx \). Hence we have

$$-\int (1 – u^2)u^5du = \int u^7 – u^5 du = \frac{1}{8}u^8 – \frac{1}{6}u^6 + C.$$

Which is, upon back substitution

$$\frac{1}{8}\cos^8{x} – \frac{1}{6}\cos^6{x} + C.$$

(c) \( \int \sin{x}\cos{x} dx \)

Solution: Let \( u = \sin{x} \) then \( du = \cos{x}dx \). Hence we have

$$\int udu = \frac{1}{2}u^2 + C.$$

Which is, upon back substitution

$$\frac{1}{2}\sin^2{x} + C.$$

Case 4: m and n are both Even

In this case, we make use of the power-reducing identifies to rewrite the exponent in terms of odd exponents. These identities are:

$$\sin^2{x} = \frac{1 – \cos{2x}}{2}$$

$$\cos^2{x} = \frac{1 – \cos{2x}}{2}.$$

Example 4: Evaluate \( \int \sin^2{x}\cos^2{x} dx \).

Solution: Applying power-reducing identities gives

$$\int \frac{1}{2}(1 – \cos{2x})\frac{1}{2}(1 + \cos{2x}) dx = \frac{1}{4}\int 1 – \cos^2{(2x)} dx.$$

Now we apply the power-reducing identity for cosine again

$$\frac{1}{4}\int 1 – \frac{1}{2} – \frac{1}{2}\cos{(4x)} dx = \frac{1}{8}x – \frac{1}{32}\sin{(4x)} + C.$$

Products of the Form \( \sin{(ax)}\cos{(bx)} \)

To evaluate integrals of the form \( \int \sin{(ax)}\cos{(bx)} dx \), where a and b are positive real numbers, we make use of the product to sum identities:

$$\cos{x}\cos{y} = \frac{1}{2}(\cos{(x – y)} + \cos{(x + y)})$$

$$\sin{x}\sin{y} = \frac{1}{2}(\cos{(x – y)} – \cos{(x + y)})$$

$$\sin{x}\cos{y} = \frac{1}{2}(\sin{(x + y)} + \sin{(x – y)})$$

$$\cos{x}\sin{y} = \frac{1}{2}(\sin{(x + y)} – \sin{(x – y)})$$

Even Odd identities may also be needed. They are

$$\sin{(-x)} = -sin{x}$$

$$\cos{(-x)} = \cos{x}$$

Example 5: Evaluate

(a) \( \int \cos{x}\cos{(9x)} \)

Solution: Applying the identities

$$\frac{1}{2}\int \cos{(-8x)} + \cos{(10x)} dx = \frac{1}{2}\int \cos{(8x)} + \cos{(10x)} dx = \frac{1}{16}\sin{(8x)} + \frac{1}{20}\sin{(10x)} + C.$$

(b) \( \int \sin{(2x)}\sin{(8x)} \)

Solution: Applying the identities

$$\frac{1}{2}\int \cos{(-6x)} – \cos{(10x)} dx = \frac{1}{2}\int \cos{(6x)} + \cos{(10x)} dx = \frac{1}{12}\sin{(6x)} + \frac{1}{20}\sin{(10x)} + C.$$

(c) \( \int \sin{(3x)}\cos{(7x)} \)

Solution: Applying the identities

$$\frac{1}{2}\int \sin{(10x)} + \sin{(-4x)} dx = \frac{1}{2}\int \sin{(10x)} – \sin{(4x)} dx = – \frac{1}{20}\cos{(10x)} + \frac{1}{8}\cos{(4x)} + C.$$

(d) \( \int \cos{(4x)}\sin{(6x)} \)

Applying the identities

$$\frac{1}{2}\int \sin{(10x)} – \sin{(-2x)} dx = \frac{1}{2}\int \sin{(10x)} + \sin{(2x)} dx = – \frac{1}{20}\cos{(10x)} – \frac{1}{4}\cos{(2x)} + C.$$

Products of Powers of Sine and Cosine with Different Arguments

I don’t have an effective strategy for these that works every time. Just apply the above strategies and techniques and see if they work.

Example 6: Evaluate \( \int \sin{x}\cos^2{2x} dx \).

Use a power-reducing identity to get

$$\frac{1}{2}\int \sin{x}(1 + \cos{(4x)} dx = \frac{1}{2}\int \sin{x} + \sin{x}\cos{(4x)} dx.$$

Now, using a product to sum identity gives

$$\frac{1}{2}\int \sin{x} + \frac{1}{2}(\sin{(5x)} + \sin{(-3x)}) dx = \frac{1}{2}\int \sin{x} + \frac{1}{2}(\sin{(5x)} – \sin{(3x)})dx = -\frac{1}{2}\cos{x} – \frac{1}{20}\cos{(5x)} + \frac{1}{12}\cos{(3x)}.$$

Products of the Form \( \sec^m{x}\tan^n{x} \)

The procedure for evaluating integrals of the form \( \int \sec^m{x}\tan^n{x} dx \), where m and n are nonnegative integers, varies based on the parity of m and n. We consider 6 cases.

Case 1: m and n are Both Even, and m is Nonzero

In this case, we factor out \( sec^2{x} \) and convert the remaining secants into tangents using the Pythagorean identity. We then use the substitution \( u = \tan{x} \).

Example 7: Evaluate \( \int \sec^4{x}\tan^2{x} dx \).

Solution: Factoring out \( \sec^2{x} \) and applying the Pythagorean identity gives

$$\int \sec^2{x}\sec^2{x}\tan^2{x} dx$$

$$\int \sec^2{x}(\tan^2{x} + 1)\tan^2{x} dx$$

Let \( u = \tan{x} \) then \( du = \sec^2{x}dx \). Hence we have

$$\int (u^2 + 1)u^2du = \int u^4 + u^2 du = \frac{1}{5}u^5 + \frac{1}{3}u^3 + C.$$

Which is, upon back substitution

$$\frac{1}{5}\tan^5{x} + \frac{1}{3}\tan^3{x} + C.$$

Case 2: m and n are Both Odd

In this case, we factor out \( \sec{x}\tan{x} \) and convert the remaining tangents into secants using the Pythagorean identity. We then use the substitution \( u = \sec{x} \).

Example 8: Evaluate \( \int \sec^3{x}\tan^5{x} dx \).

Solution: Factoring out \( \sec{x}\tan{x} \) and applying the Pythagorean identity gives

$$\int \sec{x}\tan{x}\sec^2{x}\tan^4{x} dx$$

$$\int \sec{x}\tan{x}\sec^2{x}(sec^2{x} – 1)^2 dx.$$

Let \( u = \sec{x} \) then \( du = \sec{x}\tan{x}dx \). Hence we have

$$\int (u^2 – 1)^2u^2du = \int (u^4 – 2u^2 + 1)u^2 du = \int u^6 – 2u^4 + u^2 = \frac{1}{7}u^7 – \frac{2}{5}u^5 + \frac{1}{3}u^3 + C.$$

Which is, upon back substitution

$$\frac{1}{7}\sec^7{x} – \frac{2}{5}\sec^5{x} + \frac{1}{3}\sec^3{x} + C.$$

Case 3: m is Even and Nonzero, and n is Odd.

If m – 2 < n – 1, proceed as you would in case 1. If m – 2 > n – 1, proceed as in case 2. If m – 2 = n – 1, you can proceed as in case 1 or 2.

Example 9: Evaluate:

(a) \( \int \sec^2{x}\tan^3{x} dx \)

Solution: Let \( u = \tan{x} \) then \( du = \sec^2{x}dx \). Hence we have

$$\int u^3du = \frac{1}{4}u^4 + C.$$

Which is, upon back substitution

$$\frac{1}{4}\tan^4{x} + C.$$

(b) \( \int \sec^6{x}\tan^3{x} dx \)

Solution: Factoring out \( \sec{x}\tan{x} \) and applying the Pythagorean identity gives

$$\int \sec{x}\tan{x}\sec^5{x}\tan^2{x} dx$$

$$\int \sec{x}\tan{x}\sec^5{x}(sec^2{x} – 1) dx.$$

Let \( u = \sec{x} \) then \( du = \sec{x}\tan{x}dx \). Hence we have

$$\int u^5(u^2 – 1)du = \int u^7 – u^5du = \frac{1}{8}u^8 – \frac{1}{6}u^6 + C.$$

Which is, upon back substitution

$$\frac{1}{8}\sec^8{x} – \frac{1}{6}\sec^6{x} + C.$$

(c) \( \int \sec^2{x}\tan{x} dx \)

Solution: Let \( u = \tan{x} \) then \( du = \sec^2{x}dx \). Hence we have

$$\int udu = \frac{1}{2}u^2 + C.$$

Which is, upon back substitution

$$\frac{1}{2}\tan^2{x} + C.$$

Case 4: m is Odd, and n is Zero

In this case, we factor out \( \sec^2{x} \), and proceed using integration by parts choosing \( dv = \sec^2{x}dx \), and convert the resulting tangents into secants using the Pythagorean identity. We then use linearity and solve for the integral as we would solve an algebraic equation. This will leave us with an integral of the form \( \int \sec^{m-2}x dx \).

This will make more sense with an example.

Example 10: Evaluate \( \int \sec^3{x} dx \).

Solution: Set \( I = \int \sec^3{x} dx = \int \sec{x}\sec^2{x} dx \). Choose \( u = \sec{x} \) and \( dv = \sec^2{x}dx \), then \( du = \sec{x}\tan{x} dx \) and \( v = \tan{x} \). Applying the integration by parts formula gives us

$$I = \sec{x}\tan{x} – \int \sec{x}\tan^2{x} dx = \sec{x}\tan{x} – \int \sec{x}(\sec^2{x} – 1) dx = \sec{x}\tan{x} – \int \sec^3{x} dx + \int \sec{x} dx = \sec{x}\tan{x} – I + \int \sec{x} dx.$$

Add I to both sides of the equation to get

$$2I= \sec{x}\tan{x} + \int \sec{x} dx.$$

Focusing on the integral, multiply the numerator and denominator by \( \sec{x} + \tan{x} \).

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

Let \( u = \sec{x} + \tan{x} \) then \( du = (\sec^2{x} + \sec{x}\tan{x}) dx \). Substituting into the integral, we have

$$2I = \sec{x}\tan{x} + \int \frac{1}{u} du = \sec{x}\tan{x} + \ln{|u|} + C,$$

Or

$$2I = \sec{x}\tan{x} + \ln{|\sec{x} + \tan{x}|} + C,$$

Dividing both sides of the equation by 2, we find

$$I = \frac{1}{2}\sec{x}\tan{x} + \frac{1}{2}\ln{|\sec{x} + \tan{x}|} + C.$$

Case 5: m is Odd and, n is Even and Nonzero

In this case, we factor out a tangent and proceed using integration by parts choosing \( dv = \sec^m{x}\tan{x}dx \). This will leave us with an integral of the form \( \int \sec^{m + 2}{x}\tan^{n – 2}{x} dx \).

Example 11: Using the previous example as a lemma, evaluate \( \int \sec{x}\tan^2{x} dx \).

Solution: Factoring out a tangent, we get

$$\int \sec{x}\tan{x}\tan{x} dx.$$

Now choose \( u = \tan{x} \) and \( dv = \sec{x}\tan{x}dx \), then \( du = \sec^2{x} dx \) and \( v = \sec{x} \). Applying the integration by parts formula gives us

$$\int \sec{x}\tan^2{x} dx = \sec{x}\tan{x} – \int \sec^3{x} dx = \frac{1}{2}\sec{x}\tan{x} – \frac{1}{2}\ln{|\sec{x} + \tan{x}|} + C.$$

Case 6: m is Zero

Rewrite the tangents in terms of sines and cosines using the quotient identity.

$$\tan{x} = \frac{\sin{x}}{\cos{x}}.$$

Next, factor out \( \sin^{n – 1}{x} \). Lastly, choose \( dv = \frac{\sin{x}}{\cos^n{x}}dx \), and use integration by parts using a substitution to compute v.

Example 12: Evaluate \( \int \tan^3{x} dx \)

Lemma: \( \int \frac{\sin{x}}{\cos^3{x}}dx = \frac{1}{2}\frac{1}{\cos^2{x}} \)

Let \( u = \cos{x} \) then \( du = -\sin{x}dx \) which implies \( -du = \sin{x}dx \). Hence we have

$$- \int \frac{1}{u^3}du = – \int u^{-3} du = \frac{1}{2}u^{-2} = \frac{1}{2}\frac{1}{u^2} = \frac{1}{2}\frac{1}{\cos^2{x}}.$$

Solution: Using the quotient identity and factoring gives

$$\int \frac{\sin^3{x}}{\cos^3{x}} dx = \int \frac{\sin{x}}{\cos^3{x}}\sin^2{x} dx.$$

Now choose \( u = \sin^2{x} \) and \( dv = \frac{\sin{x}}{\cos^3{x}}dx \), then \( du = 2\sin{x}\cos{x} dx \) and \( v = \frac{1}{2}\frac{1}{\cos^2{x}} \). Applying the integration by parts formula gives us

$$\int \tan^3{x} dx = \frac{1}{2}\tan^2{x} – \int \frac{\sin{x}}{\cos{x}} dx.$$

Let \( u = \cos{x} \) then \( du = -\sin{x}dx \). Hence we have

$$\int \tan^3{x} dx = \frac{1}{2}\tan^2{x} + \int \frac{1}{u} du = \frac{1}{2}\tan^2{x} + \ln{|u|} + C = \frac{1}{2}\tan^2{x} + \ln{|\cos{x}|} + C.$$

Conclusion

Mastering the integration of products of trigonometric functions requires familiarity with trigonometric identities, algebraic manipulation, substitution, and integration by parts, as well as a strategic approach. By recognizing patterns and choosing the right method, you can solve these integrals efficiently.

Frequently Asked Questions

I would recommend understanding the techniques and why they work. The main idea is to analyze the parity of the exponents and then formulate a strategy based on the ideas introduced in this article.