On this page
Some integrals refuse every substitution you try. Differentiation under the integral sign gets around them by solving a bigger problem: put a parameter into the integral, differentiate with respect to it, and integrate back. Here are the steps, two classic examples, and the conditions that make it legal.
What is differentiation under the integral sign?
The rule is d/dt ∫ₐᵇ f(x,t) dx = ∫ₐᵇ ∂f/∂t dx: the t-derivative of the integral equals the integral of the t-derivative (Keith Conrad, Differentiating under the integral sign). Conrad's notes date the method to Leibniz in 1697, which is why it is also called the Leibniz integral rule.
In his memoir *Surely You're Joking, Mr. Feynman!*, Richard Feynman writes that he learned the method from a book his high school physics teacher gave him, and got a great reputation for doing integrals "only because my box of tools was different from everybody else's" (quoted in Conrad's notes, citing pp. 71–72 of the memoir). Conrad identifies the book as Frederick Woods' *Advanced Calculus*.
How does Feynman's trick work, step by step?
Put a parameter t where its derivative removes the awkward factor, such as a 1/x or 1/ln x.
Differentiate inside the integral with respect to t; the new integral should be easy.
Integrate the result in t. You have the answer up to a constant C.
Fix C at a value of t where the integral is easy, often by letting t → 0⁺ or t → ∞.
Set t to the value that gives back your original integral.
How do you prove ∫₀^∞ sin x/x dx = π/2 with this method?
sin x/x has no elementary antiderivative, so add a damping factor. For t > 0, let I(t) = ∫₀^∞ e^(−tx) sin x/x dx, the integral treated in section 3 of Conrad's notes.
Differentiating in t brings down −x, which cancels the 1/x:
I′(t) = −∫₀^∞ e^(−tx) sin x dx = −1/(1 + t²), using the integration-by-parts formula for ∫ e^(ax) sin x dx.
So I(t) = C − arctan t.
As t → ∞, |I(t)| ≤ ∫₀^∞ e^(−tx) dx = 1/t → 0, and arctan t → π/2, so C = π/2.
So I(t) = π/2 − arctan t for every t > 0.
Letting t → 0⁺ gives ∫₀^∞ sin x/x dx = π/2. Conrad notes this last step is delicate, because the integral of sin x/x is not absolutely convergent, and proves it in an appendix.
How do you evaluate ∫₀¹ (x^t − 1)/ln x dx?
Here 1/ln x is the problem, and d/dt of x^t is x^t ln x. Let F(t) = ∫₀¹ (x^t − 1)/ln x dx for t > 0 (section 8 of Conrad's notes).
F′(t) = ∫₀¹ x^t dx = 1/(t + 1).
So F(t) = ln(t + 1) + C.
As t → 0⁺ the integrand tends to 0, so F(t) → 0, while ln(t + 1) → 0. So C = 0.
So ∫₀¹ (x^t − 1)/ln x dx = ln(t + 1), and the formula also holds at t = 0; at t = 1 the integral is ln 2.
When can you swap the derivative and the integral?
Not always. Conrad gives f(x,t) = xt³/(x² + t²)² on [0, 1]: the integral works out to t/(2(1 + t²)), whose derivative at t = 0 is 1/2, but integrating ∂f/∂t at t = 0 gives 0 (Conrad, Example 12.2). The cause is that ∂f/∂t is not continuous at (0, 0).
The swap at t = t₀ is valid if two conditions hold (Conrad's Theorem 12.3):
f(x,t) and ∂f/∂t are continuous in both variables for x in the range of integration and t near t₀.
For t near t₀ there are bounds |f(x,t)| ≤ A(x) and |∂f/∂t| ≤ B(x) that do not depend on t, with ∫ A(x) dx and ∫ B(x) dx finite.
In the sin x/x example, for t ≥ c > 0 you can take A(x) = B(x) = e^(−cx), which is why the argument needs t > 0. The measure-theory version, with one integrable function bounding ∂f/∂t, is on the Leibniz integral rule page and rests on the dominated convergence theorem for swapping limits and integrals.
When the limits depend on t too, boundary terms appear: d/dt ∫ from a(t) to b(t) of f(x,t) dx = ∫ ∂f/∂t dx + f(b(t),t)·b′(t) − f(a(t),t)·a′(t) (Conrad, Corollary 12.4).
How should you practise it?
Try it on ∫₀^∞ x² e^(−tx) dx: start from ∫₀^∞ e^(−tx) dx = 1/t and differentiate twice to get 2/t³ (Conrad's section 2 does exactly this). Then compare two other tools for hard integrals: Fubini's rule for swapping the order of integration and evaluating real integrals with the residue theorem.
If partial derivatives or improper integrals feel shaky, the Fermi Concept Library covers every concept in mathematics, physics, chemistry, biology and computing. When an attempt goes wrong, the Fermi Problem Library has a step-by-step solver that explains the reasoning, so you see which step broke.



