# A proof related to an expected value (revised)

But, I felt that I made some confusions, and I will ask the question in a more tidy form with details.

Suppose that $$X \sim N(0,c)$$. That is, $$X$$ is a random variable following the normal distribution with the zero-mean and variance $$c$$.

Let $$f(\cdot)$$ be a continuous function and $$h$$ is a constant.

Also, suppose that intervals $$(a_{i-1},a_i)$$ for $$i \in \{1,\ldots,n,n+1\}$$ divide the extended real line, $$\bar{\mathbb{R}}=(-\infty,\infty)$$.

(where $$a_0=-\infty$$ and $$a_{n+1}=\infty$$)

That is, $$\cup_{i=1}^{n+1}(a_{i-1},a_i)=(-\infty,\infty)\setminus\{a_1,\ldots,a_n\}.$$

Now, I am wondering how to derive the following equations:

$$\mathbb{E}[f(h\cdot X)\cdot X] = \sum \limits_{i=1}^{n+1} \int_{a_{i-1}/h}^{a_{i}/h}f(h\cdot x)\cdot x \cdot (\frac{1}{\sqrt{c}})\cdot \phi(\frac{x}{\sqrt{c}})\;\;dx \\ =\sqrt{c}\left[\sum \limits_{i=1}^{n+1}\int_{a_{i-1}/h}^{a_{i}/h} h\cdot f'(h\cdot x)\phi(\frac{x}{\sqrt{c}})\;\;dx-\sum \limits_{i=1}^{n} [f(a_i^-)-f(a_i^+)]\phi\left(\frac{a_i}{h\sqrt{c}}\right)\right].$$

where $$\phi(\cdot)$$ denotes the standard normal density function, $$f'(\cdot)$$ is the first derivative of $$f(\cdot)$$, $$f(a_i^-)=\lim \limits_{x\rightarrow a_i^-}f(x)$$, and $$f(a_i^+)=\lim \limits_{x\rightarrow a_i^+}f(x)$$.

I got an suggestion saying that the first equation is due to the law of the unconscious statistician.

Also, in the paper I am reading, there is a statement saying that "the second equation follows from integraion by parts and re-arrangement of terms."

But, I failed to derive that.

• It is indeed such a straightforward application of integration by parts that it would help us to see where you ran into trouble applying it. The integration by parts is, of course, performed term by term, so you can dispense with the complication of the summation.
– whuber
Oct 4, 2021 at 17:45

We have $$\mathbb E[h(X)]=\int_{-\infty}^\infty h(x) \frac{1}{\sqrt{2\pi}c^{1/2}}\exp\{-x^2/2c\}\,\text dx\\=\sum_{i=0}^n \int_{a_i}^{a_{i+1}} h(x) \frac{1}{\sqrt{2\pi}c^{1/2}}\exp\{-x^2/2c\}\,\text dx$$ by additivity of the integrals over disjoint intervals. And $$\int_{a_i}^{a_{i+1}} x h(x) \frac{1}{\sqrt{2\pi}c^{1/2}}\exp\{-x^2/2c\}\,\text dx=\int_{a_i}^{a_{i+1}} h(x) \frac{x}{\sqrt{2\pi}c}\exp\{-x^2/2c\}\,\text dx\\=\int_{a_i}^{a_{i+1}} h(x) \frac{-\text d}{\text dx}\Phi(x/c^{1/2})\,\text dx\qquad\qquad\qquad\\\qquad\qquad=\left[ -h(x) \Phi(x/c^{1/2})\right]_{a_i}^{a_{i+1}}+\int_{a_i}^{a_{i+1}} \frac{\text d}{\text dx}h(x)\Phi(x/c^{1/2})\,\text dx$$