I am trying to understand the solution to the infinite square well centered at zero in Principles of Quantum Mechanics by Shankar. Here is how it goes:
Inside the well (region II - Outside left is I and outside right is III) the solution is that of the free particle:
$$\psi_{II}(x)=Ae^{ikx}+Be^{-ikx}$$
$k$ has the obvious value. Applying the boundary conditions, we require that
$$\psi_{I}\left(\frac L2\right)=\psi_{II}\left(\frac L2\right)=0$$
$$\psi_{III}\left(-\frac L2\right)=\psi_{II}\left(-\frac L2\right)=0$$
Setting the determinant of the augmented matrix corresponding to this system to zero (otherwise only the trivial solution holds):
$$e^{-ikL}+e^{ikL}=0$$
So,
$$k=\frac{n\pi}{L}$$
So,
$$Ae^{-in\pi/2}+Be^{in\pi/2}=0$$
$$B=-e^{in\pi}A = -A(-1)^n$$
We find that there are two families of solutions; those for odd n and those for even n. For the odd case:
$$\psi(x)=Ae^{ikx}+Ae^{ikx}=2A\cos\left(\frac{n\pi x}{L}\right)$$
But for the even case:
$$\psi(x)=Ae^{ikx}-Ae^{ikx}=2Ai\sin\left(\frac{n\pi x}{L}\right)$$
These intermediary steps are not gone over in the book. I am wondering if it is valid to multiply the even solutions by $i$. It is probably of fundamental importance. I know I can multiply certain things without messing up the physics but will this? Anyway, if I have made an error somewhere please point it out. I am a beginner.
Addendum: I suppose all that physically matters is whether the functions are eigenfunctions of the hamiltonian representing the system and obey the boundary and normalization conditions.