2

I have the following problem which I am struggling to solve. I have the solution, but I think I am using the formula wrong. Any help would be really appreciated, thanks a lot in advance!

QUESTION: Show $\mathbb{E}Xf(X)=m\mathbb{E}f(X)+\sigma^2\mathbb{E}f'(X)$, for any function $f$, where $X$ is a Gaussian random variable with distribution $N(m,\sigma^2)$.

SOLUTION GIVEN BY PROFESSOR $$\mathbb{E}Xf(X)=\frac{1}{\sqrt{2\pi\sigma^2}}\int_{-\infty}^{\infty}(x-m)f(x)e^{-\frac{(x-m)^2}{2\sigma^2}}dx+\frac{m}{\sqrt{2\pi\sigma^2}}\int_{-\infty}^{\infty}f(x)e^{-\frac{(x-m)^2}{2\sigma^2}}dx$$ $$=-\frac{\sigma^2}{\sqrt{2\pi\sigma^2}}\int_{-\infty}^{\infty}f(x)\frac{d}{dx}e^{-\frac{(x-m)^2}{2\sigma^2}}dx+m\mathbb{E}f(X)$$ $$=\sigma^2\mathbb{E}f'(X)+m\mathbb{E}f(X)$$

WHAT I DON'T UNDERSTAND

As far as I know, the probability density function of $X$ is $p(x)=\frac{1}{\sqrt{2\pi\sigma^2}}e^{-\frac{(x-m)^2}{2\sigma^2}}$, and $$\mathbb{E}X=\int_{-\infty}^{\infty} x p(x)dx$$

So then I assume we would have

$$\mathbb{E}Xf(X)=\int_{-\infty}^{\infty} x f(x) \frac{1}{\sqrt{2\pi\sigma^2}}e^{-\frac{(x-m)^2}{2\sigma^2}} dx$$

If that is correct, how does my professor do the integration by parts? Because if we use $u=x$, $du=dx$, $dv=e^{-\frac{(x-m)^2}{2\sigma^2}}$, I cannot really obtain anything sensible. And if I use $u=e^{-\frac{(x-m)^2}{2\sigma^2}}$, $du=\frac{(m-x)e^{-\frac{(x-m)^2}{2\sigma^2}}}{\sigma^2}$, $dv=x dx$ and $v=x^2$, I still cannot get anything sensible.

s1047857
  • 891
  • 3
    Use $$du=(x-m)e^{-(x-m)^2/(2\sigma^2)}\qquad v=f(x).$$ – Did Jul 12 '15 at 13:46
  • Thanks! So that means

    $$du=(x-m)e^{-\frac{(x-m)^2}{2\sigma^2}},\quad u=-\sigma^2 e^{-\frac{(x-m)^2}{2\sigma^2}}$$ and $v=f(x)$, but what about $dv$? I'm not quite sure how to deal with $f(x)$ to get $$\frac{1}{\sqrt{2\pi\sigma^2}}\int_{-\infty}^{\infty}(x-m)f(x)e^{-\frac{(x-m)^2}{2\sigma^2}}dx+\frac{m}{\sqrt{2\pi\sigma^2}}\int_{-\infty}^{\infty}f(x)e^{-\frac{(x-m)^2}{2\sigma^2}}dx$$ from $$\int_{-\infty}^{\infty} x f(x) \frac{1}{\sqrt{2\pi\sigma^2}}e^{-\frac{(x-m)^2}{2\sigma^2}} dx$$

    – s1047857 Jul 12 '15 at 15:43
  • 1
    Use $$x=(x-m)+m.$$ – Did Jul 12 '15 at 15:52
  • Sorry, but this is just confusing me even more. Use it where? I cannot see how that can be used in any way to differentiate $f(x)$ as suggested in your previous comment :/ – s1047857 Jul 12 '15 at 16:36
  • Well, this shows that $$\frac{1}{\sqrt{2\pi\sigma^2}}\int_{-\infty}^{\infty}xf(x)e^{-(x-m)^2/(2\sigma^2)}dx$$ is $$\frac{1}{\sqrt{2\pi\sigma^2}}\int_{-\infty}^{\infty}(x-m)f(x)e^{-(x-m)^2/(2\sigma^2)}dx+\frac{m}{\sqrt{2\pi\sigma^2}}\int_{-\infty}^{\infty}f(x)e^{-(x-m)^2/(2\sigma^2)}dx$$ – Did Jul 12 '15 at 16:39
  • Oh sh*t, I get it now... Sorry, I think I have been revising for too long. My lecturer also put the note saying that we have to use integration by parts between the first and second result so that confused me even more. I should probably take a break... :/ – s1047857 Jul 12 '15 at 17:00

0 Answers0