I would like to solve the following boundary value problem: $$\frac{dy}{dx}+ay(x)=f(x),$$ such that $$y(0)=y(L),$$ i.e. $y(x)$ is periodic in $x$ with period $L$. Note that $a$ is a constant and $f(x)$ is a predetermined function which is also periodic with period $L$. For what values of $a$ does a solution exist and is the solution always unique?
Assume $$y(x)=\sum_{n=-\infty}^\infty y_n\exp(ik_n x),$$ $$f(x)=\sum_{n=-\infty}^\infty f_n\exp(ik_n x),$$ where $$k_n = 2\pi\frac{n}{L}.$$ Multiplying the ODE by $\exp(-ik_m x)$ and integrating from $0$ to $L$ gives, $$(ik_m+a)y_m = f_m,$$ $$\implies y_m = \frac{f_m}{ik_m + a},$$ assuming $ik_m + a \ne 0$. Can we conclude a unique solution exists iff $a\ne -ik_n \forall n$? What if $a=-ik_m$, what is the solution then? Is $y_m$ a free parameter?
Also, do you know how to calculate a solution using the integrating factor? Using an integrating factor gives $$y(x)=\exp(-ax)\int\exp(ax)f(x)dx,$$ what should the limits in the integral be to ensure the BCs are satisfied?