I am given this Sturm-Louiville problem: $$\frac{d^2y}{dx^2}+\lambda y=0$$
With boundary conditions: $y'(0) = 0, y(2) = 0$, where $n = 1, 2, 3, ...$
I am now trying to find the eigenvalues.
I tried using the general solution:
$y = A \cos(px) + B\sin(px)$, where $λ = -p^2 < 0$
I differentiated this and substituted the boundary conditions $y'(0) = 0$ to obtain that $B = 0$.
From this, I used the boundary condition $y(2) = 0$ to obtain:
$A\cos(2p) = 0.$
From this, I arrived at $p = \frac{n \pi}{4}$.
I was hoping for some kind of confirmation if I am on the right track...I would also like some guidance of where to go from this to obtain the eigenvalues.
I tried to find the eigenvalues by simply finding $-p^2$, but I found that this was wrong.
Thank you for your time, I appreciate any help.

$$\frac{d^2y}{dx^2}+\lambda y=0\tag1$$
For $\lambda =0$, the general solution is $y(x)=Ax+B$, where $A, B$ are arbitrary constants..
The given conditions are $y'(0) = 0, y(2) = 0$ gives $A=B=0$
Hence we get $y(x)=0$, which is the trivial solution.
For $\lambda\lt 0$, say $\lambda=-p^2$
then the general solution is $y(x)=Ae^{px}+Be^{-px}$, where $A, B$ are arbitrary constants..
The given conditions are $y'(0) = 0, y(2) = 0$ gives
$pA-pB=0\implies A-B=0$
$Ae^{2p}+Be^{-2p}=0$ which gives $A=B=0$
Hence we again get $y(x)=0$, which is the trivial solution.
So we discard these two cases and take $\lambda\gt0$.
Let $\lambda=p^2 \gt 0$
The general solution is $y(x)=A \cos(px) + B \sin(px) $, where $A, B$ are arbitrary constants.
Now the given conditions are $y'(0) = 0, y(2) = 0$
$y'(0) = 0\implies B=0$ and $y(2) = 0\implies A\cos(2p)=0$
If we take $A=0$, then we again get the trivial equation, so we take $A \ne 0$. This gives
$~\cos(2p)=0\implies 2p=(2n-1)\frac{\pi}{2}~~~~~\text{where $~n=1,~2,~3,~\cdots~$ }$ $~\implies ~p=(2n-1)\frac{\pi}{4}~~~~~\text{where $~n=1,~2,~3,~\cdots~$ }$
So the eigen value of the given differential equation $(1)$ is $$~\lambda=p^2=~(2n-1)^2\frac{\pi^2}{16}~~~~~\text{where $~n=1,~2,~3,~\cdots~$ }~$$
and the corresponding eigen functions are $$~y(x)~=~A~\cos\left\{(2n-1)\frac{\pi}{4}~x\right\}\qquad \text{where $~n=1,~2,~3,~\cdots~~~$and $~a~$ is a constant}~.$$
You can also take the following
$~\cos(2p)=0\implies 2p=(2n+1)\frac{\pi}{2}~~~~~\text{where $~n=0,~1,~2,~3,~\cdots~$ }$ $~\implies ~p=(2n+1)\frac{\pi}{4}~~~~~\text{where $~n=0,~1,~2,~3,~\cdots~$ }$
So the eigen value of the given differential equation $(1)$ is $$~\lambda=p^2=~(2n+1)^2\frac{\pi^2}{16}~~~~~\text{where $~n=0,~1,~2,~3,~\cdots~$ }~$$
and the corresponding eigen functions are $$~y(x)~=~A~\cos\left\{(2n+1)\frac{\pi}{4}~x\right\}\qquad \text{where $~n=0,~1,~2,~3,~\cdots~~~$and $~a~$ is a constant}~.$$
Note: In both the two cases the values of $~\lambda~$ are same, in the first one $~n~$ does not take the value $~0~$, and in the second case it takes.