Find the only periodic solution for $y'+y=b(x)$ with $b:\Bbb{R}\to\Bbb{R}$ has a period of $2T$ and is $1$ for $x (0,T)$ and $-1$ for $x (-T,0)$.
The ODE is easy to solve: $y(x) = \exp(-x)\cdot c+1$ and $y(x) = \exp(-x)\cdot c-1$. But how can I find the $c$ such that the solution is periodic with a period of $2T$?
The solution is:

Any ODE solution that deserves its name is continuous. So you need to establish continuity at $x=0$ and $y(-T)=y(T)$ to have a periodic solution. For the first you need $$ 1+c_+=-1+c_-\implies c_-=2+c_+ $$ and for the second condition $$ 1+c_+e^{-T}=-1+c_-e^T=-1+(2+c_+)e^T\implies c_+\sinh(T)=1-e^T $$ etc.