I have an eigenvalue problem $y'' + \lambda y=0$, $y'(-L) = y'(L)=0$. So far, I've solved the cases $\lambda=0$ and $\lambda=-p^2<0$. In the first case, I got $y_0(x) = B$ as an eigenfunction, and the second case yields a trivial solution. Similarly in the third case, I let $\lambda=p^2>0$. In this case, $y$ is of the form $y=A\cos(px)+B\sin(px)$. When combined with the boundary condition, I got the system of equations \begin{alignat}{3} & X'(-L) && = Ap\sin(pL) + Bp\cos(pL) = 0 \quad&& \Longrightarrow\quad A\sin(pL) + B\cos(pL) = 0 \label{eq:X2}\\ & X'(L) && = -Ap\sin(pL) + Bp\cos(pL) = 0 \quad&& \Longrightarrow\quad A\sin(pL) - B\cos(pL) = 0 \label{eq:Y2} \end{alignat} I noticed that both $$\cos\left(\frac{n\pi}{L}x\right)\quad\text{and}\quad\sin\left(\frac{(n-\frac{1}{2})\pi}{L}x\right),\quad n=1, 2, 3,\ldots$$ are appropriate (families of) functions. If those are both correct solutions, can I sum these two together to form a single solution like $$y_n=a_n\cos\left(\frac{n\pi}{L}x\right)+b_n\sin\left(\frac{(n-\frac{1}{2})\pi}{L}x\right)?$$
Note: My attempt to solve the system above is as follows: summing both equations yields $2A\sin(pL)=0$, which gives $A=0$ or $\sin(pL)=0$. Subtracting the bottom from the top equation yields $2B\cos(pL)=0$, which gives $B=0$ or $\cos(pL)=0$. Together, they form four cases: $A=B=0$, $A=\cos(pL)=0$, and $B=\sin(pL)=0$, and the final one gives $\cos(pL)=\sin(pL)=0$, which is not possible. Therefore, there are only two non-trivial families of solutions in this case: \begin{align} y_n&=a_n\cos\left(\frac{n\pi}{L}x\right)\\ y_n&=b_n\sin\left(\frac{(n-\frac{1}{2})\pi}{L}x\right). \end{align} If there is any error in my reasoning, please correct me. Thank you.