I want to calculate this equation $\frac{\partial y^TB^{-1}y}{\partial y}$
according to the equation(81) of matixcookbook,
$\frac{\partial x^TBx}{\partial x} =(B+B^T)x$
B is a matrix calculated by y.
So,$\frac{\partial y^TB^{-1}y}{\partial y}$ becomes $\frac{\partial y^TB^{-1}y}{\partial y}=(B^{-1}+B^{-T})\cdot y + \frac{\partial B^{-1}}{\partial y}$ I am not sure if the second part,namely $+ \frac{\partial B^{-1}}{\partial y}$
can someone tell me if I am doing that correctly or not?
If $A$ depends on $x$ then, the derivative of $x^T A x$ w.r.t. $x_i$ (the $i$-th component of $x$) is
\begin{eqnarray} \frac{\partial}{\partial x_i}(x^T A x) &=& \frac{\partial}{\partial x_i}\sum_{j,k}x_j A_{jk} x_k \\ &=& \sum_{j,k}\left(\frac{\partial x_j}{\partial x_i}\right)A_{jk}x_k + \sum_{j,k}x_j\left(\frac{\partial A_{jk}}{\partial x_i}\right)x_k + \sum_{j,k}x_jA_{jk}\left(\frac{\partial x_k}{\partial x_i}\right)\\ &=& \sum_{k}A_{ik}x_k + \sum_{j,k}x_j\left(\frac{\partial A_{jk}}{\partial x_i}\right)x_k + \sum_{j}x_j A_{ji}\\ &=& (A x)_i + (A^T x)_i + x^T \left(\frac{\partial A}{\partial x_i}\right)x \end{eqnarray}
The derivative in the last term just means: take derivative of $A$ w.r.t. the $i$-th component of $x$. A more compact notation is
$$ \frac{\partial}{\partial x}(x^T A x) = (A + A^T) x + x^T \left(\frac{\partial A}{\partial x}\right)x $$
keeping in mind the meaning of the last term