Trigonometric Integrals

Integrals of sine, cosine, tangent and secant show up in almost every calculus course. They look different from one another, but most of them fall to a short list of ideas: split off one factor, use an identity, and substitute.

This article gives you that list. If you want to check any result as you read, the integral calculator shows every step. For the general workflow of choosing a method, see How to Solve Integrals Step by Step.

The Identities You Need

Three groups of identities do almost all the work:

\sin^2 x + \cos^2 x = 1, \qquad 1 + \tan^2 x = \sec^2 x

\sin^2 x = \frac{1 - \cos 2x}{2}, \qquad \cos^2 x = \frac{1 + \cos 2x}{2}

The first line lets you trade one squared function for another. The second line, the power-reducing formulas, turns an even power into a first power of a double angle, which is easy to integrate.

You also need the basic antiderivatives, such as \int \sin x\,dx = -\cos x + C and \int \cos x\,dx = \sin x + C. They are collected in Integral Formulas and Rules.

Powers of sin and cos

Consider integrals of the form

\int \sin^m x \cos^n x \, dx.

The method depends on whether the exponents are odd or even.

One exponent is odd

Take the odd power, pull out one factor, and rewrite the rest with \sin^2 x + \cos^2 x = 1.

If both exponents are odd, pick either one. The leftover factors become a polynomial in u, which is easy to integrate. The substitution itself is covered in Integration by Substitution.

Both exponents are even

There is no factor to save, so use the power-reducing formulas to lower the degree. For \sin^2 x \cos^2 x, combine \sin x \cos x = \tfrac{1}{2}\sin 2x with the power-reducing formula for \sin^2 2x. You may need to apply the formulas more than once.

Powers of tan and sec

Now consider

\int \tan^m x \sec^n x \, dx.

The key derivatives are

\frac{d}{dx}\tan x = \sec^2 x, \qquad \frac{d}{dx}\sec x = \sec x \tan x.

They tell you which factor to save.

Two standard results are worth remembering:

\int \tan x\,dx = -\ln|\cos x| + C, \qquad \int \sec x\,dx = \ln|\sec x + \tan x| + C

A short illustration of the odd-m case:

\int \tan^3 x\,dx = \int \tan x(\sec^2 x - 1)\,dx = \frac{\tan^2 x}{2} + \ln|\cos x| + C

Check by differentiating: the derivative is \tan x \sec^2 x - \tan x = \tan x(\sec^2 x - 1) = \tan^3 x.

Product-to-Sum Formulas

When the integrand is a product of sines and cosines with different angles, such as \sin 3x \cos 2x, powers are not the issue. Use these formulas to turn the product into a sum:

\sin A \cos B = \tfrac{1}{2}\left[\sin(A-B) + \sin(A+B)\right]

\sin A \sin B = \tfrac{1}{2}\left[\cos(A-B) - \cos(A+B)\right]

\cos A \cos B = \tfrac{1}{2}\left[\cos(A-B) + \cos(A+B)\right]

For example:

\int \sin 3x \cos 2x\,dx = \frac{1}{2}\int(\sin x + \sin 5x)\,dx = -\frac{\cos x}{2} - \frac{\cos 5x}{10} + C

Differentiating gives \tfrac{1}{2}\sin x + \tfrac{1}{2}\sin 5x, which equals \sin 3x \cos 2x by the first formula.

Example 1: \int \sin^2 x\,dx

Both the “odd power” trick and a direct substitution fail here, because \sin^2 x has an even power and nothing to save. Use the power-reducing formula:

\int \sin^2 x\,dx = \int \frac{1 - \cos 2x}{2}\,dx = \frac{x}{2} - \frac{1}{2}\int \cos 2x\,dx

Since \int \cos 2x\,dx = \tfrac{1}{2}\sin 2x, we get

\int \sin^2 x\,dx = \frac{x}{2} - \frac{\sin 2x}{4} + C.

Check: the derivative is \tfrac{1}{2} - \tfrac{2\cos 2x}{4} = \tfrac{1 - \cos 2x}{2} = \sin^2 x. ✓

Example 2: \int \sin^3 x \cos^2 x\,dx

The power of \sin x is odd, so save one \sin x and convert the other two:

\int \sin^3 x \cos^2 x\,dx = \int (1 - \cos^2 x)\cos^2 x \,\sin x\,dx

Let u = \cos x, so du = -\sin x\,dx:

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

Substituting back:

\int \sin^3 x \cos^2 x\,dx = -\frac{\cos^3 x}{3} + \frac{\cos^5 x}{5} + C.

Check: differentiating gives \cos^2 x \sin x - \cos^4 x \sin x = \sin x \cos^2 x(1 - \cos^2 x) = \sin^3 x \cos^2 x. ✓

You can check this step by step in the integral calculator by entering sin(x)^3*cos(x)^2.

Which Method When

Integrand Strategy Substitution
\sin^m x \cos^n x, m odd Save one \sin x, convert the rest to \cos x u = \cos x
\sin^m x \cos^n x, n odd Save one \cos x, convert the rest to \sin x u = \sin x
\sin^m x \cos^n x, both even Power-reducing formulas none, integrate directly
\tan^m x \sec^n x, n even Save \sec^2 x, convert the rest to \tan x u = \tan x
\tan^m x \sec^n x, m odd Save \sec x \tan x, convert the rest to \sec x u = \sec x
\tan^m x \sec^n x, m even, n odd Reduce to powers of \sec x, then integration by parts none
\sin ax \cos bx and similar Product-to-sum formulas none, integrate directly

Common Mistakes

Summary

Every integral in this article is solved by the same plan: look at the exponents, choose the factor to save, rewrite the rest with an identity, and substitute. Even powers of sine and cosine use the power-reducing formulas, and products of different angles use the product-to-sum formulas. For a wider overview of methods and when to use each, return to How to Solve Integrals Step by Step.