From Sturm-Liouville to Fourier Transform: How is the author coming to these solutions using the following derivation? I'm hoping to teach myself advanced mathematical methods for physicists and am working my way through Mathematical Analysis of Physical Problems by Philip R. Wallace. I am currently starting on Fourier transforms.
As I read, I work my way through derivations myself with pen and paper because the book sometimes skips quite a few steps for the sake of brevity.
I am currently stuck on a derivation and do not understand where I am going wrong.
Here is the confusing segment:

The Sturm-Liouville problem
$\frac{d^2y}{dx^2}+\lambda y=0$
with the boundary condition of periodicity on the range $(-a/2 \leq x \leq a/2)$:
$y(\frac{a}{2})=y(-\frac{a}{2})$
produces the eigenvalues
$\lambda = \frac{n2\pi}{a}$, $n=integer$
and the corresponding eigenfunctions,
$y=\sin(\frac{n2\pi}{a}x)$
and
$y = \cos(\frac{n2\pi}{a}x)$
which form a degenerate pair. The expansion in these functions
$y=f(x)=\sum_{n=0}^{\infty}(a_n \sin(\frac{n2\pi}{a}x)+b_n \cos(\frac{n2\pi}{a}x))$
is the well-known Fourier series expansion.
Wallace, Philip R., Mathematical analysis of physical problems, New York, NY: Holt, Rinehart & Winston (ISBN 0-03-085626-4). xix, 616 p. (1972). ZBL1092.00500.

I understand the line of thought here, but when I set out to execute this derivation myself, I get a different result for $\lambda$. I first begin by re-arranging the Sturm-Liouville problem:
$\frac{d^2 y}{dx^2} = - \lambda y$
Then I take the approach:
$y(x) = A \sin(\sqrt{\lambda} x) + B \cos(\sqrt{\lambda} x)$.
Now, I use the boundary condition $y(\frac{a}{2})=y(-\frac{a}{2})$ and write
$A \sin(\sqrt{\lambda} \frac{a}{2}) + B \cos(\sqrt{\lambda} \frac{a}{2})=A \sin(-\sqrt{\lambda} \frac{a}{2}) + B \cos(-\sqrt{\lambda} \frac{a}{2})$$
which, considering even/odd symmetry, can be re-written as
$A \sin(\sqrt{\lambda} \frac{a}{2}) + B \cos(\sqrt{\lambda} \frac{a}{2})=-A \sin(\sqrt{\lambda} \frac{a}{2}) + B \cos(\sqrt{\lambda} \frac{a}{2})$.
This gives
$2A \sin(\sqrt{\lambda} \frac{a}{2})=0$.
Assuming the non-trivial case $(A \neq 0)$, I reason that it must be that
$\sqrt{\lambda} \frac{a}{2}=n2\pi$ .
This then yields (assuming only positive $\lambda$):
$\lambda = \frac{n^2 16 \pi^2}{a^2}$.
How is the author coming to his value of $\lambda$? What am I doing wrong?
 A: A Sturm-Liouville problem is a self-adjoint problem. A single condition such as $f(-a/2)=f(a/2)$ is not enough to give you symmetry. For example, define an operator $Lf=-f''$ on the domain $\mathcal{D}(L)$ consisting of twice differentiable functions $f$ on $[-a/2,a/2]$ such that $f(-a/2)=f(a/2)$. A symmetric problem would require that the following would always be $0$ for $f,g\in\mathcal{D}(L)$, and it isn't:
\begin{align}
    \langle Lf,g\rangle-\langle f,Lg\rangle & =\int_{-a/2}^{a/2}-f''\overline{g}+f\overline{g}''dx \\
      &= \int_{-a/2}^{a/2}\frac{d}{dx}(-f'\overline{g}+f\overline{g}')dx \\
    &= (-f'\overline{g}+f\overline{g}')|_{-a/2}^{a/2}.
\end{align}
It makes sense that a single condition is not enough because the values of the functions $f,g$ and their first derivatives at $-a/2$ and at $a/2$ come into play in the evaluations on the right. If you impose the additional condition that $f'(-a/2)=f'(a/2)$ for all $f\in\mathcal{D}(L)$, then at least you have
$$
              \langle Lf,g\rangle = \langle f,Lg\rangle,\;\;\; f,g\in\mathcal{D}(L).
$$
That will force eigenvalues of $L$ to be real, and to be discrete, and the eigenfunctions will be a classical Fourier Series invovling $\sin$ and $\cos$ functions. But without the additional condition on $f'$ for $f\in\mathcal{D}(L)$, the problem is not self-adjoint, and you don't get a nice eigenfunction expansion.
