Math Insight

Trigonometric integrals


Here we'll just have a sample of how to use trig identities to do some more complicated integrals involving trigonometric functions. This is ‘just the tip of the iceberg’. We don't do more for at least two reasons: first, hardly anyone remembers all these tricks anyway, and, second, in real life you can look these things up in tables of integrals. Perhaps even more important, in ‘real life’ there are more sophisticated viewpoints which even make the whole issue a little silly, somewhat like evaluating $\sqrt{26}$ ‘by differentials’ without your calculator seems silly.

The only identities we'll need in our examples are $$\cos^2x+\sin^2x=1\;\;\;\;\;\hbox{ Pythagorean identity}$$ $$\sin\,x=\sqrt{1-\cos\,2x\over 2}\;\;\;\;\;\hbox{ half-angle formula}$$ $$\cos\,x=\sqrt{1+\cos\,2x\over 2}\;\;\;\;\;\hbox{ half-angle formula}$$

The first example is $$\int \sin^3 x\;dx.$$ If we ignore all trig identities, there is no easy way to do this integral. But if we use the Pythagorean identity to rewrite it, then things improve: $$\int \sin^3 x\;dx=\int (1-\cos^2x)\sin x\;dx=-\int (1-\cos^2x)(-\sin x)\;dx$$ In the latter expression, we can view the $-\sin x$ as the derivative of $\cos x$, so with the substitution $u=\cos x$ this integral is $$-\int (1-u^2)\;du=-u+{u^3\over 3}+C=-\cos x+{\cos^3x\over 3}+C$$

This idea can be applied, more generally, to integrals $$\int \sin^m x\;\cos^n x\; dx$$ where at least one of $m,n$ is odd. For example, if $n$ is odd, then use $$\cos ^nx=\cos^{n-1}x\;\cos x=(1-\sin^2x)^{n-1\over 2}\;\cos x$$ to write the whole thing as $$\int \sin^m x\;\cos^n x\; dx= \int \sin^m x\;(1-\sin^2x)^{n-1\over 2}\;\cos x\;dx$$ The point is that we have obtained something of the form $$\int\hbox{ (polynomial in $\sin x$) }\cos x\;dx$$ Letting $u=\sin x$, we have $\cos x\;dx=du$, and the integral becomes $$\hbox{ (polynomial in $u$) } du$$ which we can do.

But this Pythagorean identity trick does not help us on the relatively simple-looking integral $$\int \sin^2 x\; dx$$ since there is no odd exponent anywhere. In effect, we ‘divide the exponent by two’, thereby getting an odd exponent, by using the half-angle formula: $$\int \sin^2 x\; dx= \int {1-\cos\,2x\over 2}\;dx={x\over 2}-{\sin 2x\over 2\cdot 2}+C$$

A bigger version of this application of the half-angle formula is $$\int \sin^6 x \; dx=\int ({1-\cos\,2x\over 2})^3\;dx= \int {1\over 8}-{3\over 8}\cos 2x + {3\over 8}\cos^2 2x - {1\over 8}\cos^3 2x\;dx$$ Of the four terms in the integrand in the last expression, we can do the first two directly: $$\int {1\over 8}\;dx={x\over 8}+C\;\;\;\;\; \int -{3\over 8}\cos 2x\;dx= {-3\over 16}\sin 2x+C$$ But the last two terms require further work: using a half-angle formula again, we have $$\int {3\over 8}\cos^2 2x\;dx=\int {3\over 16}(1+\cos 4x)\;dx= {3x\over 16}+{3\over 64}\sin 4x+C$$ And the $\cos^3 2x$ needs the Pythagorean identity trick: $$\int {1\over 8}\cos^3 2x\;dx={1\over 8}\int (1-\sin^22x)\cos 2x\;dx ={1\over 8}[\sin 2x-{\sin^3 2x\over 3}]+C$$ Putting it all together, we have $$\int \sin^6 x \; dx={x\over 8}+{-3\over 16}\sin 2x+ {3x\over 16}+{3\over 64}\sin 4x+{1\over 8}[\sin 2x-{\sin^3 2x\over 3}]+C$$ This last example is typical of the kind of repeated application of all the tricks necessary in order to treat all the possibilities.

In a slightly different vein, there is the horrible $$\int \sec x\;dx$$ There is no decent way to do this at all from a first-year calculus viewpoint. A sort of rationalized-in-hindsight way of explaining the answer is: $$\int \sec x\;dx=\int {\sec x(\sec x+\tan x)\over \sec x+\tan x}\;dx$$ All we did was multiply and divide by $\sec x+\tan x$. Of course, we don't pretend to answer the question of how a person would get the idea to do this. But then (another miracle?) we ‘notice’ that the numerator is the derivative of the denominator, so $$\int \sec x\;dx=\ln(\sec x+\tan x)+C$$ There is something distasteful about this rationalization, but at this level of technique we're stuck with it.

Maybe this is enough of a sample. There are several other tricks that one would have to know in order to claim to be an ‘expert’ at this, but it's not really sensible to want to be ‘expert’ at these games, because there are smarter alternatives.


  1. $\int \cos ^2 x\,dx=?$
  2. $\int \cos x \sin ^2 x\,dx=?$
  3. $\int \cos^3 x \,dx=?$
  4. $\int \sin ^2 5x\,dx=?$
  5. $\int \sec (3x+7)\,dx$
  6. $\int \sin ^2\,(2x+1)\,dx=?$
  7. $\int \sin^3\,(1-x)\;dx=?$