Wave function for the free electron gas In the free electron gas model, we suppose that the electrons are non interacting and that they occupy a 3 dimensional infinite potential well. Solving the time independent Schrodinger equation for this setup, we get that
$$\psi_{n_x,n_y,n_z}=\sqrt{\frac{8}{l_xl_yl_z}}\sin(k_x x)\sin(k_y y)\sin(k_x x)$$
where $k_i=n_i \pi/l_i$. I can reach this answer easily. However, in Ashcroft and Mermin (Solid state physics), he gives the solution as
$$\psi_{k}(\vec{r})=\frac{1}{\sqrt{V}}e^{i\vec{k}\cdot \vec{r}}$$
My problem is that these solutions do not appear to be equivalent at all. For starters, the second expression is a plane wave in the $\vec{k}$ direction. But the first expression is definitely not a plane wave. For if we simply take the real part of the second expression, we get that
$$\psi_k(\vec{r})=\frac{1}{\sqrt{V}} \cos (k_x x +k_y y+k_z z)$$
But this doesn't behave or look anything like the first expression. So I guess I can summarize my question as follows: How does the first expression equal a plane wave or alternatively, how does the second expression reduce to the first?
Any help on this issue would greatly appreciated!
 A: The first wave function is the solution to the Schrodinger equation for the three-dimensional particle in-a-box problem. For a molecule with wave-vector $\mathbf{k}$
$$\psi(x,y,z)=\left( \frac{2}{L}\right)^{3/2}\sin(k_x x)\sin(k_y y)\sin(k_z z)$$
The quantization of $(k_x,k_y,k_z)$ which ensure the  boundary conditions imposed on wavefunction, is
$$k_i=\frac{n_i \pi}{L}$$
where $n_i$ are non-zero integers.
Note that it's not a traveling wave, If you took a one-dimensional case to make this much simpler, then $\psi(x)$ is just a standing wave (the combination may be much complicated). See the following to get much clear picture.

Now an alternate way to regard the box problem is to put the center of the box at the origin. and then apply the periodic boundary condition, In this case, the wave function n
$$\psi(x,y,z)=\frac{1}{\sqrt{V}}e^{i\mathbf{k}\cdot \mathbf{r}}$$
The periodic boundary condition imply the  quantization of $(k_x,k_y,k_z)$.

Now The first one is a sum of plane waves traveling in opposite directions. The suitable linear combination of the second will give you the first one or vice versa.
In one dimensional case,
$$\psi(x) \propto \sin(k_x x)\propto e^{ik_x x}-e^{-ik_x x}$$
A: The book says that the plane waves are solutions "neglecting the boundary condition" (page 33). On page 32 the authors say why they can, without loss of generality, ignore the boundary conditions. Since the bulk properties do not depend on the choice of boundary condition, you can choose the one you find most useful.
