TITLE: Deriving Mean and Variance of Laplace Distribution
QUESTION [10 upvotes]: It has been a long time since I have used calculus, and I am trying to understand how the mean and variance of the Laplace distribution with pdf
$$f(x|\mu,\sigma) = \dfrac{1}{2 \sigma}\,e^{-\Large\frac{|x-\mu |}\sigma}$$ are derived.
I know that E$[X] = \mu$ and Var$[X] = 2\sigma^2$, but I don't understand how that happens. 
Many thanks.

REPLY [2 votes]: Standardizing the distribution will make the calculations much simpler.  Let $Y = (X - \mu)/\sigma$; then the PDF of $Y$ is $$f_Y(y) = f_X(\mu + \sigma y) \left| \frac{d}{dy}[\mu + \sigma y]\right| = \frac{1}{2}e^{-|y|}.$$  Hence $$\mathrm{E}[X] = \mathrm{E}[\mu + \sigma Y] = \mu + \sigma\mathrm{E}[Y].$$  But note that $$\int_{y=0}^\infty ye^{-y} \, dy = \Gamma(2) < \infty,$$ and $y f_Y(y)$ is an odd function, hence $\mathrm{E}[Y] = 0$ and $\mathrm{E}[X] = \mu$.
Similarly, the variance is best obtained through $Y$: it is a simple matter to compute the second moment of $Y$, since the integrand is an even function:  $$\mathrm{E}[Y^2] = \frac{1}{2} \int_{y=-\infty}^\infty y^2 e^{-|y|} \, dy = \int_{y=0}^\infty y^2 e^{-y} \, dy = \Gamma(3) = 2.$$  Consequently, $$\mathrm{Var}[X] = \mathrm{E}[(X - \mu)^2] = \sigma^2 \mathrm{E}[Y^2] = 2\sigma^2.$$