I want to solve the following PDE:$$ \begin{cases} u_{t}-c^2u_{xx}=0, \quad 0<x<l,\ t> 0\\ u_x(0,t)+u(0,t)=0=u_x(l,t)+u(l,t) \quad t\geq 0 \\ u(x,0)=f(x), \quad x\in\mathbb{R} \end{cases} $$ Thanks for your help.
my approach:
Separate variables in the heat equation by putting $u(x,t)=X(x)T(t)$ to obtain $$ \begin{cases}T'(t)+ac^2T(t)=0\\ X''(x)+aX(x)=0\\ X'(0)+X(0)=X'(l)+X(l)=0\end{cases} $$ Consider cases on $a$ for $X$
Case 1. $a=0$ this case has only the trivial solution.
Case 2. $a<0$ this case has solution for $a=-1$, $X(x)=\mathbf{e}^{-x}$.
Case 3. $a>0$ this case has solution for $a={(\frac{n\pi}{l})}^2$, $X_n(x)=\sin(\frac{n\pi x}{l})-\frac{n\pi }{l}\cos(\frac{n\pi x}{l})$.
Now for $T$
Case 1. $a=-1$ then $T=\mathbf{e}^{c^2t}$
Case 2. $a={(\frac{n\pi}{l})}^2$ then $T_n =\mathbf{e}^{(\frac{nc\pi}{l})^2t}$
Now $u(x,t)=\frac{a_0}{2}\mathbf{e}^{-x}\mathbf{e}^{c^2t}+\sum_{n=1}^{\infty}{a_{n}}{\mathbf{e}^{(\frac{nc\pi}{l})^2t}}(\sin(\frac{n\pi x}{l})-\frac{n\pi }{l}\cos(\frac{n\pi x}{l}))$
And $f(x)=u(x,0)=\frac{a_0}{2}\mathbf{e}^{-x}+\sum_{n=1}^{\infty}{a_{n}}{(\sin(\frac{n\pi x}{l})-\frac{n\pi }{l}\cos(\frac{n\pi x}{l}))}$
what can I do now?
Now you have a Fourier series for $f(x)$, though it's not so obvious. For simplicity, let's say you have $$ f(x) = \frac{a_0}{2} e^{-x} + \sum_{n=1}^\infty a_n X_n(x), $$ where the $X_n(x)$ are your $$ X_n(x) = \sin\left(\frac{n\pi x}{l}\right) - \frac{n\pi}{l}\cos\left(\frac{n\pi x}{l}\right). $$ Then $$ \int_0^l X_n(x) X_m(x) ~\mathrm{d}x= 0 $$ if $n\neq m$. And $$\int_0^l (X_n(x))^2~ \mathrm{d}x = \frac12(l + n^2 \pi^2/l),$$ so the eigenfunctions are orthogonal and may be normalized. We also have $$ \int_0^l X_n(x) e^{-x} ~\mathrm{d}x = 0, $$ so $e^{-x}$ is also orthogonal to our eigenfunctions $X_n(x)$. So multiply both sides of the Fourier series for $f(x)$ by $X_m(x)$ and (formally exchanging the sum and integral) use Orthogonality to keep only the $m$ term to find $$ \int_0^l f(x) X_m(x)~\mathrm{d}x = \frac{a_m}{2}(l + m^2 \pi^2/l), $$ this defines your $a_m$. To get your $a_0$ multiply both sides by $e^{-x}$ and integrate from $0$ to $l$ (formally exchanging sum and integral and using orthogonality) to find $$ \int_0^l f(x) e^{-x} ~\mathrm{d}x = \frac{a_0}2 \int_0^l e^{-2x}~\mathrm{d}x = \frac{a_0}{2} e^{-l}\sinh(l), $$ which now defines your $a_0$.