I am integrating an ODE of the first order of the form $\frac{d}{dr}P(r) = f(r)$ with a Runge-Kutta method of the second order (RK2) and the C programming language. I would like to estimate the first root, if any, of the resulting function $P(r)$ by means of an interpolation (namely, interpolating between two values where the function changes sign) but at the same time I would like to preserve the same precision as RK2, i.e. the same global error $O(\Delta r^4)$.
I have tried using a linear interpolation between two points $(r_1. P_1), (r_2, P_2)$ where the function changes sign ($P_1>0, P_2<=0$), however I am not sure that this does preserve the global error. I thought about using a parabolic interpolation but then I would need another point and I am constrained to choose either $r_1-\Delta r$ or $r_2+\Delta r$ so I am not sure it would be better.
You know both the function value and derivative at the two points, so cubic (Hermite) or inverse cubic interpolation could be options.
In the direct case, you can find the root by the analytical formulas, or by Newton, as you have a good starting approximation by linear interpolation.