I am having some difficulty solving the equation $y'' + \lambda y = 0; y(0) = y'(L) = 0$. I've been able to solve the cases $\lambda = 0$ and $\lambda < 0 $; however, for $\lambda > 0$, I encounter some problems.
I know that the general solution is $y(x) = C_1 \cos(kx) + C_2 \sin(kx)$, by letting $λ = k^2$, where $k > 0$.
$y(0) = C_1 = 0$
$y(x) = C_2 \sin(kx)$
$y'(L) = C_2 k \cos(kx) = 0$
Then,
$\cos(kx) = 0 \implies \cos(x\sqrt\lambda )$
It is at this point that I struggle. I know the answer is $\lambda= \left(\frac{2n+1}{2L}\right)^2,$ but I don't understand how we got here from $\cos(kx) = 0$.
The last step is using our knowledge of zeros of $\cos$: $\cos(z) = 0$ if and only if $z = \frac{\pi}{2} + \pi n$ for some $n \in \mathbb{Z}$.
Given that fact, the equality $\cos(kL) = 0$ is equivalent to $kL = \frac{\pi}{2} + \pi n$ for some $n\in\mathbb{Z}$, i.e. $k = \frac{(2n+1)\pi}{2L}$ or $\lambda = \left(\frac{(2n+1)\pi}{2L}\right)^2$.