0

I'm trying to solve the derivative of an equation that has a transpose (calculation of a multivariate distribution : trying to calculate the mean)

d/dx (x(T)Ax), where x is a vector, x(T) is the transpose of x, A is a Matrix.

According to the answer sheet, the answer is 2A*x.

Does this mean that x(T) is the same value of x, so x(T)Ax ==> Ax^2?

Robert
  • 21
  • 1
    Think about what it means to take the derivative with respect to a vector. Do you know index notation? If you do try writing everything in index notation. Also, I believe there is a condition you forgot to mention. The matrix $A$ should be symetric for that answer to be true. – Daniel Gendin Nov 19 '18 at 21:26

1 Answers1

2

Its not right to say $x^T A x= Ax^2$ as $x^2$ doesn't make sense when $x$ is a vector. Instead you can write $$ x^T A x = \sum_{i=1}^n \sum_{j=1}^n (x_i A_{ij} x_j) $$ Differentiating with the product rule you get $$ \frac{\partial}{\partial x_\ell} x^T A x =\sum_{i=1}^n \sum_{j=1}^n \left(\frac{\partial}{\partial x_\ell} x_i\right) A_{ij} x_j +\sum_{i=1}^n \sum_{j=1}^n x_i A_{ij} \left(\frac{\partial}{\partial x_\ell} x_j \right). $$ Then use $\frac{\partial x_i}{\partial x_\ell}=1$ if $i=\ell$ and $0$ otherwise to simplify the first term to $$ \left(\frac{\partial}{\partial x_\ell} x_i\right) A_{ij} x_j= \sum_{j=1}^n A_{\ell j} x_\ell. $$ The second term simplifies in a similar manner. Can you say what $\sum_{j=1}^n A_{\ell j} x_\ell$ is in terms of a product of $A$ and $x?$

Also, does the problem assume the matrix is symmetric? The derivative in the general case is $(A+A^T)x$.

Eric
  • 842
  • 4
  • 12