I have some problem to manage a scalar function integral that involves matrix and trace, and I'm hoping somebody can help me out. I have to solve this ODE $$ \frac{\mathrm{d} }{\mathrm{d} \tau} C(\tau) = \mathrm{Tr}[\beta \mathbf{Q}^{T}\mathbf{Q} \mathbf{A}(\tau)] + \gamma r , \quad C(0) = 0 $$ where $r>0,\beta>0$, $\gamma = iu, u\in\mathbb{R}$ the Fourier transform argument, $\mathbf{M},\mathbf{R},\mathbf{Q}\in M_{d}$ (set of square real matrix), $\mathbf{M}$ is negative semi-definite. $\mathbf{A}(\tau)$ is the solution of matrix riccati equation (and its solution is given by linearization) $$ \mathbf{A}(\tau) = \mathbf{F}(\tau)^{-1}\mathbf{G}(\tau) $$ that leads to a solution of $2d$ system of linear ODEs $$ \frac{\mathrm{d} }{\mathrm{d} \tau} G(\tau) = \frac{\gamma(\gamma-1)}{2} \mathbf{F}(\tau) + \mathbf{G}(\tau)\mathbf{M} $$ $$ \frac{\mathrm{d} }{\mathrm{d} \tau} F(\tau) = -\mathbf{F}(\tau)(\mathbf{M}^{T} + 2\gamma\mathbf{R}\mathbf{Q}) - 2 \mathbf{G}(\tau) \mathbf{Q}^{T}\mathbf{Q} $$ Now to solve equation for $C(\tau)$ we work on the equation for $d/d\tau [\mathbf{F}(\tau)]$ we obtain $$ \mathbf{G}(\tau) = -\frac{1}{2} \left[ \frac{\mathrm{d} }{\mathrm{d} \tau} \mathbf{F}(\tau) + \mathbf{F}(\tau) (\mathbf{M}^{T} + 2\gamma\mathbf{R}\mathbf{Q}) \right] (\mathbf{Q}^{T}\mathbf{Q})^{-1} $$ Now, we plug this in the equation for $C(\tau)$ and we substitute $ \mathbf{A}(\tau) = \mathbf{F}(\tau)^{-1}\mathbf{G}(\tau). $ We obtain $$ \frac{\mathrm{d} }{\mathrm{d} \tau} C(\tau) = -\frac{\beta}{2} \mathrm{Tr}\left[ \mathbf{F}(\tau)^{-1} \frac{\mathrm{d} }{\mathrm{d} \tau} \mathbf{F}(\tau) + \mathbf{F}(\tau)(\mathbf{M}^{T} + 2\gamma\mathbf{R}\mathbf{Q}) \right] + \gamma r , $$ Now we can integrate (using trace properties), so $$ C(\tau) = -\frac{\beta}{2} \int_{0}^{\tau} \mathrm{Tr} \Bigl[ \mathbf{F}(s)^{-1} \frac{\mathrm{d} }{\mathrm{d} \tau} \mathbf{F}(s) \Bigr] ds -\frac{\beta}{2} \mathrm{Tr} \Bigl[(\mathbf{M}^{T} + 2\gamma\mathbf{R}\mathbf{Q})\Bigr] \int_{0}^{\tau} ds +\gamma r \int_{0}^{\tau} ds $$ and so $$ C(\tau) = -\frac{\beta}{2} \int_{0}^{\tau} \mathrm{Tr} \Bigl[ \mathbf{F}(s)^{-1} \frac{\mathrm{d} }{\mathrm{d} s} \mathbf{F}(s) \Bigr] ds -\frac{\beta}{2} \mathrm{Tr} \Bigl[(\mathbf{M}^{T} + 2\gamma\mathbf{R}\mathbf{Q})\Bigr] \tau +\gamma r \tau $$ The solution should be $$ C(\tau) = -\frac{\beta}{2} \mathrm{Tr} \Bigl[ \log \mathbf{F}(\tau) + (\mathbf{M}^{T} + 2\gamma\mathbf{R}\mathbf{Q}) \tau \Bigr] +\gamma r \tau $$ But I can't understand how to handle this term $$ -\frac{\beta}{2} \int_{0}^{\tau} \mathrm{Tr} \Bigl[ \mathbf{F}(s)^{-1} \frac{\mathrm{d} }{\mathrm{d} s} \mathbf{F}(s) \Bigr] ds $$ For completeness I report the paper where the ODE appear (see page 8).
I forget also $\mathbf{Q}\in GL(d)$ admits inverse