I want to find the moment generating function of the following pdf to verify that $\mu=\frac{3}{2}$.
$f(x) = \begin{cases} -2e^{-2x}+2e^{-x} &: 0 <x\\ 0 &: \text{else} \end{cases}$
So far this is what I have done:
$M_{X}(t)=E\left(e^{tX}\right)\int^{\infty}_{0} e^{tx}f(x) dx=\int^{\infty}_{0}e^{tx}\left(−2e^{-2x}+2e^{-x}\right)dx=\int^{\infty}_{0}-2e^{tx-2x}+2e^{tx-x}dx$
but after this is I don't know where to take the integral. Any help would be much appreciated.
Fix $t<1$. Then compute
\begin{align*} M_{X}(t) := \mathbb{E} \left [e^{tX} \right] &= \int_{0}^{\infty} e^{tx}(2e^{-x}-2e^{-2x})\, dx \\ &= \frac{2}{t-1}e^{x(t-1)} - \frac{2}{t-2}e^{x(t-2)} \bigg |_{x=0}^{x=\infty} \\ &= \lim\limits_{x \rightarrow \infty} \left (\frac{2}{t-1}e^{x(t-1)} - \frac{2}{t-2}e^{x(t-2)} \right ) \\ &\quad - \left (\frac{2}{t-1}e^{x(t-1)} - \frac{2}{t-2}e^{x(t-2)} \right ) \bigg |_{x=0} \\ &= \frac{2}{t-2} - \frac{2}{t-1} \end{align*}
Then the mean is given by $\mu = M_{X}'(0) = -\frac{2}{(t-2)^{2}} + \frac{2}{(t-1)^{2}} \bigg |_{t=0} = -\frac{1}{2} + 2 = \frac{3}{2}$ as desired.