# Midpoint rule integration for a matrix-vector product

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.

• What is the differential equation for this second integral? $\ddot q=\dot q^TF(q)\dot q$? But then $F$ can't be a simple matrix. Commented Nov 17, 2023 at 16:18
• @LutzLehmann Well, that is the point of the question. $F(q)$ is a square matrix whose elements are fuctions of $q$. Commented Nov 18, 2023 at 17:05