Sturm-Louiville eigenvalues 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.
 A: $$\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.
A: The characteristic equation is
$$z^2+\lambda=0$$ and there are three regimes:


*

*$\lambda > 0\to y=A\cos\sqrt\lambda x+B\sin\sqrt\lambda x$,

*$\lambda = 0\to y=Ax+B$,

*$\lambda < 0\to y=Ae^{\sqrt{-\lambda}x}+Be^{-\sqrt{-\lambda }x}$.
By plugging the given limit conditions (for generality, $l=2$),


*

*$\lambda > 0\to 0=B,0=A\cos \sqrt\lambda l+B\sin \sqrt\lambda l$,

*$\lambda = 0\to 0=A,0=Al+B$,

*$\lambda < 0\to 0=A-B,0=Ae^{\sqrt{-\lambda}l}+Be^{-\sqrt{-\lambda}l}$
or


*

*$\lambda > 0\to \cos \sqrt\lambda l=0$,

*$\lambda = 0\to 1=0$, which is not possible,

*$\lambda < 0\to \cosh\sqrt{-\lambda}l=0$, which is not possible.
So for $\lambda>0$, 
$$\sqrt\lambda l=(2k+1)\frac\pi2$$ or $$\lambda=\frac{(2k+1)^2\pi^2}{4l^2}$$ must hold for non-trivial solutions to exist.
The first Eigenfunctions:

A: Any eigenfunction must be a non-zero constant multiple of the solution of
$$
          y''+\lambda y =0,\;\; y(0)=1,\; y'(0)=0,
$$
which has unique solution
$$
        y(x) = \cos(\sqrt{\lambda}x).
$$
Then, in order to satisfy $y(2)=0$, $\lambda$ must satisfy
$$
           \cos(2\sqrt{\lambda})=0.
$$
 The general solution is
$$
                2\sqrt{\lambda} = (n+1/2)\pi ,\;\; n=0,1,2,3,\cdots, \\
                \lambda = (n+1/2)^2\pi^2/4,\;\;\; n=0,1,2,3,\cdots.
$$
The corresponding eigenfunctions are
$$
           y_n(x) = \cos((n+1/2)\pi x/2),\;\; n=0,1,2,3,\cdots.
$$
