Richard Feynman’s Integral Trick
“I had learned to do integrals by various methods shown in a book that my high school physics teacher Mr. Bader had given me. [It] showed how to differentiate parameters under the integral sign — it’s a certain operation. It turns out that’s not taught very much in the universities; they don’t emphasize it. But I caught on how to use that method, and I used that one damn tool again and again. [If] guys at MIT or Princeton had trouble doing a certain integral, [then] I come along and try differentiating under the integral sign, and often it worked. So I got a great reputation for doing integrals, only because my box of tools was different from everybody else’s, and they had tried all their tools on it before giving the problem to me.” (Surely you’re Joking, Mr. Feynman!)
Today’s article is going to discuss an obscure but powerful integration technique most commonly known as differentiation under the integral sign, but occasionally referred to as “Feynman’s technique” due to his popularization of this technique in his book, and properly known as the Leibniz Integral Rule.
One point of clarification before we begin: While the Leibniz Rule is sometimes known as “Feynman’s technique” or similar names, it is not to be confused with Feynman’s path integral formulation of quantum mechanics. Hence for the rest of this article, I will refer to it by its proper name.
Let’s start with the problem of computing the following integral:
The book that Feynman mentions in the above quote is Advanced Calculus published in 1926 by an MIT mathematician named Frederick S Woods, this integral comes from that book, and is reproduced on Wolfram Mathworld.
You can try the usual techniques that you learn in calculus. Trig substitution, change of variable, integration by parts, replacing the integrand with a series, none of it will work. You can also try having Wolfram Alpha compute it, and it will time out. We will need to be more creative.
You should first observe that alpha is an arbitrary constant with respect to the integral. Since the definite integral will be a number that depends on alpha, we may treat this integral as a function of alpha. The outline of the approach is as follows:
- Consider the integral as a function f of alpha
- Compute the integral for some particular convenient value of alpha. In this case, if alpha is equal to one, then the integral is equal to zero, which gives us the condition f(1) = 0. We will need this for the last step.
- Differentiate the integral with respect to alpha.
- Compute the definite integral with respect to x.
- Integrate indefinitely with respect to alpha.
- Use the fact that f(1) = 0 to compute the value of the constant of integration.
What we have done is we have transformed the problem from computing an integral into solving a simple differential equation. Observe:
It may seem as though we have only made things worse for ourselves. The integral at the end of the bottom line looks especially formidable, but it can be computed with a bit of algebraic cleverness.
This last integral is simpler than it looks. We have to get rid of the cosine function. To do this, we can do a “reverse” u-substitution.
We’re almost finished. We will make the substitution:
Note that since |alpha| is greater than or equal to 1, and u is positive or zero, y ranges from zero to negative infinity. Therefore:
Therefore, we at last have our differential equation in alpha:
By integrating and using the fact that f(1) = 0, we can complete the calculation of the integral:
And this completes the calculation.
In this first example, the parameter that we were differentiating with was already present in the integrand. However, the true power of differentiation under the integral sign is that we can also freely insert parameters into the integrand in order to make it more tractable. Consider the following integral, taken from the 2005 William Lowell Putnam mathematics competition.
For those who don’t know, the Putnam competition is a problem solving contest offered to math majors every year in December. It has a reputation for being intensely difficult, with average scores typically being between 0 and 1 out of 120. The test is delivered in two sets of six problems, with A5 and A6 usually being the most difficult in the first set. So this integral should be very difficult, despite its deceptively tame appearance (which, by the way, is a trick: the test is time-limited, so this is a trap to make you waste time attempting to compute the integral with elementary calculus techniques, which will not work). However, by carefully introducing a parameter and using the technique that we’ve developed, this integral can be made very simple.
Note that this means that our original integral is I(1) and that I(0) = 0. Let us now continue as before:
The second line was obtained by partial fraction decomposition. These are elementary integrals that can be computed at once to obtain the third line. Since I(0) = 0, by the Fundamental Theorem of Calculus:
Note that we could also proceed as in the first example, solving the differential equation for I in terms of a, and then using the I(0) = 0 condition to determine the particular solution I(a) before plugging in a = 1. Using FTC does the same thing here but shortcuts a few steps.
This is an elementary integral that can be computed at once with standard techniques. The result is:
And so the solution to the problem is:
Which is the value of the integral reported in the solutions to the 2005 exam. Note that the solution sheet discusses other techniques to approach this integral, but this way is by far the simplest and most elegant, not to mention the quickest.
One of the most important skills in mathematical problem solving is the ability to generalize. A given problem, such as the integral we just computed, may appear to be intractable on its own. However, by stepping back and considering the problem not in isolation but as an individual member of an entire class of related problems, we can discern facts that were previously hidden from us. Trying to compute the integral for the particular value a = 1 was too difficult, so instead we calculated the value of the integral for every possibly value of a. Paradoxically, there are many situations where it is actually easier to solve a general problem than it is to solve a specific one.
I also think that this underscores the importance of being willing to learn outside the classroom. Often in math and science courses, time constraints and other factors mean that sometimes educators have no choice but to not include certain subjects in the curriculum. This means that if you don’t take the initiative to direct your own learning, then there’s a lot of potentially very interesting and useful knowledge that you’ll miss out on.
Thanks a lot for reading. I apologize for how awkward it is to have to post all of the math as screenshots from a LaTeX document, but unfortunately Medium doesn’t currently have much native support for writing formulas.
My plan right now is to start doing articles like this more frequently, perhaps two or three times a week, so if you have any subjects that you’d like to know more about, then please feel free to let me know in the comments.