When to differentiate under the integral sign?

Differentiation under integral signs, or the so-called Feynman’s trick, is not a standard integration technique taught in curriculum calculus, albeit widely used. Despite the mystique around it, it is actually rooted in double integrals. A good illustrative example is

$$I=\int_0^1\int_0^1 x^t dt dx$$

The natural approach is to integrate $x$ first and then $t$ to arrive at $I = \ln 2$. But, an unsuspecting person may integrate $t$ first and then encounter,

$$I=\int_0^1\frac{x-1}{\ln x} dx$$

Now, he/she is stuck since there is not easy way out. Fortunately, there is, which is to differentiate $I(t)$ below under the integral, i.e.

$$I(t)=\int_0^1\frac{x^t-1}{\ln x} dx,\>\>I(t)' = \int_0^1 x^t dx= \frac{1}{1+t} \implies I=\int_0^1 I(t)'dt=\ln 2$$

A knowledgeable math person, aware of its double-integral origin, would just undo the $t$-integral to reintroduce the double form, and then integrate in the right order,

$$I=\int_0^1\frac{x-1}{\ln x} dx=\int_0^1\int_0^1 x^t dt dx = \int_0^1 \frac1{t+1}dt= \ln 2$$

The two approaches are in fact equivalent, with the double-integrals actually more straightforward. The differentiation trick is attractive to many, since it “decouples” a double-integral in appearance, especially when the embedded double-integral is not immediately discernible.


It usually comes up when you are dealing with functions defined in terms of an integral but also can be used to clean up ugly integrals by introducing a new parameter and differentiating with respect to said new parameter. Look up Feynman integration, there are lots of instructive videos and examples of this technique.


It can require more originality than other methods. If you work through the linked examples, you might develop an instinct for when to try it. But I don't think there's a broad rule for when to try it. However, when you see an integrand of the form $f(x)x^s\ln^nx$ with $n\in\Bbb N$ where the problem would be easy for $n=0$, that's a good sign. So is an integrand of the form $h(x)f(1+ag(x))/g^\prime(x)$.