Linearity of integration (source code)

= Linearity of integration
{title2=$\int(af+bg)\,d\mu=a\int f\,d\mu+b\int g\,d\mu$}

For <integrable> <real-valued functions> $f,g$ on a <measure space> $(X,\mu)$ and fixed <real numbers> $a,b$, their <linear combination> $af+bg$ is <integrable>, and the <Lebesgue integral> satisfies
$$
\int_X(af+bg)\,d\mu=a\int_X f\,d\mu+b\int_X g\,d\mu.
$$
The same rule applies to any finite <summation>: $\int_X\sum_{j=1}^n a_jf_j\,d\mu=\sum_{j=1}^n a_j\int_X f_j\,d\mu$ for <integrable> <functions> $f_j$ and fixed <scalars> $a_j$. Finite signed values matter: <integrability> ensures all these <integrals> are finite, so no undefined $\infty-\infty$ occurs.

This is the <distributive property> of finite <summation> carried into <integration>: a fixed factor can be pulled out, and a finite sum can be integrated term by term. For <simple functions>, distribute the finite sums of value times <measure>; approximation extends additivity to nonnegative <measurable functions>, and splitting into a <positive part> and <negative part> gives the <integrable> signed case. See <18.102 Introduction to Functional Analysis, Spring 2021 (lecture notes) by Andrew Lin/Lecture 12: Lebesgue Integrable Functions, the Lebesgue Integral and the Dominated Convergence Theorem> (Proposition 122: linearity for integrable functions). For example, $\int_0^1(2x-3)\,dx=2\int_0^1x\,dx-3\int_0^1 1\,dx=-2$. With a <probability measure>, <linearity of integration> gives <linearity of expectation>.