The expected value is the ratio of A / B
where A = ∫ x exp(-x/2) dx limits 0 to ∞
and B = ∫ exp(-x/2) dx limits 0 to ∞
The antiderivative for B is easy: -2 exp(-x/2)
Using integration by parts, the antiderivative for A is: - 2 x exp(-x/2) - 4 exp(-x/2)
This leads to A/ B = 4/2 = 2