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.

Related posts:

Integration and pragmatism
What to make “u” in integration by parts
Numerical integration article posted

Tagged with:
Posted in Math
10 comments 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…

  2. Stefan B. says:

    In Germany this technique is know as “Generalsubstitution” and regularly taught in undergrad courses in analysis. The german Wikipedia entry claims that this is also called “Cayley-Substitution”.

  3. Adrian Tam says:

    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.

  4. Johan says:

    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!

  5. Jer says:

    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)

  6. Ahmad R says:

    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)).

  7. WebsterLin says:

    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!

  8. Igor Carron says:


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


  9. Brynell says:

    Thank you so much for this article, it saved me time!

  10. Joe says:

    This substitution was certainly a standard part of U.S. college calculus courses (engineering level, say) in the last 70s.

1 Pings/Trackbacks for "Sledgehammer technique for trig integrals"
  1. [...] This post was mentioned on Twitter by John D. Cook and John Myles White, Andrew Been. Andrew Been said: Sledgehammer technique for trig integrals — The Endeavour [...]