# Sledgehammer technique for trig integrals

There’s a powerful integration trick that I don’t believe is too widely known. Some calculus books mention it in a footnote, but few emphasize it. This is unfortunate since this trick applies to more problems than many of the more ad hoc techniques that are commonly taught.

Karl Weierstrass (1815-1897) came up with the idea of using t = tan(x/2) to convert trig functions of x to rational functions of t. If t = tan(x/2), then

• sin(x) = 2t/(1 + t2)
• cos(x) = (1 – t2) / (1 + t2)
• dx = 2 dt/(1 + t2).

This means that any integral of a rational function of sines and cosines can be converted to an integral of rational function of t. And any rational function of t can be integrated in closed form by using partial fraction decomposition, though the partial fraction decomposition may need to be performed numerically.

I call this the sledgehammer technique because it’s overkill for the simplest trig integrals; other less general techniques are easier to apply in such problems. On the other hand, Weierstrass’ technique is very general and can evaluate integrals that look impossible at first glance.

## 12 thoughts on “Sledgehammer technique for trig integrals”

1. Is there a simple formula for giving a rational approximation of t, or of sin(x) and cos(x), for any x? If so, I can use Farey’s algorithm in Klein to many more interesting things…

I am from Hong Kong and we learn calculus in our F.4-5 (16-17 yrs old). We teach this extensively and call it half-angle tangent substitution.

3. This substitution is teached (and hopefully learned) in first year math-courses in Swedish universities as well =) It’s awesome, so don’t stop making people aware of it just because it’s popular in other countries!

4. That reminds me of the Laplace transforms for integration. I know there are lots of integration tricks that are handy for people who have to integrate things every day. For the rest of us, there’s Maple (or just brute forcing it)

I am from Kashmir, and I wanted to say we also learn this technique in high school in Kashmir. I remember using this as a technique to solve integrals of functions like
1/(5 + 13*sin(x)).

6. I just wanted to thank you for posting this! I went through four college level Calculus courses and never saw this! It’s so simple it’s brilliant. Kudos!

7. John,

The trick is taught in France as one of the general techniques needed to get into selective engineering schools.

Igor.

8. Brynell