TITLE: Integral of periodic function over the length of the period is the same everywhere
QUESTION [37 upvotes]: I am stuck on a question that involves the intergral of a periodic function. The question is phrased as follows:

Definition. A function is periodic with period $a$ if $f(x)=f(x+a)$ for all $x$.
Question.
If $f$ is continuous and periodic with period $a$, then show that $$\int_{0}^{a}f(t)dt=\int_{b}^{b+a}f(t)dt$$
for all $b\in \mathbb{R}$.

I understand the equality, but I am having trouble showing that it is true for all $b$. I've tried writing it in different forms such as $F(a)=F(b+a)-F(b)$. This led me to the following, though I am not sure how this shows the equality is true for all $b$,
$$\int_{0}^{a}f(t)dt-\int_{b}^{b+a}f(t)dt=0$$
$$=F(a)-F(0)-F(b+a)-F(b)$$
$$=(F(b+a)-F(a))-F(b)$$
$$=\int_{a}^{b+a}f(t)dt-\int_{0}^{b+a}f(t)dt=0$$
So, this leaves me with
$$\int_{a}^{b+a}f(t)dt-\int_{0}^{b+a}f(t)dt=\int_{0}^{a}f(t)dt-\int_{b}^{b+a}f(t)dt$$
I feel I am close, and I've made myself a diagram of a sine function to visualize what each of the above integrals might describe, but the power to explain the above equality evades me.

REPLY [7 votes]: $$\begin{align}
\int_{b}^{a+b}f(x)\ dx&= \int_{a}^{a+b}f(x)\ dx +\int_{b}^{a}f(x)\ dx\\&\overset{y=x-a}{=} \color{red}{\int_{0}^{a}f(y+a)\ dx} +\int_{b}^{a}f(x)\ dx\\&\overset{periodic}{=} \color{red}{\int_{0}^{b}f(y)\ dx} +\int_{b}^{a}f(x)\ dx\\&=\int_0^af(x)\ dx.
\end{align}$$