# Intuition for differentiating beneath the integral

I apologize in advance for a vague question.

There is a theorem:

If both $f(x,s)$ and $\partial _sf(x,s)$ are continuous in $x$ and $s$, then $$\partial_s\int_a^bf(x,s)\,dx=\int_a^b \partial_sf(x,s)\,dx$$

If in addition $\int_{-\infty}^\infty \partial_s f(x,s)\,dx$ converges uniformly in a neighborhood of $s_0$, then $$\partial_s \int_{-\infty}^\infty f(x,s)\,dx=\int_{-\infty}^\infty \partial_s f(x,s)\,dx.$$

The proof I know relies on integrating in $s$ and then switching the order of integration by uniform convergence. But beyond the mechanics of the proof, I am trying to develop an intuition for this fact. It does not seem intuitive to me that $$\partial_s \int f(x,s)\,dx = \int \partial_s f(x,s)\,dx.$$

I think the reason why it seems surprising to me is that you're integrating with respect to a different variable than the integration.

I am familiar with some real analysis and measure theory, so feel free to pitch an answer on that level.

-
You might want to know there is a tag called intuition. – Git Gud Jan 12 '14 at 23:26
@GitGud Thank you, I didn't know that. – Eric Auld Jan 12 '14 at 23:34
I was just reading about this from a reference from another question. I'm not sure if there is enough intuition involved in that reference, but here it is: ocw.mit.edu/courses/mathematics/… – user114628 Jan 12 '14 at 23:39
@user2943324 Thanks, I will read it – Eric Auld Jan 12 '14 at 23:40

The integral is linear, so, writing $F(s) = \int f(x,s)\,dx$, we have

$$\frac{F(s+h)-F(s)}{h} = \int \frac{f(x,s+h)-f(x,s)}{h}\,dx,$$

and letting $h\to 0$, the integrand converges pointwise to $\partial_s f(x,s)$.

So intuitively, it is to be expected that the derivative of $F$ is obtained by integrating the partial derivative of $f$ if that is nice enough.

-
Why are we able to bring the $\lim_{s\to 0}$ under the integral? – Eric Auld Jan 12 '14 at 23:39
@EricAuld That's the "nice enough" condition. It does not always work, only under suitable conditions. It's just the intuition why that is a reasonable expectation. If $f$ and $\partial_s f$ are continuous, and the interval of integration is compact, the convergence is uniform. That's great. If the integral extends over all of $\mathbb{R}$, you need other conditions to ensure the convergence is good enough to interchange limit and integration. – Daniel Fischer Jan 12 '14 at 23:41
I'm sorry, when you say "the convergence is uniform", which convergence? The integral is proper if $f$ is continuous, so there is no issue of convergence there, right? – Eric Auld Jan 12 '14 at 23:44
@EricAuld The convergence of $\dfrac{f(x,s+h)-f(x,s)}{h}$ to $\partial_s \, f(x,s)$ for $h\to 0$ is uniform on $[a,b]$ under the continuity assumption, hence integration and limit can be exchanged then. – Daniel Fischer Jan 12 '14 at 23:46
@EricAuld \dfrac{}{} for display mode frac – user114628 Jan 13 '14 at 6:32

Think of the integral $\int_a^bf(x,s)\,dx$ as an infinite sum $\sum_a^b f(x_i, s) \Delta x_i$, where the $x_i$ are the points of a suitable partition of $[a,b]$. You are probably aware of the fact that sums can be differentiated term-by-term; it follows that differentiating the sum with respect to $s$ can be brought into the sum. The good news is that this informal procedure can be formalized over the hyperreals in terms of hyperfinite sums; note that the integral itself it not exactly a hyperfinite sum but rather the standard part thereof, i.e. the result of rounding it off to the nearest real number.

-