How to Integrate Products of Trigonometric Functions: Techniques and Tricks
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.
The following infographic illustrates the concepts covered in this article.
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 gives
$$\int \sin{x}\sin^2{x}\cos^2{x} dx.$$
Applying the Pythagorean identity, we obtain
$$\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.$$
Distributing \( -u^2 \) gives
$$\int u^4 – u^2 du.$$
Integrating we get
$$\frac{1}{5}u^5 – \frac{1}{3}u^3 + C.$$
Back substituting, we arrive at a final answer of
$$\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, we get
$$\int \sin^4{x}\cos^4{x}\cos{x} dx.$$
Applying the Pythagorean identity gives
$$\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.$$
This is equivalent to
$$\int u^4(u^4 – 2u^2 + 1) du.$$
Distributing \( u^4 \) we get
$$\int u^8 – 2u^6 + u^4 du.$$
Integrating gives
$$\frac{1}{9}u^9 – \frac{2}{7}u^7 + \frac{1}{5}u^5 + C.$$
Back substituting, we arrive at a final answer of
$$\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 \)
(b) \( \int \sin^3{x}\cos^5{x} dx \)
(c) \( \int \sin{x}\cos{x} dx \)
Solution: (a) \( \int \sin^3{x}\cos{x} dx \)
Let \( u = \sin{x} \) then \( du = \cos{x}dx \). Hence, we have
$$\int u^3du.$$
Integrating give
$$\frac{1}{4}u^4 + C.$$
Back substituting, we obtain a final answer of
$$\frac{1}{4}\sin^4{x} + C.$$
(b) \( \int \sin^3{x}\cos^5{x} dx \)
Factoring out a sine, we get
$$\int \sin{x}\sin^2{x}\cos^5{x} dx$$
Applying the Pythagorean identity gives
$$\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.$$
Distributing \( -u^5 \) we get
$$\int u^7 – u^5 du.$$
Integrating gives
$$\frac{1}{8}u^8 – \frac{1}{6}u^6 + C.$$
Back substituting, we arrive at a final answer of
$$\frac{1}{8}\cos^8{x} – \frac{1}{6}\cos^6{x} + C.$$
(c) \( \int \sin{x}\cos{x} dx \)
Let \( u = \sin{x} \) then \( du = \cos{x}dx \). Hence, we have
$$\int udu.$$
Integrating gives
$$\frac{1}{2}u^2 + C.$$
Back substituting, we get a final answer of
$$\frac{1}{2}\sin^2{x} + C.$$
Case 4: m and n are both Even
In this case, we use the power-reducing identities 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 the power-reducing identities gives
$$\int \frac{1}{2}(1 – \cos{2x})\frac{1}{2}(1 + \cos{2x}) dx.$$
Simplifying, this is equivalent to
$$\frac{1}{4}\int 1 – \cos^2{(2x)} dx.$$
Now we apply the power-reducing identity for cosine again, to get
$$\frac{1}{4}\int 1 – \frac{1}{2} – \frac{1}{2}\cos{(4x)} dx.$$
Combining like terms, we obtain
$$\frac{1}{4}\int \frac{1}{2} – \frac{1}{2}\cos{(4x)} dx.$$
Integrating gives
$$\frac{1}{4}(\frac{1}{2}x – \frac{1}{8}\sin{(4x)} + C).$$
Distributing, we arrive at a final answer of
$$\frac{1}{8}x – \frac{1}{32}\sin{(4x)} + C.$$
Products of Sine and Cosine with Different Arguments
To evaluate integrals of this form, 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)} dx \)
(b) \( \int \sin{(2x)}\sin{(8x)} dx \)
(c) \( \int \sin{(3x)}\cos{(7x)} dx \)
(d) \( \int \cos{(4x)}\sin{(6x)} dx \)
Solution: (a) \( \int \cos{x}\cos{(9x)} dx \)
Applying the product to sum identity, we obtain
$$\frac{1}{2}\int \cos{(-8x)} + \cos{(10x)} dx.$$
Using even-odd identities gives
$$\frac{1}{2}\int \cos{(8x)} + \cos{(10x)} dx.$$
Integrating we get
$$\frac{1}{2}(\frac{1}{8}\sin{(8x)} + \frac{1}{10}\sin{(10x)} + C).$$
Distributing, we arrive at a final answer of
$$\frac{1}{16}\sin{(8x)} + \frac{1}{20}\sin{(10x)} + C.$$
(b) \( \int \sin{(2x)}\sin{(8x)} dx \)
Applying the product to sum identity, we get
$$\frac{1}{2}\int \cos{(-6x)} – \cos{(10x)} dx.$$
Using the even-odd identity, we obtain
$$\frac{1}{2}\int \cos{(6x)} – \cos{(10x)} dx.$$
Integrating gives
$$\frac{1}{2}(\frac{1}{6}\sin{(6x)} – \frac{1}{10}\sin{(10x)} + C).$$
Distributing, we arrive at a final answer of
$$\frac{1}{12}\sin{(6x)} – \frac{1}{20}\sin{(10x)} + C.$$
(c) \( \int \sin{(3x)}\cos{(7x)} dx \)
Applying the product to sum identity, we obtain
$$\frac{1}{2}\int \sin{(10x)} + \sin{(-4x)} dx.$$
Using even-odd identities gives
$$\frac{1}{2}\int \sin{(10x)} – \sin{(4x)} dx.$$
Integrating we get
$$\frac{1}{2}(- \frac{1}{10}\cos{(10x)} + \frac{1}{4}\cos{(4x)} + C).$$
Distributing, we arrive at a final answer of
$$- \frac{1}{20}\cos{(10x)} + \frac{1}{8}\cos{(4x)} + C.$$
(d) \( \int \cos{(4x)}\sin{(6x)} dx \)
Applying the product to sum identity gives
$$\frac{1}{2}\int \sin{(10x)} – \sin{(-2x)} dx.$$
Using even-odd identities, we get
$$\frac{1}{2}\int \sin{(10x)} + \sin{(2x)} dx.$$
Integrating we obtain
$$\frac{1}{2}(- \frac{1}{10}\cos{(10x)} – \frac{1}{2}\cos{(2x)} + C).$$
Distributing, we arrive at a final answer of
$$- \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 \).
Solution: Use the power-reducing identity for cosine to get
$$\frac{1}{2}\int \sin{x}(1 + \cos{(4x)} dx.$$
Distributing \( \sin{x} \) gives
$$\frac{1}{2}\int \sin{x} + \sin{x}\cos{(4x)} dx.$$
Now, we use a product to sum identity to obtain
$$\frac{1}{2}\int \sin{x} + \frac{1}{2}\sin{(5x)} + \frac{1}{2}\sin{(-3x)}) dx.$$
Applying even-odd identities gives
$$\frac{1}{2}\int \sin{x} + \frac{1}{2}\sin{(5x)} – \frac{1}{2}\sin{(3x)})dx.$$
Integrating we get
$$\frac{1}{2}(-\cos{x} – \frac{1}{10}\cos{(5x)} + \frac{1}{6}\cos{(3x)} + C).$$
Distributing, we arrive at a final answer of
$$-\frac{1}{2}\cos{x} – \frac{1}{20}\cos{(5x)} + \frac{1}{12}\cos{(3x)} + C.$$
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. In most of these cases, we make use of the Pythagorean identity
$$ \tan^2{x} + 1 = \sec^2{x}. $$
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} \) gives
$$\int \sec^2{x}\sec^2{x}\tan^2{x} dx.$$
Applying the Pythagorean identity, we obtain
$$\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.$$
Distributing \( u^2 \) we obtain
$$\int u^4 + u^2 du.$$
Integrating gives
$$\frac{1}{5}u^5 + \frac{1}{3}u^3 + C.$$
Back substituting, we arrive at a final answer of
$$\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} \) we obtain
$$\int \sec{x}\tan{x}\sec^2{x}\tan^4{x} dx.$$
Applying the Pythagorean identity, we get
$$\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.$$
This is equivalent to
$$\int (u^4 – 2u^2 + 1)u^2 du.$$
Distributing \( u^2 \) we get
$$\int u^6 – 2u^4 + u^2 du.$$
Integrating gives
$$\frac{1}{7}u^7 – \frac{2}{5}u^5 + \frac{1}{3}u^3 + C.$$
Back substituting, we arrive at a final answer of
$$\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 \)
(b) \( \int \sec^6{x}\tan^3{x} dx \)
(c) \( \int \sec^2{x}\tan{x} dx \)
Solution: (a) \( \int \sec^2{x}\tan^3{x} dx \)
Let \( u = \tan{x} \) then \( du = \sec^2{x}dx \). Hence, we have
$$\int u^3du.$$
Integrating gives
$$\frac{1}{4}u^4 + C.$$
Back substituting, we arrive at a final answer of
$$\frac{1}{4}\tan^4{x} + C.$$
(b) \( \int \sec^6{x}\tan^3{x} dx \)
Factoring out \( \sec{x}\tan{x} \) we get
$$\int \sec{x}\tan{x}\sec^5{x}\tan^2{x} dx.$$
Applying the Pythagorean identity gives
$$\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.$$
Distributing \( u^5 \) we get
$$\int u^7 – u^5du.$$
Integrating gives
$$\frac{1}{8}u^8 – \frac{1}{6}u^6 + C.$$
Back substituting, we arrive at a final answer of
$$\frac{1}{8}\sec^8{x} – \frac{1}{6}\sec^6{x} + C.$$
(c) \( \int \sec^2{x}\tan{x} dx \)
Let \( u = \tan{x} \) then \( du = \sec^2{x}dx \). Hence, we have
$$\int udu.$$
Integrating gives
$$\frac{1}{2}u^2 + C.$$
Back-substituting gives a final answer of
$$\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: Factoring out \( \sec^2{x} \) gives
$$\int \sec{x}\sec^2{x} dx.$$
Now set
$$I = \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.$$
Applying the Pythagorean identity, we find
$$I = \sec{x}\tan{x} – \int \sec{x}(\sec^2{x} – 1) dx.$$
Distributing we obtain
$$I = \sec{x}\tan{x} – \int \sec{x}\sec^2{x} – \sec{x} dx.$$
Applying the sum rule gives
$$I = \sec{x}\tan{x} – \int \sec{x}\sec^2{x} dx + \int \sec{x} dx.$$
The first integral is just I, so
$$I = \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.$$
To evaluate the remaining integral, multiply the numerator and denominator by \( \sec{x} + \tan{x} \), which gives
$$2I= \sec{x}\tan{x} + \int \frac{\sec{x}(\sec{x} + \tan{x})}{\sec{x} + \tan{x} } dx.$$
Distributing \( \sec{x} \) we find
$$2I= \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,$$
Integrating we get
$$2I = \sec{x}\tan{x} + \ln{|u|} + C,$$
Back substituting, we get
$$2I = \sec{x}\tan{x} + \ln{|\sec{x} + \tan{x}|} + C,$$
Dividing both sides of the equation by 2, we arrive at a final answer of
$$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
$$\sec{x}\tan{x} – \int \sec^3{x} dx.$$
Integrating we get
$$\sec{x}\tan{x} – \frac{1}{2}\sec{x}\tan{x} – \frac{1}{2}\ln{|\sec{x} + \tan{x}|} + C.$$
Simplifying, we arrive at a final answer of
$$\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 \).
Solution: First we show \( \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.$$
In terms of negative exponents, this is
$$- \int u^{-3} du.$$
Integrating gives
$$\frac{1}{2}u^{-2}.$$
This is equivalent to
$$\frac{1}{2}\frac{1}{u^2}.$$
Back substituting, we obtain
$$\frac{1}{2}\frac{1}{\cos^2{x}}.$$
Now we compute the original integral. We begin by using the quotient identity, which gives
$$\int \frac{\sin^3{x}}{\cos^3{x}} dx.$$
Factoring we get
$$\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
$$\frac{1}{2}\frac{\sin^2{x}}{\cos^2{x}} – \int \frac{\sin{x}\cos{x}}{\cos^2{x}} dx.$$
Applying the quotient identity, we obtain
$$\frac{1}{2}\tan^2{x} – \int \frac{\sin{x}\cos{x}}{\cos^2{x}} dx.$$
Simplifying the integrand, we get
$$\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
$$\frac{1}{2}\tan^2{x} + \int \frac{1}{u} du.$$
Integrating gives
$$\frac{1}{2}\tan^2{x} + \ln{|u|} + C.$$
Back substituting, we arrive at a final answer of
$$\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. In this guide, you learned how to integrate products of trigonometric functions by recognizing patterns and choosing the right method, depending on the integral.
Further Reading
Trigonometric Substitution for Beginners: A Step-by-Step Guide – Now that you know how to evaluate a variety of trigonometric integrals. You are now ready to learn about trigonometric substitution.

