Finding the true expectation

I have the density function and I want to determine its expected value

f[x_] :=0.8000064000512005 (0.25/(1 - x)^3 + 0.5/(1 - x)^2) UnitStep[-x] + 0.8000064000512005 (0.25/(1 + x)^3 + 0.5/(1 + x)^2) UnitStep[x]

I used

Limit[NIntegrate[f[x]*x, {x, -y, y}], y -> Infinity]

which gives $0$

unlike

NIntegrate[f[x]*x, {x, -Infinity, Infinity}]

Then I used

z[x_] := ProbabilityDistribution[f[x], {x, -Infinity, Infinity}]
Mean[z[x]]

which was running and running..

What is the right way? what is the expected value w.r.t. the given density function?

f[x_] = 4/5 *
((1/(4 (1 - x)^3) + 1/(2 (1 - x)^2)) UnitStep[-x] + (1/(4 (1 + x)^3) +
1/(2 (1 + x)^2)) UnitStep[x])//FullSimplify;

f = f[1.] = Limit[f[x], x -> 1]

1/8

f[-1] = f[-1.] = Limit[f[x], x -> -1]

1/8

dist = ProbabilityDistribution[f[x], {x, -Infinity, Infinity}];

Plot[f[x], {x, -10, 10},
PlotRange -> {0, .625}] Verifying that the distribution integrates to one:

Integrate[f[x], {x, -Infinity, Infinity}]

1

Expectation[1, Distributed[x, dist]]

1

Since the distribution is symmetric about zero the mean is zero.

f[-x] == f[x]

True

Mean[dist]

0

Expectation[x, Distributed[x, dist]]

0

• Thx for the answer. – Seyhmus Güngören Jan 26 '15 at 16:57