First integral of an ordinary differential equation (source code)

= First integral of an ordinary differential equation
{title2=$I_t+\nabla I\cdot f=0$}

= ODE invariant
{c}
{synonym}

A first integral of $y'=f(t,y)$ is a differentiable function $I(t,y)$ whose value is constant along solutions through every time and state in its domain. The <chain rule> makes this equivalent to the displayed pointwise identity. For $I(y)=y^TSy$ with symmetric $S$, it becomes $y^TSf(t,y)=0$. This identity at the implicit stage is what proves exact <Runge-Kutta conservation of quadratic invariants> for the <implicit midpoint rule>. Invariance asserted only on the image of one initial-time flow needs that image to contain the stage under consideration.