While Solving the TISE for a particle an infinite square well with potential given by: $$ U(x) = \left\{ \begin{array}{ll} 0 & \quad -L/2 \leq x \leq L/2 \\ \infty & \quad \text{otherwise} \end{array} \right. $$
we get two sets of solutions: $$ \psi(x) = \left\{ \begin{array}{ll} A\sin(\frac{n\pi x}{L}) & \quad n = 2,4,6,... \\ B\cos(\frac{n \pi x}{L}) & \quad n = 1,2,3,... \end{array} \right. $$
But when we solve the TISE for potential $ U(x) = 0 \quad for \quad 0 \leq x \leq L $ we get only one solution i.e. $\phi(x) = A\sin(\frac{n\pi x}{L})$ where $A=\sqrt{\frac{2}{L}}$.
I want to know what difference does the change of coordinates makes on the system so that for one there are two solutions and for other there is only one?