I have read the question 1D Infinite Square Well: Box Suddenly Increase in Size. How treat this?. There are two key equations in the selected answer.
$$\int_0^{2L} dx \ \psi^*_m\left(x\right) \Psi\left(x,0\right) = \sum_{n=1}^\infty c_n \int_0^{2L} dx \ \psi^*_m\left(x\right) \psi_n\left(x\right) = \sum_{n=1}^\infty c_n\delta_{mn} = c_m \tag{1}$$
$$c_n = \frac{\sqrt{2}}{L} \int_0^{L} dx \ \sin\left(\frac{n \pi x}{ 2L}\right) \sin\left(\frac{\pi x}{L}\right) \tag{2} $$ In the first equation, $\psi^*_m\left(x\right)$ and $\psi_n\left(x\right)$ are orthonormal (the wave function is mutually orthonormal), so the right hand side(R.H.S.) of the equation is equal to the left hand side(L.H.S.) of the equation. However, in the second equation, $\sin\left(\frac{n \pi x}{ 2L}\right)$ and $\sin\left(\frac{\pi x}{L}\right)$ are not orthonormal through $[0, L]$. Why $c_{n}$ still equal to the L.H.S.?