Expected Value of a Sum Let $f(x) = |x-1|, 0 \leq x \leq 2$ be the probability density function of a random variable $X$.  Find $E(X^2+X)$.  
The book gives a different answer from what I got, and I have no idea why.  
$E(X) = \int_{0}^2x|x-1|dx = \int_0^1 x(1-x)dx + \int_1^2 x(x-1)dx = 1$, and similarly $E(X^2)= \int_0^2x^2|x-1|dx = \int_0^1x^2(1-x)dx + \int_1^2x^2(x-1)dx = 3/2$.
So, $E(X^2+X) = E(X^2) + E(X) = 3/2 + 1 = 5/2$ is what I got, but the answer in the book is given as $13/6$.  What am I doing wrong here?

Firstly, $E(X) = (1/2-1/3)+(8/3-1/3)+(1/2-2) = 1/6 + 14/6 - 9/6 = 1$. So this is right.
Now, $E(X^2) = (1/3-1/4)+(4-1/4)+(1/3-8/3) \\ = 1/12 + 45/12 -28/12 = 18/12 = 3/2.$
So this is also right...
We should check that the probability density function is normalised. 
So, $\int_{0}^{2} |x-1| dx = 2\cdot \int_{0}^{1} (1-x)\;  dx = 2\cdot(1(1-0) - 1/2(1-0))= 1$.
So you should get $\frac{5}{2}$.
