Heat conduction in a thin circular ring (consider it as a rod, bent in the shape of a circular ring joining the two ends) of length $2L$, labeled $-L$ to $L$ leads to the equation $u_t = c^2 u_{xx}$, $-L < x < L$, $t>0$, $c>0$ with the initial condition $u(x,0) = f(x)$ and the periodic boundary conditions \begin{align} u(-L,t) &= u(L,t)\\ u_{x}(-L,t) & = u_{x}(L,t) \hspace{0.5cm} t>0 \end{align}
Find the solution to this initial boundary value problem.
I'm trying to solve this initial condition problem. I solved the general case when the problem is \begin{align} u_t &= c^2 u_{xx} \hspace{0.5cm} 0 < x<L, \hspace{0.5cm} t>0, \hspace{0.5cm} c>0\\ u(x,0) &= f(x) \hspace{0.5cm} 0 \leq x \leq L \\ u_{x}(0,t) &= u_{x}(L,t) = 0 \hspace{0.5cm} t \geq 0 \end{align} The conditions $u_{x}(0,t) = 0$, $u_{x}(L,t)=0$ are known as Neumann's conditions. I solved the problem with Neumann conditions by separation of variables and obtained that
$$u(x,t) = \frac{a_0}{2} + \sum_{n=1}^{\infty}{a_{n}\cos{\left(\frac{n \pi x}{L}\right)} e^{-\frac{n^{2}\pi^{2}c^2}{L^2}t}}$$
where $$ a_n = \frac{2}{L}\int_{0}^{L}{f(x) \cos\left(\frac{n \pi x}{L}\right)dx}, \hspace{0.5cm} n\geq 0$$ However, the problem in my statement is very different from this problem that I solved. I don't know how to use this result in that problem, or maybe it should be done through variable separation, or using a different method, but I'm not sure about that. I have really spent a lot of time on this problem but I have not been able to achieve anything successful. For this reason I would appreciate any help you can give me.
An attempt:
By separation of variables, let $u(x, t) = X (x) T (t)$. Then $u_t = XT'$and $u_{xx} = X''T$. Substituting in the original equation we have $$XT' = c^2 X''T \Rightarrow \frac{T'}{c^2 T} = \frac{X''}{X} = - \lambda \hspace{0.4cm} \text{where} \hspace{0.4cm} \lambda \in \mathbb{R}$$ so we have the ordinary differential equation $X'' + \lambda X = 0$. The boundary conditions give:
\begin{align} u(L,t) &= u(-L,t) = X(L)T(t) = X(-L)T(t) \Rightarrow X(L) = X(-L)\\ u_{x}(L,t) &= u_{x}(-L,t) = X'(L)T(t) = X'(-L)T(t) \Rightarrow X'(L) = X'(-L) \end{align}
We have the problem:
\begin{cases} X'' + \lambda X = 0\\ X(L) = X(-L) \hspace{0.8cm} (1)\\ X'(L) = X'(-L) \hspace{0.5cm} (2) \end{cases}
Now if $\lambda > 0$, let's say $\lambda = k^2$ with $k> 0$, then $$X'' + k^2 X = 0 \Rightarrow X(x) = a \cos(kx) + b \sin(kx)$$
Now, I need to use conditions (1) and (2) to find the numbers $a$ and $b$, but since these conditions are not homogeneous or are not an explicit function, then I have had a hard time continuing. How can I solve this?