Solution
= Solution
Twice <differentiation> the sine gives
$$
\hat H\sin\frac{n\pi x}{a}
=\frac{n^2\pi^2\hbar^2}{2ma^2}\sin\frac{n\pi x}{a}.
$$
Both <Dirichlet boundary conditions> hold when $n$ is an integer. The zero function at $n=0$ is not an <eigenfunction>, and negative $n$ merely changes an overall sign. Therefore
$$
\boxed{n=1,2,\ldots,\qquad E_n=\frac{n^2\pi^2\hbar^2}{2ma^2}.}
$$
The corresponding normalized <eigenfunction> is $\sqrt{2/a}\sin(n\pi x/a)$.