so I'm trying to solve the one dimensional particle in a box problem known from quantum physics in a classical context. So according to Wikipedia (see picture on the right) we would get a particle that is just moving from one potential-wall to the other.
Usually, when solving such a problem, I just solve the differential equation
$$F=m\ddot{x} \tag{1}$$
Now, the particle in a box is given by
$$ V(x) = \begin{cases} 0, & 0 < x < L \\ \infty, & \text{else} \end{cases} \tag{2}$$
The energy of the particle is given by $$ E_{\text{tot}} = \frac{1}{2}mv^2 + V(x) $$
Now, if we place the particle in that box and it has no initial momentum, the total energy is zero and it won't ever move - no? So I guess, without external "help", the particle won't ever start oscillating between the wall. So let's assume it has some initial momentum $p_0=mv_0$
Further we have
$$ F=-\frac{d}{dx}V \tag{4}$$
I'm really to scared to derive infinity - how do I approach (4) mathematically? For now, let's just assume we get an force like:
$$ F=\begin{cases} 0, & 0 < x < L \\ -a, & \text{else} \end{cases} \tag{5} $$
so we get (for init. cond. $x_o, v_0$)
$$ m\ddot{x} = \begin{cases} 0, & 0 < x < L \\ -a, & \text{else} \end{cases} \tag{5}$$ $$ x = \begin{cases} v_0t + x_0, & 0 < x < L \\ \frac{-a}{m}t^2 + v_0t + x_0, & \text{else} \end{cases} \tag{6}$$
which somehow seems odd, doesn't it? The RHS depends on where the particle is... but that's what we actually want to know. So I must do something terribly wrong.
Let's quickly talk about what I expect/how I understand it. If we look at (5) we see $F(0)=-a$ and $F(L)=-a$. At $t=0$ we have $F=-\frac{d}{dt}p_0=0$ so when we hit the right wall, we experience a new for $F(L)=-a$, leading the particle to change the direction instantaneously. What I don't fully get now is: Since the potiential is infinite, won't our kinetic energy explode and won't the particle go to the left infinite fast?
How do I properly solve this classicaly using Newtonian Mechanics?