31
$\begingroup$

I'm exploring differentiation under the integral sign (I want to be much faster and more assured in doing this common task). So one thing I'm interested in is good counterexamples, where both expressions

$\frac{d}{dx} \int f(x,y)dy$

and

$\int \frac{\partial}{\partial x} f(x,y)dy$

exist at some value of x but are not equal. Thanks in advance.


Here is some of my exploration so far.

My derivation for switching the derivative and integral is as follows:

$\frac{d}{dx} \int f(x,y)dy = \frac{d}{dx}\int f(a,y)+\int_a^x \frac{\partial}{\partial s}f(s,y)dsdy = \frac{d}{dx}\int \int_a^x \frac{\partial}{\partial s}f(s,y)dsdy$,

provided f is absolutely continuous in the x-direction (used FTC). Then provided $\frac{\partial}{\partial s}f(s,y)$ is integrable in some rectangle $[x,x'] \times \Omega$, we can apply Fubini and switch the order of integration,

$= \frac{d}{dx}\int_a^x \int \frac{\partial}{\partial s}f(s,y)dyds$.

Then using FTC again, the first integral and derivative cancel provided that $\int \frac{\partial}{\partial s}f(s,y)dy$ is continuous.

Thus altogether the assumptions I need in order to switch integration order are

1) f is absolutely continuous in the x-direction

2) df/da is integrable in a rectangle where one side is a small interval containing x, and the other is the whole y-direction.

3) $\int \frac{\partial}{\partial x} f(x,y)dy$ is continuous.

4) and of course, the original expressions are defined.

This was the most general I could go. The conditions seem messy and forgettable, so I'd like to find some nicer conditions I could use in general, if possible.

Condition 3) seemed like it might be the easiest to toss, but I found a counterexample where all other conditions are satisfied but that one:

Let y be the positive integers and dy be the counting measure, so we're just trying to flip a sum and the derivative. Let

$f(x,y) = x$ for $\frac{1}{y+1} < x <\frac{1}{y}$ and zero elsewhere.

Then we see the integral of the derivative of $f$ is $0$ at $x=0$ and the derivative of the integral is $1$ at $x=0$, thus providing one counterexample. Here conditions 1) and 3) were not satisfied, but the example could be easily modified to make 1) satisfied.

$\endgroup$
1
  • 5
    $\begingroup$ The math.stackexchange.com site is a very good place for this kind of question. This forum isn't so appropriate. I've voted to close. $\endgroup$ Commented Aug 29, 2012 at 0:11

4 Answers 4

18
$\begingroup$

This is an interesting question... which appears to be about "calculus", but which asks for a better answer than could be given in "calculus". And, in fact, I would advocate turning the question around so that the answer to "Can we interchange?" is "Yes, with suitable interpretation...", rather than "Sometimes, but sometimes not."

Upvoted Bob Israel's literal counter-example! :)

An easier analogue is "Clairault's theorem" (I am not at all confident of the correctness of this attribution) about equality of mixed second partials: functions like $xy/(x^2+y^2)$ have unequal mixed second partials at $0$ ... but, from a distributional viewpoint the mixed second partials are absolutely equal. The "discrepancy" is in caring about pointwise values. (Meanwhile, there is also the opposite hazard of thinking that "almost everywhere 0" is operationally $0$ for distributional computations.)

My point is that we oughtn't differentiate unless differentiation is a continuous operation on whatever space of functions, and we oughtn't integrate unless the integration is a continuous map on suitable spaces of functions... so that the question of interchange would be foregone... :)

(A happy situation is when the integrand is a continuous compactly-supported function-valued function of the parameter, and that diff'n is a continuous map from one function-space to another, and then a Gelfand-Pettis integral discussion gives the interchangeability for general reasons. This kind of thing is why L. Schwartz put a perhaps-surprising emphasis on the point that what we now call "Schwartz functions" are functions which admit a smooth extension to a certain $n$-sphere compactification of Euclidean n-space. So, truly, by now, if a situation resists compactification and application of Gelfand-Pettis ideas, perhaps there is a genuine problem. I do also note that "Bochner" or "strong" (which seems to mean "constructed by analogy with Riemann integrals") integrals do not overcome these problems.)

Reprise: there are certainly counter-examples to the literal question, but I'd recommend revising that question exactly in light of the nature of the counter-examples. :)

$\endgroup$
1
  • $\begingroup$ Thanks for the thoughtful response. It's got me thinking, maybe a nice way to handle the issue of "integration needing to be a continuous operation" is to turn the assumption into an operation instead, which may be easier to remember and stronger. For instance, perhaps instead of simply commuting integral and derivative, add in a limsup or liminf to one side, and change the equation to inequality. Then continuity doesn't need to be checked, and in the case of continuity liminf and limsup are equal. $\endgroup$
    – bort
    Commented Aug 29, 2012 at 15:39
34
$\begingroup$

Consider $$f(x,y) = \cases{ \text{sgn}(x) \dfrac{x^2-y^2}{x^2} & for $0 < |y| < |x|$ \cr 0 & otherwise }$$ Then $\displaystyle \int_{-1}^1 f(x,y)\ dy = 4 x/3$ for $-1 \le x \le 1$, so $\displaystyle \frac{\partial}{\partial x} \int_{-1}^1 f(x,y)\ dy = 4/3$, but $\dfrac{\partial f}{\partial x} (0,y) = 0$ so $\displaystyle \int_{-1}^1 \frac{\partial f}{\partial x}(0,y)\ dy = 0$.

$\endgroup$
1
  • 1
    $\begingroup$ I like this counterexample. It seems to be just barely misbehaved enough: bounded domain, bounded function, can be smoothed out a little, and all the trouble happens right around (0,0). I'm thinking now about the statement $\liminf_{x' \to x} \int \frac{\partial}{\partial x} f(x',y) dy \leq \frac{d}{dx} \int f(x,y)dy$ and similarly for limsup. I haven't yet checked if this is valid, but I feel like something like that would be easier to remember since it requires less assumptions. $\endgroup$
    – bort
    Commented Aug 29, 2012 at 15:39
11
$\begingroup$

Set $$ f(x,y) = \begin{cases} \frac{x^3y}{(x^2+y^2)^2}, & {\rm if} \ x \not= 0 \ {\rm or } \ y \not= 0, \\ 0, & {\rm if } \ x = 0 \ {\rm and } \ y = 0, \end{cases} $$ Then the integral $$ F(x) = \int_0^1 f(x,y)\,{\rm d}y $$ can be computed to equal $\frac{x}{2(1+x^2)}$ for all $x$ (check $x = 0$ separately). This is a differentiable function for all $x$, with $$ F'(x) = \frac{1-x^2}{2(1+x^2)^2}. $$ In particular, $F'(0) = 1/2$. However, $$ \frac{\partial}{\partial x}f(x,y) = \begin{cases} \frac{x^2y(3y^2-x^2)}{(x^2+y^2)^3}, & {\rm if } \ y \not= 0, \\ 0, & {\rm if } \ y = 0, \end{cases} $$ so $f_x(0,y) = 0$. Therefore the "equation" $$ \frac{\rm d}{{\rm d}x}\int_0^1 f(x,y)\,{\rm d}y = \int_0^1 \frac{\partial}{\partial x}f(x,y)\,{\rm d}y $$ is invalid at $x = 0$, where the left side is $1/2$ and the right side is $0$. A problem is that $f_x(x,y)$ is not a continuous function of two variables: along the line $y = x$ we have $f_x(x,y) = f_x(x,x) = 1/(4x)$ for $x \not= 0$, which does not converge as $x \rightarrow 0$ even though $f_x(0,0) = 0$ is defined.

$\endgroup$
1
  • $\begingroup$ $f$ itself is also not continuous at $(0,0)$ on the path $y=x$. $\endgroup$
    – Idonknow
    Commented Nov 24, 2020 at 13:35
2
$\begingroup$

Here's an example that came up in practice.

Theorem: (Cauchy-Pompeiu) Let $U \subset \mathbb{C}$ be a bounded open set with piecewise- $C^1$ boundary $\partial U$ oriented positively (see appendix B ), and let $f: \bar{U} \rightarrow \mathbb{C}$ be continuous with bounded continuous partial derivatives in $U$. Then for $z \in U$ : $$ f(z)=\frac{1}{2 \pi i} \int_{\partial U} \frac{f(\zeta)}{\zeta-z} d \zeta+\frac{1}{2 \pi i} \int_U \frac{\frac{\partial f}{\partial \bar{\zeta}}(\zeta)}{\zeta-z} \, \text{Leb}_{\mathbb C}(d \zeta) $$

In the linked source (a libretexts book written by Jiří Lebl), there is the following question:

Why can we not differentiate in $\bar z$ under the integral in the second term of the Cauchy–Pompeiu formula? Notice that it would lead to an impossible result.

[Namely, applying $\partial_{\bar z}$ to both sides, if it was possible to move $\partial_{\bar z}$ from the outside to the inside of the integral in the 2nd term, then we would get that 2nd term $=0$ and so we would conclude $\partial_{\bar z} f=0$, i.e. every $C^1$ function $f$ on $\bar U$ is holomorphic. Which is of course totally false.]

The standard differentiation under the integral result is

Let $X$ be an open subset of $\mathbb R$, and $\Omega$ be a measure space. Suppose ${\displaystyle g\colon X\times \Omega \to \mathbb R}$ satisfies the following conditions:

  1. ${\displaystyle g(x,\omega )}$ is a Lebesgue-integrable function of ${\displaystyle \omega }$ for each ${\displaystyle x\in X}$.

  2. For almost all ${\displaystyle \omega \in \Omega }$, the partial derivative ${\displaystyle g_{x}}$ exists for all ${\displaystyle x\in X}$.

  3. There is an integrable function ${\displaystyle \theta \colon \Omega \to \mathbb {R} }$ such that ${\displaystyle |g_{x}(x,\omega)|\leq \theta (\omega )}$ for all ${\displaystyle x\in X}$ and almost every ${\displaystyle \omega \in \Omega }$.

Then, for all ${\displaystyle x\in X}$, $${\frac d{dx} \int _{\Omega }g(x,\omega )\,d\omega =\int _{\Omega}g_{x}(x,\omega )\,d\omega .}$$

The same proof (Dominated Convergence Theorem) shows the same thing if we replace $\mathbb R$ by $\mathbb C$ and $\partial_x$ by $\partial_{\bar z}$.

So in our Cauchy-Pompeiu setting, we have both $X,\Omega:= U$; and $g(z,\zeta):= \frac{\partial_{\bar \zeta} f(\zeta)}{\zeta-z} : U \times U \to \mathbb C$.

(1.) is satisfied, (2.) is almost satisfied: for all fixed $\zeta \in U$, the derivative $\partial_{\bar z} g$ exists (and equals $0$, and is in fact (3.) dominated by the integrable function $\theta \equiv 0$), for all $z\in U$ except at just one point $z=\zeta$!

So the Leibniz rule fails to apply for our Cauchy-Pompeiu integral, because a "for all" condition fails at just one point! I find this to be quite subtle: there are "for all" and "for almost all" conditions in the theorem, and it is of critical importance to remember which variable requires the "for all" condition!

Perhaps due to the examples students are typically shown when learning this theorem, people are more likely to think about the "domination" condition, than the subtle "existence" condition. This is why this example stood out to me.

(Just remember: the variable being differentiated needs "for all", and the variable being integrated just needs "for almost all". Which makes total sense.)

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .