I tried splitting up an infinite integral into finite chunks, in the hope that it would help me calculate something. It didn't work, however I can't see where I am making the error. Here is an essential version of what I attempted. Is it legitimate to split up the integral like this?
I have a periodic function $f(x+nL)=f(x)$ where $n \in \mathbb{N}$. Consider the integral
$$ I=\int_{x=-\infty}^{x=+\infty} f(x) \text{d}x. $$
I split this up into chunks of length L as
$$ I = \sum_{n=-\infty}^{n=+\infty} \int_{x=nL}^{x=(n+1)L} f(x) \text{d}x. $$
Then I change the integration value to $y=x-nL$ such that
$$ I = \sum_{n=-\infty}^{n=+\infty} \int_{y=0}^{y=L} f(y) \text{d}y. $$
However now I notice that I have a divergent sum, so I think my assumption that I could split the integral up like this was wrong. Thoughts? Thank you.
You can split the integral under the assumption that it is convergent, indeed if the integral converge than from the defenition of improper integral:
$\int_{x=-\infty}^{x=+\infty} f(x) \text{d}x =\int_{x=-\infty}^{x=0} f(x) \text{d}x + \int_{x=0}^{x=+\infty} f(x) \text{d}x$
and now,
$\int_{x=0}^{x=+\infty} f(x) \text{d}x = \lim_{n \to \infty} \int_{x=0}^{x=nL} f(x) \text{d}x = \lim_{n \to \infty} \sum_{k=0}^{n-1}\int_{x=kL}^{x=(k+1)L} f(x) \text{d}x = \sum_{k=0}^{\infty}\int_{x=kL}^{x=(k+1)L} f(x) \text{d}x$
and in the exact same way we have
$\int_{x=-\infty}^{x=0} f(x) \text{d}x = \sum_{k=-\infty}^{-1}\int_{x=kL}^{x=(k+1)L} f(x) \text{d}x$
and thus
$\int_{x=-\infty}^{x=+\infty} f(x) \text{d}x =\int_{x=-\infty}^{x=0} f(x) \text{d}x + \int_{x=0}^{x=+\infty} f(x) \text{d}x = \sum_{k=0}^{\infty}\int_{x=kL}^{x=(k+1)L} f(x) \text{d}x + \sum_{k=-\infty}^{-1}\int_{x=kL}^{x=(k+1)L} f(x) \text{d}x = \sum_{k=-\infty}^{\infty}\int_{x=kL}^{x=(k+1)L} f(x) \text{d}x$
as we want.
notice that the sum doesn't have to diverge in the case that $f$ is periodic, as the ellements of the sum can be 0. it can happen for example with $f=0$.
Just as a side note, the only periodic functions such that that $\int_{x=-\infty}^{x=+\infty} f(x) \text{d}x$ converges are functions that are almost everywhere 0.