Assume we have the following potential :
$$ V\left(x\right)=\begin{cases} 0 & -\frac{L}{2}\leq x\leq\frac{L}{2}\\ \infty & else \end{cases} $$
The wave function for a particle in this well potential, is given by :
$ \psi_{even}=\sqrt{\frac{2}{L}}\cos\left(\frac{n\pi x}{L}\right),\thinspace\thinspace\psi_{odd}=\sqrt{\frac{2}{L}}\sin\left(\frac{n\pi x}{L}\right) $
Where $n$ is even for the sin function, and $n $ is odd for the cos function, as we can see the calculation here
(the last comment)
But I tried to find the odd and even wavefunctions by shifting the wavefunction of a particle in an infinite box (which is not symmetric), and got different result. I'll be glad if someone can explain the difference. Here's my calculation:
We know that for a particle in a potential $$ V\left(x\right)=\begin{cases} 0 & 0\leq x\leq L\\ \infty & else \end{cases} $$
The wave function is given by
$ \psi\left(x\right)=\sqrt{\frac{2}{L}}\sin\left(\frac{\pi n}{L}x\right) $
For a symmetric potential we'll shift the function to the left by $ x\to x+\frac{L}{2} $ (we can see that for $x=-L/2 $ and for $x=L$ the wave function is $0$ so it preserved).
Now $ \psi\left(x\right)=\sqrt{\frac{2}{L}}\sin\left(\frac{\pi n}{L}\left(x+\frac{L}{2}\right)\right)=\sqrt{\frac{2}{L}}\sin\left(\frac{\pi n}{L}x+\frac{\pi n}{2}\right) $
If we'll write for odd $n$ , $ n=2m+1 $ and for even $n$, $n=2m$, we'll get the solution:
$ \psi\left(x\right)=\sqrt{\frac{2}{L}}\sin\left(\frac{\pi n}{L}\left(x+\frac{L}{2}\right)\right)=\sqrt{\frac{2}{L}}\sin\left(\frac{\pi n}{L}x+\frac{\pi n}{2}\right)=\begin{cases} \psi_{n=2m}=\left(-1\right)^{m}\sqrt{\frac{2}{L}}\sin\left(\frac{\pi n}{L}x\right)\\ \psi_{n=2m+1}=\left(-1\right)^{m}\sqrt{\frac{2}{L}}\cos\left(\frac{\pi n}{L}x\right) \end{cases} $
Which is different from the previous result (by a factor of $-1 $ in some of the functions)
What went wrong?
Thanks in advance.