[Math] Moment generating function of the absolute value of a continuous random variable

probability

Let $X$ be a continuous random variable with the density $$f_X(x)=\begin{cases}\frac{1}{2}e^x \quad \text{if } x<0\\e^{-2x} \quad \text{if } x>0\end{cases}$$
What are the moment generating functions of $X$ and $|X|$? In what range is each moment generating function defined?

Best Answer

To complement the usual approach, note that $X=UY$ where $U$ and $Y$ are independent, $Y$ is a standard exponential random variable and $\mathbb P(U=\frac12)=\mathbb P(U=-1)=\frac12$.

This yields readily the moment generating functions. For example, conditioning on $U$, $$ M_X(t)=\mathbb E(\mathrm e^{tX})=\mathbb E(\mathbb E(\mathrm e^{tX}\mid U))=\mathbb E(M_Y(tU)). $$ Since $M_Y(t)=1/(1-t)$ for every $t\lt1$, this yields, for every $-1\lt t\lt2$, $$ M_X(t)=\mathbb E\left(\frac1{1-tU}\right)=\frac12\frac1{1-\frac12t}+\frac12\frac1{1+t}. $$ Likewise, for every $t\lt1$, $$ M_{|X|}(t)=\mathbb E(\mathrm e^{t|X|})=\mathbb E\left(\frac1{1-t|U|}\right)=\frac12\frac1{1-\frac12t}+\frac12\frac1{1-t}. $$