# Interchanging integration and differentiation of normal distribution

In the book Statistical Inference by Casella & Berger, the authors gave an example of interchanging integration and differentiation of a random variable of exponential $$\lambda$$. This leads to a generalised relationship between $$(n+1)$$th moment and $$n$$th moment (as per 2.4.7). The authors then applied that recursive relation to a normal distribution (the second highlighted expression). Could you please explain to me how it was the case as shown in the last equality? Particularly, was $$\lambda$$ equivalent to $$\mu$$? If so, why did the $$\lambda^2$$ (in 2.4.7) disappear from the equality for normal distribution? Thank you.

• The authors expect you to emulate the steps of (2.4.6) to derive the result for the Normal distribution. – whuber Jan 16 at 0:13

I actually just wrote it out. So here goes:

Let

$$\frac{\partial}{\partial \mu} E(X^{n}) = \int \frac{\partial}{\partial \mu} \frac{1}{\sqrt{2\pi}} x^n e^{-(x-\mu)^2/2} dx$$,

then if I expand the square (in the exponent) to get $$\mu^2 - 2\mu x - x^2$$, I can factor out only the terms the involve $$\mu$$ and use those in the derivative. This gives,

$$\int \frac{x^n}{\sqrt{2\pi}} e^{-x^2/2} \frac{\partial}{\partial \mu} e^{- (\mu^2 - 2x\mu)/2 } dx$$

The next step is to apply the chain rule to the term $$\frac{\partial}{\partial \mu} e^{- (\mu^2 - 2x\mu)/2 }$$ to get this final equation:

$$\int \frac{x^n}{\sqrt{2\pi}} (\mu - x) e^{-(x-\mu)^2 } dx = \mu E(X^n) - E(X^{n+1})$$

Therefore we have the result that $$\frac{\partial}{\partial \mu} E(X^{n}) = \mu E(X^n) - E(X^{n+1})$$, which means $$E(X^{n+1}) = \mu E(X^n) - \frac{\partial}{\partial \mu} E(X^{n})$$

• Thanks for your detailed solution, M. Austin. Following the tips from @whuber, I also managed to derive the equality in question. In your answer, it should have been $e^{- (\mu^2 - 2x\mu)/2 }$ instead of $e^{- (\mu^2 - 2x\mu) }$, shouldn't it? – Nemo Jan 16 at 3:02
• yes, that is a typo...I will edit now. – M. Austin Jan 16 at 12:43