1-D well (Quantum Physics)

Consider a particle confined to a box of width $2b$ centered at $x = 0$, i.e., with a potential $V(x) = 0$, $|x| < b$ and otherwise infinite.
a) Determine the eigenfunctions of the time-independent Schrodinger equation.
b) Determine the eigenvalues of the time-independent Schrodinger equation.
c) Compare your results with those for a box of width $a = 2b$ with a potential $V(x)=0$, $0 < x < $a and otherwise infinite.

Schroedinger equation is
$-(\hbar^2)/2m  (d^2 \psi_n/dx^2 )+V(x) \psi_n (x)=E_n*\psi_n (x)$
For both cases wave functions are standing waves. In the first case (centered well on $x=0$)
$\psi_n (x)=A*cos⁡(k_n x)=A*exp⁡(ik_n x)$
$k$ is wave vector (number) therefore (from the figure)

The condition of normalizing for wave function is
$1=\int_0^L (|\psi(x)|^2 dx)=A^2*\int_0^L [exp⁡(ikx)*exp⁡(-ikx)dx]=A^2 \int_0^L(1*dx)=A^2*L$

Thus the wave functions in this case are
$\psi_n (x)=\sqrt{(1/2b)}*exp⁡(ik_n x)$
In case the well begins at $x=0$ (centered on $x=b$) an initial phase to the above function form of is added corresponding to the waves:
$\psi_n (x)=\sqrt{1/2b}*sin⁡(k_n*x)=\sqrt{1/2b}*exp⁡[i(k_n x+n\pi/2)$

Back into the original Schroedinger equation with these wave functions one has inside the well
$V(x)=0$  and $-(\hbar^2*k_n^2)/2m*\psi_n (x)=E_n*\psi_n (x)$
$E_n=-(\hbar^2*k_n^2)/2m=-(\hbar^2*\psi^2)/(8mb^2 )*n^2$
En are the eigenvalues of Schroedinger equation for both cases.