The problem states to find the non-negative solutions to the eigenvalue problem given by $y''+py=0$ where p is a parameter which may be varied.
Solving this differential equation for the general solution yields: $y=A\cos( p^{1/2} x) + B\sin( p^{1/2} x) $
furthermore: $y'=-A p^{1/2}\sin(p^{1/2}x)+ B p^{1/2}\cos(p^{1/2}x)$
Using the boundary conditions given $y(-2)=0$ and $y'(2)=0$ we may express the problem in the following matrix notation:
$ D * {[A,B]}^{T}=0$
where $D$ is the matrix with a top row of: $\cos( 2 p^{1/2}), -\sin(2 p^{1/2})$
and a bottom row of: $- p^{1/2}\sin(2 p^{1/2}), p^{1/2}\cos( 2 p^{1/2}) $
In my textbook it is written that the eigenvalues are the values of p which satisfy $\det(D)=0$
hence: $p^{1/2}\cos^2(2 p^{1/2})-p^{1/2}\sin^2(2 p^{1/2})=0$
assuming $p^{1/2}$ doesnt equal 0 (which it does not) and adding $\sin^2(2 p^{1/2})$ to both sides of the equation yields:
$\cos^2(2 p^{1/2})=\sin^2(2 p^{1/2})$
we may take the square root of both sides to get: $|\cos(2p^{1/2})|=|\sin(2p^{1/2})|$ from which it follows that: $1=|\tan(2p^{1/2})|$
this is satisfied when: $2p^{1/2}= {n\pi}/4$ for $n=1,2,3,\ldots$ hence $p^{1/2}=n\pi/8$
My confusion begins here, and may be an error in the answer provided by the textbook.
For even values of n the textbook provides the eigenfunction: $y=\cos(n\pi x/8) - \sin(n\pi x/8)$
however, for an answer: $y=A\cos(n\pi x/8)+B\sin(n\pi x/8)$ to satisfy $y(-2)=0$ it follows that: $0=A\cos(-n\pi/4)+B\sin(-n\pi/4)$ for an even n this means either the first or second term will be zero; thus the coefficient of the nonzero term must be zero. So, is the answer provided in the book incorrect?
For odd n I received the same answer as the book of: $y=A\cos(n\pi x/8)+A\sin(n\pi x/8)$