(a)

fX(x)={121x<0122x<30otherwise

(b)

First find expectation of X:

E[X]=xf(x)dx1012xdx+2312xdx14x2|10+14x2|23014+14(94)1

To use the variance formula Var[X]=E[X2]E[X]2, we also need to find E[X2]. For this we use g(X)=X2 and the formula for E[g(X)]:

E[X2]=+x2f(x)dx1012x2dx+2312x2dx16x3|10+16x3|23(016(1)3)+(16(3)316(2)3)16+196206

Therefore:

Var[X]=E[X2]E[X]2206(1)273