# What is the moment generating function of the Laplace distribution?

Consider a random variable $$X$$ whose probability density function is given by $$f_{X}(x) = \frac{\lambda}{2}\exp(-\lambda|x-\mu|)\quad\text{for}\quad x\in\textbf{R}, \lambda > 0,\,\,\text{and}\,\,\mu\in\textbf{R}$$

Determine its moment generating function, $$\textbf{E}(X)$$ and $$\textbf{Var}(X)$$.

MY SOLUTION

According to the definition of moment generating function, we obtain the following result \begin{align*} M_{X}(t) & = \frac{\lambda}{2}\int_{-\infty}^{+\infty}e^{tx}\exp(-\lambda|x-\mu|)\mathrm{d}x = \frac{\lambda}{2}\int_{-\infty}^{+\infty}\exp(tx-\lambda|x-\mu|)\mathrm{d}x\\\\ & = \frac{\lambda}{2}\int_{-\infty}^{\mu}\exp(tx-\lambda(\mu -x))\mathrm{d}x + \frac{\lambda}{2}\int_{\mu}^{+\infty}\exp(tx-\lambda(x-\mu))\mathrm{d}x\\\\ & = \frac{\lambda}{2}\int_{-\infty}^{\mu}\exp((t+\lambda)x-\lambda\mu))\mathrm{d}x + \frac{\lambda}{2}\int_{\mu}^{+\infty}\exp((t-\lambda)x+\lambda\mu)\mathrm{d}x\\\\ \end{align*}

Then I get stuck. Could someone shed some light on the problem?

• You're almost there. You just need to integrate something the form $\exp(ax)\,dx$. – Jim Ferry Feb 5 at 22:03
• How can someone ensure the given integrals converge? I may be wrong, but this is why I got stuck. – user1337 Feb 5 at 22:08
• You'll want $t-\lambda > 0$ for the first integral and $t + \lambda < 0$ for the second. Uh oh, that doesn't leave you many values of $t$, does it? Looks like a sign error. Try going back and decomposing the absolute value cases more carefully. – Jim Ferry Feb 5 at 22:50
• Indeed you have written $|x-\mu|$ incorrectly over the split regions. Reinspect the signs. – Nap D. Lover Feb 6 at 0:14
• I have edited my answer in accordance to your comments. However, I have the same problem related to convergence. What am I doing wrong? – user1337 Feb 6 at 0:47

\begin{align} E\left[e^{tX}\right]&=\frac{\lambda}{2}\int_{\mathbb R}e^{tx}e^{-\lambda|x-\mu|}\,dx \\\\&=\frac{1}{2}\int_{\mathbb R}\exp\left[t\left(\mu+\frac{y}{\lambda}\right)-|y|\right]\,dy\qquad\qquad,\,\small\text{ substituting }\lambda(x-\mu)=y \\\\&=\frac{e^{\mu t}}{2}\int_{\mathbb R}e^{ty/\lambda-|y|}\,dy \\\\&=\frac{e^{\mu t}}{2}\left[\int_{-\infty}^0 e^{y(1+t/\lambda)}\,dy+\int_0^\infty e^{-y(1-t/\lambda)}\,dy\right] \\\\&=\frac{e^{\mu t}}{2}\left[\underbrace{\int_0^\infty e^{-z(1+t/\lambda)}\,dz}_{\text{ converges for }1+\frac{t}{\lambda}>0}+\underbrace{\int_0^\infty e^{-y(1-t/\lambda)}\,dy}_{\text{ converges for }1-\frac{t}{\lambda}>0}\right] \\\\&=\frac{e^{\mu t}}{2}\left[\frac{1}{1+\frac{t}{\lambda}}+\frac{1}{1-\frac{t}{\lambda}}\right]\qquad\qquad\qquad,\,|t|<\lambda \end{align}
So finally, $$\boxed{E\left[e^{tX}\right]=e^{\mu t}\left(1-\frac{t^2}{\lambda^2}\right)^{-1}}\qquad,\,|t|<\lambda$$