Let $X_1,X_2$ be i.i.d $N(0,\sigma^2)$.
My tasks is to calculate the expected value of the function $T=|X_1-X_2|$.
Intuitively, I want to say that this value would equal the standard deviation, but I sort of doubt that this is the case because the standard deviation is the expected distance from the mean, and not just any observation... Any ideas?
As $X_1$ is independent of $X_2$, we directly have the distribution of $X_1-X_2$, namely
$$X_1-X_2\sim\mathcal N(0,2\sigma^2)$$
Define $$\phi(x)=\frac{1}{\sqrt{2\pi}}e^{-x^2/2}\quad,\,x\in\mathbb R$$ as the pdf of standard normal distribution.
Then,
\begin{align} E(|X_1-X_2|)&=\frac{1}{\sqrt{2}\sigma}\int_{\mathbb R} |x|\phi\left(\frac{x}{\sqrt{2}\sigma}\right)\,dx \\\\&=\sqrt{2}\sigma\int_{\mathbb R} |t|\phi(t)\,dt \qquad\qquad,\,\frac{x}{\sqrt{2}\sigma}=t \\\\&=2\sqrt{2}\sigma\int_0^\infty t\phi(t)\,dt \\\\&=-2\sqrt{2}\sigma \int_0^\infty\phi'(t)\,dt \\\\&=-2\sqrt{2}\sigma\lim_{A\to\infty}\left[\phi(t)\right]_{0}^{A} \\\\&=2\sqrt{2}\sigma\,\phi(0) \\\\&=\frac{2\sigma}{\sqrt{\pi}} \end{align}