Say I have a positive definite matrix $M(\sigma)\in \mathbb{R}^{n\times n}$ whose elements are functions of some variable $\sigma \in \mathbb R$. I am wondering how I can expand $\frac{d \eta_i}{d \sigma}$ using the chain rule, where $\eta_i$ is the $i^{th}$ eigenvalue of $M(\sigma)$.
For example, I imagine it should be something like
$$ \frac{d \eta_i}{d \sigma} = \frac{d \eta_i}{d M} \frac{d M}{d \sigma} $$
but it doesn't seem to make sense if I try to think what the shapes of the vectors $\frac{d \eta_i}{d M}$ and $\frac{d M}{d \sigma}$ should be. So I think maybe
$$ \frac{d \eta_i}{d \sigma} =\sum_{kj} \frac{d \eta_i}{d M_{kj}} \frac{d M_{kj}}{d \sigma} $$
makes more sense, but I can't explain why. Also even if this expansion is correct, how can one compute $\frac{d \eta_i}{d M_{kj}} $ to begin with?