Expectation is Lebesgue integration against a probability measure. Its power comes from limit theorems that allow one to pass from simple variables to general random variables.
Lebesgue expectation
The expectation is first defined for nonnegative variables, then by difference.
Definition. For \(X\ge0\), \(\mathbb E X=\int_\Omega X\,\mathrm{d}P\), possibly infinite. For general \(X\), the expectation exists if \(\mathbb E X^+\) and \(\mathbb E X^-\) are not both infinite; \(X\in L^1\) if \(\mathbb E|X|\lt\infty\).
Proposition. On \(L^1\), expectation is linear and monotone, and \[ |\mathbb EX|\le\mathbb E|X|. \] If \(X\ge0\) and \(\mathbb EX=0\), then \(X=0\) almost surely.
Proof. The corresponding facts hold for the Lebesgue integral. For the last claim, Markov's inequality gives \[ P(X>1/n)\le n\mathbb EX=0 \] for every \(n\); the event \(\{X>0\}\) is their countable union.
Theorem (Tonelli for random series). If \(X_n\ge0\), then \[ \mathbb E\sum_{n=1}^{\infty}X_n =\sum_{n=1}^{\infty}\mathbb EX_n, \] with \(+\infty\) allowed. If \(\sum_n\mathbb E|X_n|<\infty\), then \(\sum_nX_n\) converges absolutely almost surely and in \(L^1\), and \[ \mathbb E\sum_nX_n=\sum_n\mathbb EX_n. \]
Proof. Monotone convergence applied to partial sums proves the nonnegative identity. If \(\sum_n\mathbb E|X_n|<\infty\), then \[ \mathbb E\sum_n|X_n|<\infty, \] so \(\sum_n|X_n|<\infty\) almost surely. The tails satisfy \[ \mathbb E\left|\sum_{n>N}X_n\right| \le\sum_{n>N}\mathbb E|X_n|\longrightarrow0, \] giving \(L^1\) convergence and permitting expectation to pass to the limit.
Monotone and dominated convergence
Most expectation manipulations reduce to two convergence principles.
Theorem. If \(0\le X_n\uparrow X\), then \(\mathbb E X_n\uparrow\mathbb E X\). If \(X_n\to X\) almost surely and \(|X_n|\le Y\in L^1\), then \(\mathbb E X_n\to\mathbb E X\).
Proof. The first statement is monotone convergence. Under domination, \(|X|\le Y\) almost surely, so \(X\in L^1\). Fatou applied to \(Y+X_n\ge0\) gives \[ \mathbb EY+\mathbb EX \le\mathbb EY+\liminf_n\mathbb EX_n. \] Applied to \(Y-X_n\ge0\), it gives \[ \mathbb EY-\mathbb EX \le\mathbb EY-\limsup_n\mathbb EX_n. \] Hence \(\limsup\mathbb EX_n\le\mathbb EX\le\liminf\mathbb EX_n\), proving convergence. Applying the same argument to \(|X_n-X|\le2Y\) yields \(L^1\) convergence.
Tail integration
Nonnegative expectations can be recovered from tail probabilities.
Proposition. For \(X\ge0\), \[ \mathbb E X=\int_0^\infty P(X\gt t)\,\mathrm{d}t. \]
Proof. Since \(X(\omega)=\int_0^\infty 1_{\{t\lt X(\omega)\}}\,\mathrm{d}t\), Tonelli's theorem gives \(\mathbb E X=\int_0^\infty \mathbb E1_{\{X\gt t\}}\,\mathrm{d}t=\int_0^\infty P(X\gt t)\,\mathrm{d}t\).
Corollary (moments from tails). For \(p>0\), \[ \mathbb E|X|^p =p\int_0^\infty t^{p-1}P(|X|>t)\,\mathrm{d}t. \] More generally, for absolutely continuous increasing \(\phi\) with \(\phi(0)=0\), \[ \mathbb E\phi(X) =\int_0^\infty\phi'(t)P(X>t)\,\mathrm{d}t \] for nonnegative \(X\), whenever either side is defined.
Proof. Pointwise, \[ \phi(X)=\int_0^X\phi'(t)\,\mathrm{d}t =\int_0^\infty\phi'(t)\mathbf1_{\{X>t\}}\,\mathrm{d}t. \] Tonelli proves the general formula. Taking \(\phi(t)=t^p\) and replacing \(X\) by \(|X|\) gives the moment identity.
Example (tail order determines moment thresholds). If \[ P(|X|>t)\asymp t^{-\alpha} \qquad(t\to\infty), \] then the tail formula shows \[ \mathbb E|X|^p<\infty\quad\Longleftrightarrow\quad p<\alpha, \] up to behavior near zero. The borderline \(p=\alpha\) diverges logarithmically when the two-sided comparison holds.