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!