Let $f(x)$ be the probability density of a continous random variable $X$ defines as: \begin{equation} f(x) = \begin{cases} 2(1-x) & 0 < x < 1 \\ 0 & \text{otherwise} \end{cases} \end{equation} Prove that: $$E[X^r] = \frac{2}{(r+1)(r+2)}$$
My partial answer:
$$E[X^r] = 2\int\limits_0^1 x^r(1-x)dx = 2\int\limits_0^1 x^r-x^{r+1}dx=2\bigg[\frac{x^{r+1}}{r+1} - \frac{x^{r+2}}{r+2}\bigg]^1_0$$
This is where I am stuck. If I plug in 1, I get 0. If I plug in 0, I get 0. I do not know how the answer is gotten from this point. Any help would be appreciated. Thanks.
If you plug in $x = 1$ you get:
$$2\left[\frac{1}{r+1}-\frac{1}{r+2}\right]= 2\left[\frac{(r+2) - (r+1)}{(r+1)(r+2)}\right] = \frac{2}{(r+1)(r+2)}.$$
As required. Your answer is complete and correct!