Related to the question : Eigenvalues of the circle over the Laplacian operator, how could I get an explicit formula for the differential equation $g''=\lambda g$ with $g$ a $2 \pi$-periodic function. As $g$ is periodic, I think I could define it as a Fourier series $g(x) = \frac{a_0}{2}+\sum_{n \geq 1} a_1 \cos(nx)+b_1 \sin (nx)$.
I know that normally a differential equation $y'' - \lambda y=0$, with $\lambda \geq 0$, as a explicit function of the form $y(x)=c_1 e^{\sqrt{\lambda}x} + c_2 e^{-\sqrt{\lambda}x}$. However, this can't be the case since $g$ is periodic.
Is anyone could help me to find $g$ explicitly?
Your proposed approach is fine: plug in $g$ into both sides of your equation and you will get $$g'' = \sum_{n\geq 1} -a_n n^2 \cos(nx) - b_n n^2 \sin(nx)$$ $$\lambda g = \frac{\lambda a_0}{2} + \sum_{n\geq 1} a_n \lambda \cos(nx) + b_n \lambda \sin(nx).$$
There is something special and fortuitous about the basis you have chosen for $g$: compute \begin{align*} \int_0^{2\pi} \cos(nx)^2\,dx &\quad \int_0^{2\pi} \cos(nx)\cos(mx)\,dx\\ \int_0^{2\pi} \sin(nx)^2\,dx &\quad \int_0^{2\pi} \sin(nx)\sin(mx)\,dx\\ \int_0^{2\pi} \cos(nx)\sin(nx)\,dx &\quad \int_0^{2\pi} \cos(nx)\sin(mx)\,dx \end{align*} for $n\neq m$. What do you notice?
Now compute $$\int_0^{2\pi} g''\cos(kx)\,dx \quad \textrm{and} \quad \int_0^{2\pi} \lambda g\cos(kx)\,dx$$ for an integer $k$. What can you conclude about the possible values for $a_k$? Now do the same for $b_k$ using sines.