f(x)
=(2/π) (cosx)^2 ; -π/2≤x≤π/2
=0 ; elsewhere
E(X)=(2/π)∫(-π/2-> π/2) x(cosx)^2 dx =0
E(X^2)
=(2/π)∫(-π/2-> π/2) x^2.(cosx)^2 dx
=(4/π)∫(0-> π/2) x^2.(cosx)^2 dx
=(2/π)∫(0-> π/2) x^2.(1+ cos2x) dx
=(2/π) [ (1/3)x^3]|(0-> π/2) + (2/π)∫(0-> π/2) x^2. cos2x dx
=(1/12)π^2 +(1/π)∫(0-> π/2) x^2 dsin2x
=(1/12)π^2 +(1/π)[ x^2.sin2x]|(0-> π/2) -(2/π)∫(0-> π/2) xsin2x dx
=(1/12)π^2 +0 +(1/π)∫(0-> π/2) xdcos2x
=(1/12)π^2 +0 +(1/π)[ x.cos2x]|(0-> π/2) -(1/π)∫(0-> π/2) cos2x dx
=(1/12)π^2 - 1/2 - [1/(2π)] [sin2x]|(0-> π/2)
=(1/12)π^2 - 1/2
D(X)
=E(X^2) -[E(X)]^2
=(1/12)π^2 - 1/2