For \(\lambda \leq 0\) the only solution of the boundary-value problem is \(y=0
.\) For \(\lambda=\alpha^{2}>0\) we have $$y=c_{1} \cos \alpha x+c_{2} \sin
\alpha x$$ Now \(y(-\pi)=y(\pi)=0\) implies
\\[
\begin{array}{l}
c_{1} \cos \alpha \pi-c_{2} \sin \alpha \pi=0 \\
c_{1} \cos \alpha \pi+c_{2} \sin \alpha \pi=0
\end{array}
\\] This homogeneous system will have a nontrivial solution when
\\[
\left|\begin{array}{rr}
\cos \alpha \pi & -\sin \alpha \pi \\
\cos \alpha \pi & \sin \alpha \pi
\end{array}\right|=2 \sin \alpha \pi \cos \alpha \pi=\sin 2 \alpha \pi=0
\\] Then
\\[
2 \alpha \pi=n \pi \quad \text { or } \quad \lambda=\alpha^{2}=\frac{n^{2}}{4}
; \quad n=1,2,3, \ldots
\\] When \(n=2 k-1\) is odd, the eigenvalues are \((2 k-1)^{2} / 4 .\) since \(\cos
(2 k-1) \pi / 2=0\) and \(\sin (2 k-1) \pi / 2 \neq 0\)
we see from either equation in (1) that \(c_{2}=0 .\) Thus, the eigenfunctions
corresponding to the eigenvalues \((2 k-1)^{2} / 4\) are \(y=\cos (2 k-1) x / 2\)
for \(k=1,2,3, \ldots .\) Similarly, when \(n=2 k\) is even, the eigenvalues are
\(k^{2}\) with corresponding eigenfunctions \(y=\sin k x\) for \(k=1,2,3, \ldots\)