Simplify integration with complex variables
Last night I was helping my daughter with her calculus homework. One of the problems was the following integral:
This is an interesting problem for two reasons. First, it illustrates a clever variation on integration by parts; that's why it was assigned. But it can also be computed using complex variables. As is often the case, the "complex" approach is simpler. Below I'll show the solution the students were expected to find, then one that they wouldn't not be expected to find.
Integration by partsThe traditional approach to this integral is to integrate by parts. Letting u = sin(4x), the integral becomes
Next we integrate by parts one more time, this time letting u = cos(4x). This gives us
At this point it looks like we're getting nowhere. We could keep on integrating by parts forever. Not only that, we're going in circles: we have an integral that's just like the one we started with. But then the clever step is to realize that this is a good thing. Let I be our original integral. Then
Now we can solve for I:
Here's another approach. Recognize that sin(4x) is the imaginary part of exp(4ix) and so our integral is the imaginary part of
which we can integrate immediately:
There's still algebra to do, but the calculus is over. And while the algebra will take a few steps, it's routine.
First, let's take care of the fraction.
Next,
and so our integral is the complex part of
which gives us the same result as before.
The complex variable requires one insight: recognizing a sine as the real part of an exponential. The traditional approach requires several insights: two integrations by parts and solving for the original integral.
Related: