Derivative of sqrt( Vector * Matrix * Vector ) according to one coordonate of the vector

540 Views Asked by At

I have a $n$ element vector $V$ and a symmetric $n\times n$ matrix $M$ (all of real elements).

I calculate a score as $({ V^TMV })^{1/2}$

Now is there a formula that would give me:

  • the derivative of the score according to one coordinate of the vector
  • the second derivative of the score according to one coordinate of the vector
2

There are 2 best solutions below

2
On BEST ANSWER

Just by definition: $$S=\sqrt{\sum_{ij}m_{ij}v_iv_j}.$$ $$\partial_{x_k}S = \frac {1}{2S }\partial_{x_k}\sum_{ij}m_{ij}v_iv_j=\frac {1}{2S } \left(\sum_{ j}m_{kj} v_j+\sum_{i }m_{ik}v_i \right) =\frac {1}{S}(MV)_k. $$

Can you write the second derivative now?

0
On

First use the chain rule

$$\frac{\partial}{\partial x}(v^T M v)^{1/2} = \frac{1}{2}(v^TMv)^{-1/2}\frac{\partial}{\partial x}(v^TMv)$$

which holds for all variables $x$. Now you can use summation convention

$$\frac{\partial}{\partial v_k} (M_{ij}v_iv_j) = M_{ij}\delta_{ik}v_j + M_{ij}v_i\delta_{jk} = M_{kj}v_j + M_{ik}v_i = 2(Mv)_k$$

where $(-)_k$ denoes the $k$th element of the vector in parentheses, and I've used the fact that $M$ is symmetric to group two terms in the last equality. Therefore you have

$$\frac{\partial}{\partial v_k}(v^TMv)^{1/2} = (v^TMv)^{-1/2}(Mv)_k$$

You can calculate the second derivative similarly.