If $X$ is a normal random variable with mean $\mu$ and variance $\sigma^2$, show that $$E(|X-\mu|) = \sqrt{\frac{2}{\pi}}\sigma.$$ Image.
I've tried converting to a standard random variable, integrating and dividing the integral but can't get to the required result.
Directly, $$\operatorname{E}[|X-\mu|] = \int_{x=-\infty}^\infty |x-\mu| \cdot \frac{e^{-(x-\mu)^2/(2\sigma^2)}}{\sqrt{2\pi} \sigma} \, dx.$$ Then observe that $$\frac{(x-\mu)^2}{2\sigma^2} = \left(\frac{x-\mu}{\sqrt{2}\sigma}\right)^2.$$ This suggests letting $y = \frac{x - \mu}{\sqrt{2} \sigma}$, and the integral becomes $$\frac{\sqrt{2}\sigma}{\sqrt{\pi}} \int_{y=-\infty}^\infty |y| e^{-y^2} \, dy.$$ The rest is left as an exercise.