Doubts about linearity of definite integration. One of the first things about definite integration included in summaries is the linearity: $$\int_a^b (\alpha f + \beta g)(x) \, \textrm{d}x = \alpha \int_a^b f(x) \,\textrm{d}x + \beta \int_a^b g(x) \, \textrm{d}x. \,$$
Isn't this a bit clumsy since it puts the obvious problem of convergence in some complicated condition on $f$ and $g$?
For example the definite integral:
$$\int_0^1 f(x)\cot(\pi x)\textrm{d}x$$
diverges most of the time except if $f := B_n$ where $B_n$ is the n-th Bernoulli polynomial ($n>1$ and odd!).
If $n=3$ then $B_3(x)=x^3-\frac{3}{2}x^2-\frac{1}{2}x$. Define $f:=(x^3-\frac{3}{2}x^2)\cot(\pi x)$ and $g:=\frac{1}{2}x \cot(\pi x)$ then
$$\int_0^1 (f + g)(x) \, \textrm{d}x \neq \int_0^1 f(x) \,\textrm{d}x + \int_0^1 g(x) \, \textrm{d}x. \,$$ since the left side converges and the right side diverges!
Why is the linearity of definite integration so proudly displayed if it is so fragile?
 A: You could ask the same question about limits. "They teach us that the limit of the sum is the sum of the limits but
$$ \lim_{x \to \infty} (x + (-x)) = 0 \neq \lim_{x \to \infty} x + \lim_{x \to \infty} -x $$
since the right side diverges!"
But if the limits doesn't exist in the first place, you don't necessarily have additivity.
The function $\cot(\pi x)$ is unbounded on the interval $(0,1)$. This means that it is not Riemann integrable. If you consider $|\cot(\pi x)|$, on $(\epsilon, 1 - \epsilon)$, you can see that the integral over that interval goes to $\infty$ as $\epsilon \to 0$. So it is also not Lebesgue integrable. This is analogous to "the limit doesn't exist".
A: This is usually meant with the assumption that $f,g$ are both integrable over the interval.
A: This isn't specific to definite integrals. The fact that a subset of a linear space is a linear subspace on which a linear functional is defined that isn't defined on the whole space isn't in contrast with the fact that elements of the subspace can be expressed as linear combinations of elements outside the subspace.
For instance, you can consider the set of triples of real numbers with vanishing third component. This is a linear subspace of the set of triples of real numbers. You can define a linear functional on the subspace, e.g. the sum of the first two components, without defining it on the entire space of triples. You can write e.g. $(2,3,0)=(1,1,-1)+(1,2,1)$, so you've expressed a triple in the subspace, for which the functional is defined, as the sum of two triples outside the subspace, for which the functional isn't defined. There's nothing mysterious about that, and no contrast whatsoever to the fact that the set of triples with vanishing third component is a linear subspace and that the functional defined on that subspace is linear.
Your situation is exactly analogous. The integral from $0$ to $1$ is defined on a certain linear subspace of the space of all functions on $(0,1)$, and the fact that the integral is a linear functional on that subspace is not in contrast with the fact that you can write an integrable function as the sum of two non-integrable functions.
