Consider the random variable $T$ with cumulative distribution function $F(t)$. How can I calculate the mathematical expectation of an integral function? (Note that the time is finite horizon)
$Y=\int_{0}^{T}g(t)dt$, for instance, $$E\left[\int_{0}^{T}g(t)\text{d}t\right]=\int_{0}^{\infty}\int_{0}^{s}g(t)\text{d}tf(s)\text{d}s$$ or $\int_{0}^{E(T)}g(t)\text{d}t$
where $E[T]=\int_{0}^{\infty}tf(t)\text{d}t$. Which type calculation was right and why?
New Result:$E[Y]=E\left[\int_{0}^{T}g(t)\text{d}t\right]=\int_{0}^{\theta}\int_{0}^{s}g(t)dtf(s)ds $ After that we use Fubini theorem to change the order of integration;
$$=\int_{0}^{\theta}\int_{s}^{\theta}dF(t)g(t)dt=\int_{0}^{\theta}F(\theta)-F(t))g(t)dt=\int_{0}^{\theta}(1-F(t))g(t)dt $$
There still have a question, if time is infinite horizon with cumulative distribution function, the above function is not hold.
So my question is how to calculate the expectation when the time is infinite with cumulative distribution at a integration function?
$\int_{0}^{\infty}(1-F(t))g(t)dt=0$
If it is possible, could you recommend some martial-related it?
Thanks a lot.