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

I came across a piecewise function which seems pretty basic, but I don't know how to find the moment-generating function. If $X$ has the pdf $f_X(x)=x$ for $0\leq x\leq 1$, $2-x$ for $1\leq x \leq 2$ and $0$ elsewhere, how do we find $M_X(t)$?

share|cite|improve this question

$f_X$ is defined piecewise, so you'll need to split the integral defining $M(t)$ up as follows $$\eqalign{M_X(t)&= \int_{-\infty}^\infty e^{tx} f_X(x)\,dx\cr &= \int_{-\infty}^0e^{tx} f_X(x)\,dx+\int_{0}^1 e^{tx} f_X(x)\,dx +\int_{1}^2 e^{tx} f_X(x)\,dx +\int_{2}^\infty e^{tx} f_X(x)\,dx\cr \cr &= 0+ \int_0^1 e^{tx} \cdot x\,dx+\int_1^2 e^{tx}\cdot(2-x) \,dx+0\cr &= \int_0^1x e^{tx} \,dx+\int_1^2 (2-x)e^{tx} \,dx. } $$

To evaluate the remaining intergrals, you may use integration by parts.

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.