How do I find the moment generating function?

42 Views Asked by At

How do I find the mgf for the function $f(x)=\frac{1}{4}(1+x)$ when $0<x<2$? I do know I have to use integration but I'm not sure about how to do the calculation, or if I need to use integration by parts.

1

There are 1 best solutions below

9
On

To help you get started

$$\mathbb{E}[\exp(tX)] = \int_{0}^2 \exp(tx) f(x) dx= \int_0^2 \exp(tx) \frac14 (1+x)dx$$

Integration by parts might help.

Edit: \begin{align} &\int_0^2 \exp(tx) \frac14 (1+x)dx \\ &= \frac14 \int_0^2 \exp(tx) (1+x)dx \\ &=\frac14 \left( \frac{\exp(tx)}{t}(1+x)|_{x=0}^{x=2} - \frac1t\int_0^2 \exp(tx) dx\right) \\ &= \frac14 \left( \frac{3\exp(2t)-1}{t} -\frac{1}{t^2} \exp(tx)|_{x=0}^{x=2}\right)\\ &= \frac14 \left( \frac{3\exp(2t)-1}{t} -\frac{\exp(2t)-1}{t^2} \right)\\ \end{align}