Integral of periodic function over the length of the period is the same everywhere
Let $H(x)=\int_x^{x+a}f(t)\,dt$. Then $$\frac{dH}{dx}=f(x+a)-f(x)=0.$$ It follows that $H(x)$ is constant. In particular, $H(b)=H(0)$.
We have $$ \int_{0}^{a}f(t)\ dt+\int_{a}^{a+b}f(x)\ dx=\int_{0}^{b}f(y)\ dy+\int_{b}^{a+b}f(t)\ dt, $$ and setting $x=y-a$ turns the second integral into the third one.
No differentiation is needed:
Pick the unique integer $n$ such that $b\leqslant na\lt b+a$, decompose the integral of $f(t)$ over $t$ from $b$ to $b+a$ into the sum of the integrals from $b$ to $na$ and from $na$ to $b+a$, apply the changes of variable $t=x+(n-1)a$ in the former and $t=x+na$ in the latter, then the periodicity of $f$ implies that $f(x)=f(t)$, hence the result is the sum of the integrals of $f(x)$ over $x$ from $b-(n-1)a$ to $a$ and from $0$ to $b-(n-1)a$...
...Et voilà !