Hello,

So the pdf is |1-x| if x is between 0 & 2.

that's a formula you should know...

So

in order to compute this integral, split it into two integrals : one with the domain where 1-x is positive (and hence |1-x|=1-x), one with the domain where 1-x is negative (and hence |1-x|=-(1-x)=x-1)

Same thing :