EX=∫xf(x)dx x∈(-∞,+∞)
=∫x*xdx x∈(0,1)+∫x(2-x)dx x∈(1,2)
=x³/3|x∈(0,1)+(x²-x³/3)|x∈(1,2)
=1/3+(3-7/3)
=3-2
=1
EX²=∫x²f(x)dx x∈(-∞,+∞)
=∫x²*xdx x∈(0,1)+∫x²(2-x)dx x∈(1,2)
=x^4/4|x∈(0,1)+(2x³/3-x^4/4)|x∈(1,2)
=1/4+(14/3-15/4)
=14/3-7/2
=28/6-21/6
=7/6
DX=EX²-(EX)²
=7/6-1
=1/6