Can someone explain how I can arrive at this solution? The book says to take the integral of g(X)f(x) evaluated from negative to positive infinity, but it gives no way to do it if F(x) is defined at more than a single place. The solution should be -11/6

If the probability density of X is given by

F(x) X/2 for 0<x<=1

1/2 for 1<x<=2

(3-x)/2 for 2<x<3

0 elsewhere

find the expected value of g(X)=X^2-5X+3