Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|cite|improve this question
up vote 1 down vote accepted

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}. $$

share|cite|improve this answer

Let $M:=M_X$ the moment generating function, and $f:=f_X$. By definition, for a $t\in\Bbb R$, $$M(t)=E\big(e^{tX}\big)=\int_{\Bbb R} e^{tx}\cdot f(x)dx = \int_{-\infty}^0 .. +\int_0^{+\infty}..$$ Can you continue?

For $|X|$, $$M_{|X|}(t)=E\big(e^{t|X|}\big)=\int_{\Bbb R}e^{t|x|}\cdot f(x)dx=... $$ and split it again for $x>0$ and $x<0$.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.