The Feynman Integration Trick — Differentiation Under the Integral Sign (2)

In the previous post I gave a brief introduction to "the Feynman integration trick" and used a worked example to show, in outline, how it operates. But understanding a method requires more than just knowing what it can do — we also need to understand its underlying principle and mechanism, so that we can wield it properly. So in this post we'll set up the general theory of "differentiation under the integral sign," to lay the groundwork for further applications.

General principle

We write

$$G(a)=\int_{m(a)}^{n(a)} f(x,a)dx$$

Here, f(x,a) is a function of x carrying a parameter a, and the two limits of integration are themselves functions of the parameter a. Such an integral is also called a variable-limit integral, and can be thought of as a generalization of the ordinary definite integral. Let F(x,a) denote an antiderivative of f(x,a), i.e. $\frac{\partial F(x,a)}{\partial x}=f(x,a)$. Then, by the fundamental theorem of calculus, we have:

$$G(a)=F(n(a),a)-F(m(a),a)$$more

Differentiating with respect to $a$:

$$\begin{aligned}\frac{d G(a)}{da}= &\frac{\partial F(n(a),a)}{\partial n(a)} \times \frac{d n(a)}{da}+\frac{\partial F(n(a),a)}{\partial a}\\ &-\frac{\partial F(m(a),a)}{\partial m(a)} \times \frac{d m(a)}{da}-\frac{\partial F(m(a),a)}{\partial a}\end{aligned}$$

What this rather long expression is really telling us is:

$$G'(a)=\int_{m(a)}^{n(a)} \frac{\partial f(x,a)}{\partial a} dx + f(n(a),a) \times \frac{d n(a)}{da}-f(m(a),a) \times \frac{d m(a)}{da}$$

This is precisely the rule for "differentiation under the integral sign"! If m and n are constants, this simplifies directly to

$$G'(a)=\int_{m}^{n} \frac{\partial f(x,a)}{\partial a} dx $$

The reason "the Feynman integration trick" works is that the "differentiate" step — which looks like it's turning something simple into something more complicated — actually causes many messy terms to temporarily vanish during differentiation, leaving a relatively simple result, which is then integrated back. In a sense, this is the idea of divide-and-conquer applied to computation.

More examples

To further illustrate how the Feynman integration trick is used, BoJone will now present a few more examples. It should be noted that the example shown previously was on the easier side computationally — in general, definite-integral computations tend to be quite involved, and no matter which method you use, you'll need some transformation to turn the integral into one you already know how to handle. This means you need to have built up a stock of known definite-integral results, familiarity with basic integrable functions, and so on. (Of course, when necessary, you can also consult a table of integrals.)

On the other hand, the crux of the Feynman integration trick lies in choosing the parameter. Not every integral you're asked to evaluate comes with a parameter already attached — for instance $\int_0^{\frac{\pi}{2}} \frac{x}{tan x}dx$ — and even when a parameter is given, it may not be in a form suited to our purposes. So we need to gradually develop a feel for how to "retrofit" the integrand into a form containing a parameter, with the original definite integral appearing as the special case where the parameter takes some particular value. As for how to introduce the parameter and how to determine its form, BoJone only has a partial grasp of this himself, and there's still room for improvement.

Example 1:

$$\int_0^{\frac{\pi}{2}} \frac{x}{\tan x}dx$$

This is a fairly common form; its basic shape is $\int \frac{x}{f(x)}dx$, and our approach is to try (every computation here is really just an attempt) recasting it as $\int \frac{f^{-1}(a \times f(x))}{f(x)}dx$, where $f^{-1}(x)$ is the inverse function of $f(x)$, so that the original integral corresponds to the case a=1. Why do this? Once you differentiate it, you'll see why ^_^

For this problem, we rewrite it as

$$G(a)=\int_0^{\frac{\pi}{2}} \frac{arctan(a \times \tan x)}{\tan x}dx \\ f(x,a)=\frac{arctan(a \times \tan x)}{\tan x}$$

so that

$$\begin{aligned}\frac{\partial f(x,a)}{\partial a}=&\frac{1}{a^2 \tan^2 x+1} \\ =&\frac{\cos^2 x}{a^2+(1-a^2)\cos^2 x} \\ =&\frac{1}{1-a^2} \left[1-\frac{2a^2}{(1+a^2)+(1-a^2)\cos 2x}\right]\end{aligned}$$

And so on, and so on — first we need to be clear about what exactly we're doing, and what exactly we're trying to achieve. The next step after differentiating is to integrate — so what form of integral can be easily evaluated? Checking a table of integrals, we find that integrals of the form $\int \frac{1}{a+b \times \cos x}dx$ can indeed be evaluated, so we should try to steer our expression toward this form!

Eventually we get:

$$\begin{aligned}G'(a)=&\frac{1}{1-a^2} \int_0^{\frac{\pi}{2}} \left[1-\frac{2a^2}{(1+a^2)+(1-a^2)\cos 2x}\right]dx \\ =&\frac{1}{1-a^2} \Big[x-a \times \arctan(a \times \tan x)\Big]\Big|_0^{\pi/2} \\ =&\frac{1}{1-a^2}\left(\frac{\pi}{2}-a \times \frac{\pi}{2}\right) \\ =&\frac{\pi}{2(1+a)}\end{aligned}$$

Integrating again gives

$$G(a)=\frac{\pi}{2}[ln(1+a)+C]$$

When $a=0$, $f(x,a)=f(x,0)=0$, so $G(0)=\int_0^{\frac{\pi}{2}} 0dx=0$, from which we conclude $C=0$.

Incidentally, regarding the result of the first integration step (with respect to x), an experienced reader might get a flash of inspiration from

$$\frac{1}{a^2 \tan^2 x+1}$$

and guess that the antiderivative takes the form $\arctan(a \times \tan x)$. Differentiating it, we find:

$$\begin{aligned}\frac{d \arctan(a \times \tan x)}{dx}=&\frac{a}{a^2 \tan^2 x+1} \times \frac{1}{\cos^2 x} \\ =&\frac{a}{a^2 \tan^2 x+1} \times (1+\tan^2 x) \\ =&\frac{a}{a^2 \tan^2 x+1} \times \left(\frac{1}{a^2}+\tan^2 x+1-\frac{1}{a^2}\right) \\ =&\frac{1}{a}+\frac{a-1/a}{a^2 \tan^2 x+1}\end{aligned}$$

This differs from what we want by only a constant, so we can quickly obtain the antiderivative $\frac{1}{1-a^2} [x-a\times\arctan(a \times \tan x)]$. Of course, this does require a certain amount of mathematical intuition.

Remark: Perhaps after seeing the process above, readers will find it rather headache-inducing and wonder: how is this simple at all — it's clearly so complicated! In truth, no matter which method you use, the process of doing calculus computations is always fairly involved; what matters is whether a method is operable and feasible. In other words, once we know it's feasible, we can just carry it out step by step. The tediousness of the computation isn't where the real difficulty of a problem lies — the difficulty in a good problem lies in how to arrive at the flash of inspiration that gets this whole process going in the first place!

To keep this post from running too long, more examples will be saved for the next one.

English translation of a post from 科学空间 | Scientific Spaces by 苏剑林. Original: https://kexue.fm/archives/1619
Translated automatically with claude-sonnet-5; all equations are reproduced verbatim from the source. Copyright remains with the original author.