6

In class the other day, my professor stated the following theorem:

Suppose $\frac{d}{dy}f(x,y)$ is continuous on $[0,1] \times [0,1]$, then $\frac{d}{dy} \int^1_0 f(x,y) \, dx = \int_0^1 \frac{d}{dy}f(x,y) \, dx$.

He then quickly corrected this to read:

Suppose $\frac{d}{dy}f(x,y)$ and f are continuous on $[0,1] \times [0,1]$, then $$\frac{d}{dy} \int^1_0 f(x,y) \, dx = \int_0^1 \frac{d}{dy}f(x,y) \, dx.$$

I was wondering if anyone could provide an example of $f$ which satisfies the conditions for the first statement written but not the subsequently added continuity condition from the second statement, and therefore fails the overall implication of the first statement.

FraGrechi
  • 367

2 Answers2

1

Let $\mathbb{Q}$ be the set of rational numbers. Define $f:[0,1]^2 \to \mathbb{R}$ by

$$f(x,y) = \chi_{\mathbb{Q}}(x)= \begin{cases} 1 & x \in \mathbb{Q}\cap[0,1] \\ 0 & x \in [0,1] \setminus \mathbb{Q} \end{cases},$$ i.e., $f(x,y)$ is $1$ if $x$ is rational and $0$ if $x$ is irrational.

Then $\frac{\partial f}{\partial y} \equiv 0$ and is therefore continuous ($f$ is constant with respect to $y$). As such, $$\int_0^1 \frac{\partial f}{\partial y} ~\mathrm{d} x =0.$$

However, the integral term in

$$\frac{d}{dy} \int_0^1 f(x,y)~\mathrm{d}x$$

is not even defined. Well, at least for the Riemann Integral$\dots$

erfink
  • 5,287
  • 16
  • 34
1

Implicit in the first statement is the existence of all integrals.

As long as $x \mapsto f(x,y)$ is integrable for each fixed $y$, then it is sufficient for $f_y$ to be continuous on $[0,1]^2$ to justify differentiating under the integral sign.

With

$$F(y) = \int_0^1 f(x,y) \, dx$$

and $y_0 \in [0,1]$, we have for $y \neq y_0$,

$$\left|\frac{F(y) - F(y_0)}{y - y_0} - \int_0^1 f_y(x,y_0) \, dx\right| = \left|\int_0^1 \left(\frac{f(x,y)- f(x,y_0)}{y - y_0} - f_y(x,y_0) \right) \, dx\right|.$$

Applying the mean value theorem there exists $\xi$ (which may depend on $x$) between $y$ and $y_0$ such that

$$\left|\frac{F(y) - F(y_0)}{y - y_0} - \int_0^1 f_y(x,y_0) \, dx\right| = \left|\int_0^1 \left(f_y(x, \xi) - f_y(x,y_0) \right) \, dx\right| \\ \leqslant \int_0^1 \left|f_y(x, \xi) - f_y(x,y_0) \right| \, dx.$$

By uniform continuity of $f_y$ on the compact set $[0,1]^2$ there exists for any $\epsilon > 0$ a $\delta > 0$ such that $|y - y_0| < \delta $ implies $|f_y(x, \xi) - f_y(x, y_0)| < \epsilon$ and

$$\left|\frac{F(y) - F(y_0)}{y - y_0} - \int_0^1 f_y(x,y_0) \, dx\right| < \epsilon,$$

proving that $F'(y_o) = \int_0^1 f_y(x,y_0) \, dx.$

There is no counterexample that you seek.

In fact, the switch is valid under much weaker conditions. Considering the Lebesgue integral, for example, if $x \mapsto f(x,y)$ is measurable for each $y$ and integrable for at least one $y$,$f_y(x,y_0)$ exists and there exists an integrable function $g$ such that for $x , y \in [0,1]$ and $y \neq y_0$

$$\left|\frac{f(x,y) - f(x,y_0)}{y - y_0}\right| \leqslant g(x)$$

Perhaps, a simple example might convey some intuition why continuity of $f$ itself is not needed.

Take

$$f(x,y) = \begin{cases} 1 + y, \,\,\, 0 \leqslant x \leqslant 1/2, \, 0 \leqslant y \leqslant 1 \\ 2 + y, \,\,\, 1/2 < x \leqslant 1, \, 0 \leqslant y \leqslant 1\end{cases}$$

Then $f_y(x,y) = 1$,

$$F(y) = \int_0^1 f(x,y) \, dx = \frac{3}{2} + y,$$

and

$$F'(y) = 1 = \int_0^1 f_y(x,y) \, dx$$

RRL
  • 90,707
  • Thank you very much for your answer. I was wondering if you explain your statement: "Implicit in the first statement is the existence of all integrals." As @erfink's answer below demonstrates, we can produce a continuous $\frac{df}{dy}$ such that $f$ is not Riemann integrable; how does this fit in with your claim? – FraGrechi Apr 12 '17 at 14:28
  • 1
    If $\int_0^1 f(x,y) , dx$ does not exist in the first place, then the interchange fails vacuously. Not much point asking if you can switch a derivative with an integral that does not exist (in the Riemann sense). This, of course, is one of major theorems taught in most advanced calculus or real analysis classes. The statement usually begins with some condition on the integrability of the function. In that case it would be natural to ask if the continuity of $f$ as a function on a subset of $\mathbb{R}^2$ is really needed. – RRL Apr 12 '17 at 15:02
  • 1
    The quick correction by the professor of the condition that $f$ be continuous may have been simply a way to add the hypothesis that $f$ be integrable -- and that is much more than is needed for the integral to exist AND for the interchange to be justified. – RRL Apr 12 '17 at 15:05