Numerical integrator for $a'(t)=e^{-a(t)}f(t)$

Suppose I know a function $$f(t)$$ and all its derivatives in $$t$$ in closed form. Given $$a(0)$$ and some $$t_0>0$$, I'm looking for an explicit integrator that can estimate $$a(t_0)$$, where $$a(\cdot)$$ satisfies the ODE: $$\frac{da(t)}{dt}=e^{-a(t)}f(t).$$ I'm willing to compute (in closed-form) any derivatives $$f^{(k)}(t)$$ if that helps.

Of course I can apply the usual explicit methods (forward Euler, RK3), but I'm hoping to find an integrator that's reversible in time. And, ideally, one that exploits special structure in the ODE above, e.g. by somehow integrating the exponential, to achieve higher accuracy on some model problems.

Any suggestions?

• Start by integrating it analytically. Commented Apr 14, 2021 at 19:45
• For this (scalar) ODE, any standard method you choose will give you an answer accurate to several digits with extremely little computational cost. Can you explain why that's not good enough? Commented Apr 15, 2021 at 5:15

If $$a$$ satisfies the ODE, you know $$e^{a(t)}a'(t) = f(t)$$. Integrating you get \begin{align} \int_0^t\, f(\tau)\, d\tau &= \int_0^t e^{a(\tau)}a'(\tau)\, d\tau \\ &= \int_{a(0)}^{a(t)} e^a da \\ &= e^{a(t)} - e^{a(0)}. \end{align}
• @JustinSolomon If $f(t)>0$ Just use Gauss quadrature, which has positive weights. If $f(t)$ changes sign, then you may be right to worry about this approach, but unless $\int f(t) =0$ for some intervals then a sufficiently accurate quadrature will guarantee positivity. Commented Apr 15, 2021 at 5:17