I am trying to solve the following PDE using separation of variables: $$\begin{cases} u_{tt}=c^2u_{xx} & -l<x<l & t>0\\ u(-l, t)=u(l, t)=0 & t>0\\ u(x, 0)=\phi(x),\quad u_t(x, 0)=\psi(x) &-l<x<l \end{cases}$$
I supposed that there is a separated solution of the form $u(x, t)=X(x)T(t)$, and did the similar stuff, and got the eigen-problem: $$-X''=\lambda X \quad\quad X(-l)=X(l)=0$$ The general solution to the given ODE is $$X(x)=C_1\cos(\sqrt{\lambda}x)+C_2\sin(\sqrt{\lambda}x)$$ so applying the boundary conditions, we get $$\begin{cases} X(-l)=C_1\cos(\sqrt{\lambda}l)-C_2\sin(\sqrt{\lambda}l)=0\\ X(l)=C_1\cos(\sqrt{\lambda}l)+C_2\sin(\sqrt{\lambda}l)=0 \end{cases}$$ so that we must have $C_1\cos(\sqrt{\lambda}l)=C_2\sin(\sqrt{\lambda}l)=0$. This is where I think is weird. I usually encountered cases with Dirichlet boundary conditions for $[0, l]$, so there is only one type of eigen-pairs. But in this case, we get two types. If we pick $C_1=0$, we must have $\sin(\sqrt{\lambda}l)=0$, so in this case the eigen-pairs are given as $\lambda_n^{(1)}=(\frac{n\pi}{l})^2$, and $X_n^{(1)}=\sin(\frac{n\pi}{l}x)$ for $n=1, 2, 3\cdots$. If we choose $C_2=0$, we must have $\cos(\sqrt{\lambda}l)=0$, and in this case, the Eigen-pairs are given as $\lambda_n^{(2)}=(\frac{(n+1/2)\pi}{l})^2$, and $X_n^{(2)}=\cos(\frac{(n+1/2)\pi}{l}x)$ for $n=0, 1, 2\cdots$.
My question is so, do we pick one, or pick both eigen-pairs? Picking both eigen-pairs give $$u(x, t)=\sum_{n=1}^{\infty}\left(A_n\cos(c\frac{n\pi}{l}t)+B_n\sin(c\frac{n\pi}{l}t)\right)\sin(\frac{n\pi x}{l})\\ +\sum_{n=0}^{\infty}\left(C_n\cos(\frac{c(n+1/2)\pi }{l}t)+D_n\sin(\frac{c(n+1/2)\pi }{l}t)\right)\cos(\frac{(n+1/2)\pi}{l}x)$$ which doesn't seem right, since there are only two initial conditions, and we should be able to reduce the extra variables. So if we do pick one, which should we discard?
Edit: I guess I could avoid such problems by translating $u(x, t)$ by $l$ to get the usual Dirichlet boundary conditions $u(0, t)=u(2l, t)=0$. But without translation, how do I usually solve such problems?$