Example 2. Find the eigenvalues and eigenfunctions of the boundary value problem

$$
\begin{aligned}
& y^{\prime \prime}+\lambda^{2} y=0 \quad(\lambda \neq 0) \\
& y^{\prime}(0)=0, \quad y(\pi)=0
\end{aligned}
$$
Solution. The general solution of equation (7)

$$
y(x)=C_{1} \cos \lambda x+C_{2} \sin \lambda x
$$

hence

$$
y^{\prime}(x)=-C_{1} \lambda \sin \lambda x+C_{2} \lambda \cos \lambda x
$$

Setting $x=\pi$ in (9) and $x=0$ in (10) and taking into account the boundary conditions (8), we obtain for finding $C_{1}$ and $C_{2}$ a homogeneous linear system

$$
\left\{\begin{array}{l}
C_{1} \cos \lambda \pi+C_{2} \sin \lambda \pi=0 \\
C_{2} \lambda=0
\end{array}\right.
$$

The system (11) will have non-zero solutions if and only if its determinant is zero; equating it to zero, we get the equation for finding the eigenvalues of the given boundary value problem:

$$
\left|\begin{array}{cc}
\cos \lambda \pi & \sin \lambda \pi \\
0 & \lambda
\end{array}\right|=0, \text { or } \lambda \cos \lambda \pi=0 .
$$

Since by condition $\lambda \neq 0$, then $\cos \lambda \pi=0$, and thus the eigenvalues are

$$
\lambda=\lambda_{n}=\frac{2 n+1}{2}, \quad n=0,1,2, \ldots
$$

The corresponding (up to a constant factor $C_{1}$, which can be set to one) eigenfunctions are

$$
y_{n}(x)=\cos \frac{2 n+1}{2} x
$$

which are solutions of the boundary value problem (7)-(8).

Remark. The eigenvalues of the above problems form an increasing numerical sequence. If the coefficients of the differential equation have a singular point on the boundary of the main domain or if the main domain is infinite, for example the entire number line, then the spectrum, i.e., the set of eigenvalues, may have a different structure. In particular, spectra may be encountered that contain all numbers of a certain interval of $\lambda$ values, so-called continuous spectra. For example, let it be required to solve the equation $y^{\prime \prime}+\lambda y=0$ for the interval $-\infty < x < \infty$ with the condition that the solution is bounded as $x \to \pm \infty$.

If the condition $p(x)>0$ is not satisfied throughout the main domain $0 \leqslant x \leqslant 1$ here, because $p(0)=0$. The point $x=0$ is a singular point for the Bessel equation.

The requirement that the solution be bounded at this point will be a special type of boundary condition for the Bessel equation: to find a solution of equation (12) that is bounded at $x=0$ and, for example, vanishes at $x=1$.