I am currently looking through some proofs in functional data analysis. Statements closely related to the following are used quite regularly in many of those proofs:
$$ E \left[ \int x(t) d t \right] = \int E \left[ x(t) \right] d t $$
where $x$ is some random function in $L^2[0,1]$, usually with $E[x] = 0$ and $E[x^4] < \infty$.
Is this an equality that holds generally? If not, under what conditions does it hold? It would be great if you could give me a brief proof or a reference to further reading on this topic, as I can't really find anything so far.
Thanks a lot!