# Going back in time in an initial value problem

Consider an initial value problem (IVP) $$y'=f(t,y)$$ with the initial value given by $$y(t=0) = 0$$.

If I need to find $$y(t^*)$$, hence finding the path for $$y$$ in $$t \in [0,t^*]$$ and $$t^*<0$$; is the problem then still an initial value problem? In other words can you go back in time in IVP.

The reason I ask is that I have an algorithm where in each step I need to solve for different $$t^*$$. I intend to use solve_ivp in Python which is based on Runge-Kutta 45 method and I want to know if there are any theoretical contradictions when I apply RK45.

I know that if I will use Eulers method then there is no problem. But what about RK45. Will I get the desired result.

## 1 Answer

This is technically still an IVP if you do an appropriate change of variables. Given your time is between $$t \in [t^*, 0]$$, make a new time variable $$\tau = -t$$ so that $$\tau \in [0, -t^*]$$ and you can modify the time derivatives accordingly. This means that you should have the differential equation $$\frac{dy}{d\tau} = -f(-\tau, y)$$ with $$y(\tau = 0) = 0$$ as your new IVP. This implies that you should be able to use Runge-Kutta approaches just fine.

• Perfect. Thanks – k.dkhk Jun 18 at 18:51
• Some time stepping methods have a property called "reversibility". This means, essentially, that you will end up where you started if you go forward and then backward again. Depending on what you want to achieve, this might be an important thing to look at! I am pretty sure that RK45 is not reversible, for example. – Daniel Jun 19 at 11:40