# Simple matrix calculus questions

Lame matrix calculus question: Suppose you have that $y$ is an $n \times 1$ vector function of $t$ and $G$ is an $n \times n$ symmetric matrix function of $t$. Is it ok to write

$\frac{d}{dt}(y^T G y) = 2 \frac{d(y^T)}{dt} G y + y^T \frac{dG}{dt}y$,

where superscript $T$ denotes the transpose?

-
Use $\frac{d}{dt}(y^T G y) =(\frac{dy^T}{dt} G y)+(y^T \frac{dG}{dt} y)+(y^T G \frac{dy}{dt})$. So if $(\frac{dy^T}{dt} G y)=(y^T G \frac{dy}{dt})$ your result is correct. But maybe you already know and I missed something... – draks ... Jul 19 '12 at 10:26
Yes, this is what I thought. I am just trying to make sure I didn't cock up because if not the rest of my proof would be wrong. Thanks... – chango Jul 19 '12 at 10:29
Where does $G$ live? Is it symmetric? What about the $y$? Is it real? – draks ... Jul 19 '12 at 10:38

Use $\frac{d}{dt}(y^T G y) =(\frac{dy^T}{dt} G y)+(y^T \frac{dG}{dt} y)+(y^T G \frac{dy}{dt})$. So if $(\frac{dy^T}{dt} G y)=(y^T G \frac{dy}{dt})$ your result is correct.
In a quantum mechanical setup this is related to Ehrenfest's Theorem. It says that $$\frac{d}{dt}\langle A \rangle_\psi = \frac{d}{dt}\langle \psi | A | \psi \rangle = \frac{d}{dt}\langle A\rangle = \frac{1}{i\hbar}\langle [A,H] \rangle+ \left\langle \frac{\partial A}{\partial t}\right\rangle$$
... with $\frac{\partial \psi}{\partial t} = -\frac{i}{\hbar}H\psi$ and $H$ being the Hamiltionian... – draks ... Jul 19 '12 at 10:55