$$f''+\lambda f = 0, \quad f=f(y), \quad a \leq y \leq b, \quad f(a)=f(b)=0 $$
In this case, I tried
$$f(y)=sin(k_ny), \quad \lambda=k_n^2 $$ $$f(a)=0 \Longrightarrow k_na = n\pi, \quad n=0,1,2,...$$ $$ k_n=\frac{n\pi}{a}, \quad n=0,1,2,... $$
The problem is that I don't know how to apply the second boundary condition here, so I know something in my approach is wrong. The answer is stated below. I can see why this solution works, but I just don't know how to derive it myself. Also I'm wondering if there is a solution that works from $n=0$.
$$ f(y)=sin(k_n(y-a)), \quad k_n=\frac{n\pi}{b-a}, \quad n=1,2,... $$
EDIT: I tried setting $$ f(y) = Acos(k_ny) + Bsin(k_ny) $$ $$ f(a) = Acos(k_na) + Bsin(k_na) = 0 $$ $$ f(b) = Acos(k_nb) + Bsin(k_nb) = 0 $$
But I'm not sure where to go from here. $f(a)$ can be zero if $A=-B, k_na = \pi/4 + n\pi$, but it can also be zero if $A=0, k_na=n\pi$ or $B=0, k_na=\pi/2+n\pi$. Do I have to check the second condition for all these 3 solutions, or is there any way to know which one I should go with?
Assuming $\lambda>0$, the general solution is
$$f(y)=c_c\cos(\sqrt\lambda y)+c_s\sin(\sqrt\lambda y).$$
Plugging the boundary conditions,
$$0=c_c\cos(\sqrt\lambda a)+c_s\sin(\sqrt\lambda a), \\0=c_c\cos(\sqrt\lambda b)+c_s\sin(\sqrt\lambda b).$$
The determinant of this homogeneous linear system is
$$\sin(\sqrt\lambda(b-a)).$$
So
if $\sqrt\lambda(b-a)$ is not a multiple of $\pi$, only the trivial solution $f=0$ is possible;
if $\sqrt\lambda(b-a)$ is a multiple of $\pi$, the solutions are
$$c\sin(\sqrt\lambda(x-a))$$ where $c$ is free.