# How to find the moment generating function of this distribution

If $f(x) = 0.5 e^{-|x|}$ for $-\infty < x < \infty$, how would you find the moment generating function for this? Also how would you find the distribution of $Y = |X|$?

Attempt:

$$E(e^{tX}) = \int_{-\infty}^\infty f(x) e^{tx} \; dx.$$

-
Hint: continue your attempt, separating the integral into an integral on $x\lt0$, where $f(x)=\frac12\mathrm e^x$, and an integral on $x\gt0$, where $f(x)=\frac12\mathrm e^{-x}$. – Did Feb 28 '12 at 13:52
I get (1/(t-1))*(e^infinity -1) when x is positive. I am not sure what I am doing wrong. – lord12 Feb 28 '12 at 14:11
The pdf doesn't integrate to one. I think there is a .5 in the exponential term. – Stuck_pls_help Feb 28 '12 at 15:01

As Didier Piau stated: \begin{align} E(e^{tX}) & = \int_{-\infty}^\infty f(x) e^{tx} \ dx=\int_{-\infty}^0 f(x) e^{tx}\ dx+\int_0^\infty f(x) e^{tx}\ dx \\ \\ & =\int_{-\infty}^0 0.5e^x e^{tx}\ dx + \int_0^\infty 0.5 e^{-x} e^{tx}\ dx \\ \\ & = 0.5\left(\int_{-\infty}^0 e^{(t+1)x}\ dx+\int_{0}^\infty e^{(t-1)x} \ dx\right) = \frac{0.5}{t+1}-\frac{0.5}{t-1},\quad t\in (-1,1) \end{align}
For the distribution of $Y=|X|$ we have the general rule for a transformation of the form $y=h(x)$ in our case $Y=|X|$ with $Y\in [0,+\infty)$: $g(y)=f(h^{-1}(y))|\frac{d(h^{-1}(y))}{dy}|$. Applying this rule to your problem will give you the distribution of Y.
One can simplify $E(\mathrm e^{tX})$ to $1/(1-t^2)$. – Did Feb 28 '12 at 15:53