Midpoint rule integration for a matrix-vector product

31 Views Asked by At

Consider a function $F=F(q)$ which is a symmetric, positive-definite matrix form of dimensions $n\times n$, where $q \in \mathbb{R}^n$ and $q=q(t)$.

When applying the midpoint integration rule on $F$, it is straightforward that $$ \int_0^h F(q)\,\mathrm{d}t \simeq h F\left(\frac{q_\ell + q_r}{2}\right) $$ where subindices $\ell$ and $r$ stand for "left" and "right" values respectively.

However, what would be the correct way to establish the following integral using the midpoint rule?

$$ \int_0^h \dot q^\intercal F(q)\, \dot q $$

EDIT

I want to consider a centered finite difference for $\dot q$, such that

$$\dot q = \frac{d q}{dt} = \frac{q_r - q_\ell}{h},$$

where $h$ is the time step.