Derivative of eigenvalue of matrix with respect to its elements

462 Views Asked by At

Assuming that matrix $A$ is positive semidefinite and that $\lambda$ denotes the eigenvalue, I would like to compute the following gradient

$$\nabla_A \lambda(A)$$

I wanted to set this problem up as follows:

$$\frac{ \partial \lambda(A)}{\partial A} = \frac{ \partial \lambda(A)}{\partial tr(A)} \frac{ \partial tr(A)}{\partial (A)} = I$$

However, I found different solutions online, namely:

$$\partial \lambda(A) / \partial A_{ij} = (\mu \cdot b_i) (\mu \cdot b_j)$$

where $\mu$ is the associated eigenvector.

What am I doing wrong? Thanks in advance for your help!