I have two functions, $f(t,x)$ and $g(t,u)$, where $\frac{d}{dt}u=f(t,x)$ and $\frac{d}{dt}x=g(t,u)$.
I am trying to discretize the integral of this system in order to track $x$ and $u$. I have succeeded using Euler integration, which is quite simple, since $x(t)$ and $u(t)$ are both known at $t$:
$u(t+h) = u(t) + h f(t,x(t))$
$x(t+h) = x(t) + h g(t,u(t))$
However, I am now trying to implement mid-point integration to get more accurate results. (Eventually Runge-Kutta but I am stuck here for now.)
EDIT: nevermind, if I'd written out the mid-point rule properly in the original question this wouldn't have been a problem. Edited to remove misleading math from the web.