Differentiation and Integration cannot always be swapped

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
21 replies · 3K views
Messages
6,002
Reaction score
2,629
Well here is my (I hope successful this time ) attempt at 10. e)

We consider the function ##f(x,y)=\begin{cases}\dfrac{e^{-x|y|}}{y}, y\neq 0 \\ 0, y=0\end{cases}##.

For this function for ##y\neq 0## it is for any ##x##, ##\frac{\partial f}{\partial x}=-\frac{|y|}{y}e^{-x|y|}##.

Also it should be clear that due to the infinite discontinuity at the points ##(x,0)## the integral ##\int_\mathbb{R}f(x,y)dy## does not converge hence the left hand side of the condition of 10. e) is infinite (or undefined).

The right hand side of the condition is ##\int_\mathbb{R}-\frac{|y|}{y}e^{-x|y|}dy=\int_{-\infty}^0e^{xy}dy+\int_0^{+\infty} -e^{-xy} dy=0## ,

So the condition is true for this ##f##.
 
Last edited:
on Phys.org
Delta2 said:
Well here is my (I hope successful this time ) attempt at 10. e)

We consider the function ##f(x,y)=\begin{cases}\dfrac{e^{-x|y|}}{y}, y\neq 0 \\ 0, y=0\end{cases}##. For this function for ##y\neq 0## it is for any ##x##, ##\frac{\partial f}{\partial x}=\frac{|y|}{y}e^{-x|y|}##.

Also it should be clear that due to the infinite discontinuity at the points ##(x,0)## the integral ##\int_\mathbb{R}f(x,y)dy## does not converge hence the left hand side of the condition of 10. e) is infinite (or undefined).

The right hand side of the condition is ##\int_\mathbb{R}\frac{|y|}{y}e^{-x|y|}dy=\int_{-\infty}^0-e^{xy}dy+\int_0^{+\infty} e^{-xy} dy=0## ,

So the condition is true for this ##f##.
I was looking for finite values, i.e. existing integrals.

Edit:

However it suffices that the two sides differ at a point, where the differentials are evaluated. This would make the functions different. Your idea was good. My example also works with ##g\, : \,t \longmapsto \exp (-t^2)## and ##g(xy)##. But instead of dividing by ##y##, I multiplied by ##x## which avoids singularities.
 
Last edited:
  • Like
Likes   Reactions: Delta2
Interesting, my original line of thinking is that f should have some discontinuities in order for the two sides to be different. So you saying there is some f that is continuous in R yet the two sides are different?

Hmmmm,, trying to follow your hint.. does the function ##f(x,y)=xe^{-x|y|}## does the job?
 
fresh_42 said:
I don't see what your absolute value of ##y## is good for. I had a slightly different function, such that differentiation will leave me a factor ##x## to make it zero at ##x=0##.

Er but the integral on the left hand side will not converge if I don't put |y|...

But let me ask you directly, is your function continuous everywhere in R?
 
Delta2 said:
If I understood well, your "main" function is ##f(x,y)=xe^{-x^2y^2}## but is that all, you haven't defined any special discontinuities?
I first consider ##t \longrightarrow \exp(-t^2)## and calculated the integral. Then I used a continuously differentiable function ##f\, : \,(x,y) \longmapsto h(x)g(xy)## to calculate both sides. If you want to follow this path, find ##h(x)## and do the computations! The latter is part of the question, so wordings like "Also it should be clear that" aren't especially helpful.
 
ok so for 10. e) I will follow the suggestion of @fresh_42 .

First let's consider the function ##g(t)=e^{-t^2}## and the integral ##\int_{\mathbb{R}} g(t)dt=\int_{\mathbb{R}} e^{-t^2} dt=\sqrt \pi##

Next we consider the function ##f(x,y)=xg(xy)=xe^{-x^2y^2}##

Then ##\int_{\mathbb{R}} f(x,y)dy=\int xg(xy)dy##, integration by substitution ##t=xy\Rightarrow dt=xdy## so we get that (for ##x\neq 0##)
##\int_{\mathbb{R}} f(x,y)dy=\int xg(xy)dy=\int g(t)dt=\sqrt\pi##, and the derivative of this with respect to x is zero, so the LHS of the condition is 0. (For ##x=0## this integral is 0).

For the RHS of the condition we first note that ##\frac{\partial f}{\partial x}=g(xy)-2x^2y^2g(xy)##, and integrating w.r.t y we get (for ##x\neq 0##)
##\int_{\mathbb{R}}\frac{\partial f}{\partial x}dy=\int_{\mathbb{R}} g(xy) dy-2 \int_{\mathbb{R}}x^2y^2g(xy)dy=\frac{\sqrt\pi}{x}-2x^2\frac{\sqrt\pi}{2x^3}##. This is also zero. (For ##x=0## this integral is ##\int_{\mathbb{R}}(g(0y)-0)dy=+\infty##).

Well it seems that again I am stumbled upon a non convergence, hmmm, are you sure @fresh_42 that there is function such that both sides converge (for any ##x##) yet they differ?
 
Last edited:
Delta2 said:
ok so for 10. e) I will follow the suggestion of @fresh_42 .
That wasn't my suggestion! My suggestion is ##f(x,y)=x|x|g(xy)## with ##g(t)=\exp(-t^2)## which leads to
$$
\sqrt{\pi}=\left.\dfrac{d}{dx}\right|_{x=0} F(x)=\left.\dfrac{d}{dx}\right|_{x=0}\int_\mathbb{R}f(x,y)\,dy \neq \int_\mathbb{R}\left.\dfrac{\partial}{\partial x}\right|_{x=0}f(x,y)\,dy =0
$$
 
Last edited:
fresh_42 said:
That wasn't my suggestion! My suggestion is ##f(x,y)=x|x|g(xy)## with ##g(t)=\exp(-t^2)## which leads to
$$
\sqrt{\pi}=\left.\dfrac{d}{dx}\right|_{x=0} F(x)=\left.\dfrac{d}{dx}\right|_{x=0}\int_\mathbb{R}f(x,y)\,dy \neq \int_\mathbb{R}\left.\dfrac{\partial}{\partial x}\right|_{x=0}f(x,y)\,dx =0
$$
You mean ##dy## at the end?
I would quibble that ##f(0,y)## is not defined. I thought of making an example using Cantor functions as discussed here, but then the partial derivatives are only defined "almost everywhere", so that is not rigorous either.
 
fresh_42 said:
##F(x) =x\cdot \sqrt{\pi}## so ##F'(x)=\sqrt{\pi} ## which does exist.

in post #89 I calculated that ##\int_{\mathbb{R}}xg(xy)=\sqrt\pi## where am I wrong there?

Are you saying that ##\int_{\mathbb{R}}|x|g(xy)=\sqrt\pi##?

In my opinion it is ##F(x)=|x|\sqrt\pi##
 
Find an example for which
$$
\dfrac{d}{dx}\int_\mathbb{R}f(x,y)\,dy \neq \int_\mathbb{R}\dfrac{\partial}{\partial x}f(x,y)\,dy
$$
Proof:
We first define ## g(t) = \exp(-t^2) ## and show ## I:= \int_\mathbb{R} g(x)\,dx = \sqrt{\pi} \,. ##
\begin{align*}
I^2&=\left(\int_\mathbb{R}g(x)\,dx \right)\cdot \left(\int_\mathbb{R}g(y)\,dy \right)\\
&=\int_\mathbb{R}\int_\mathbb{R}g(x)g(y)\,dx\,dy\\
&=\int_\mathbb{R}\int_\mathbb{R}\exp(-x^2-y^2)\\
&=\int_0^{\infty}\int_0^{2\pi}r\exp(-r^2)\,d\varphi \,dr\\
&=2\pi \int_0^\infty r\exp(-r^2)dr\\
&=-\pi\left[\exp(-r^2) \right]_0^\infty\\
&=\pi
\end{align*}
The function ##h(x,y)=x\cdot g(xy)## is continuous, however the parameter integral ##H(x)=\int_\mathbb{R}h(x,y)\,dy## is not:
\begin{align*}
H(x)&=\int_\mathbb{R}x\cdot g(xy)\,dy\\
&=\operatorname{sgn}(x) \int_\mathbb{R}|x|\cdot g(xy)\,dy\\
&=\operatorname{sgn}(x) \int_\mathbb{R} g(t)\,dt \\
&=\operatorname{sgn}(x)\cdot \sqrt{\pi}
\end{align*}
Now let ##f\, : \,\mathbb{R}\times \mathbb{R} \longrightarrow \mathbb{R}## the continuously differentiable function ##f(x,y)=x|x|g(xy)## such that we for ##F(x)=\int_\mathbb{R}f(x,y)\,dy##
\begin{align*}
F(x)&=\int_\mathbb{R}x|x|g(xy)\,dy\\
&= x \int_\mathbb{R}|x|g(xy)\,dy\\
&=x \int_\mathbb{R}g(t)dt\\
&=x\sqrt{\pi}\quad\quad \text{ and }\\
F\,'(x)&=\sqrt{\pi}
\end{align*}
Differentiation under the integral gives us
$$
\int_\mathbb{R}\dfrac{\partial}{\partial x}f(x,y)\,dy=\int_\mathbb{R}\left(2|x|g(xy)+x|x|\dfrac{d}{dx}g(xy) \right)\,dy
$$
which vanishes at ##x=0\,.## For ##x\neq 0## we get
\begin{align*}
\int_\mathbb{R}\dfrac{\partial}{\partial x}f(x,y)\,dy&=2\int_\mathbb{R}g(t)\,dt - 2\int_\mathbb{R}t^2g(t)\,dt\\
&= 2\sqrt{\pi}-2\left(\left[-\dfrac{t}{2}\exp(-t^2)\right]_{-\infty}^{\infty} + \dfrac{1}{2}\int_\mathbb{R}g(t)\,dt \right)\\
&=\sqrt{\pi}
\end{align*}
In the end we have
$$
\sqrt{\pi}=\left.\dfrac{d}{dx}\right|_{x=0} F(x)=\left.\dfrac{d}{dx}\right|_{x=0}\int_\mathbb{R}f(x,y)\,dy \neq \int_\mathbb{R}\left.\dfrac{\partial}{\partial x}\right|_{x=0}f(x,y)\,dy =0
$$
and although both sides are identical for ##x\neq 0## they differ at ##x=0## and thus cannot be the same.
 
  • Like
Likes   Reactions: Delta2
Well this is interesting, it seems that ##\int_{\mathbb{R}}|x|g(xy)=\int_{\mathbb{R}}xg(xy)=\sqrt\pi## or where am I wrong in the last equality? Where post #9 goes wrong?

quote from post #9

Then ##\int_{\mathbb{R}} f(x,y)dy=\int xg(xy)dy##, integration by substitution ##t=xy\Rightarrow dt=xdy## so we get that (for ##x\neq 0##)
##\int_{\mathbb{R}} f(x,y)dy=\int xg(xy)dy=\int g(t)dt=\sqrt\pi##
 
The point is that we only have ##y## in ##g(xy)## as variable. This alone determines the sign of ##xy##. Therefore, ##x## is treated as a positive constant here, because in ## t \longmapsto g(t) = \exp(-t^2)## we have ##g(c\cdot t)= \exp(-c^2t^2)## and the constant factor at our variable has to be positive in ##\dfrac{d}{dy}(xy)=|x|\cdot 1\,.##
 
Delta2 said:
Well this is interesting, it seems that ##\int_{\mathbb{R}}|x|g(xy)=\int_{\mathbb{R}}xg(xy)=\sqrt\pi## or where am I wrong in the last equality? Where post #9 goes wrong?

quote from post #9

This is just another function than mine was. And you get a quotient at the end: ##\dfrac{1}{x}\text{ or }\dfrac{|x|}{x}## which my solution avoids.
 
I am not sure...

But can you tell me where the integration by substitution goes wrong at post #9. I used ##t=xy## and ended up with ##\int_R xg(xy)dy=\int_R g(t)dt=\sqrt\pi###...

Apparently there is a subtle mistake here, I ll try to understand it, thanks

OK I found where the mistake is. If ##x<0## and ##t=xy## then for ##y=-\infty## it is ##t=+\infty## and vice versa, so for ##x<0## it is ##\int_{-\infty}^{+\infty}xg(xy)dy=\int_{+\infty}^{-\infty}g(t) dt=-\sqrt\pi##
 
Last edited: