Suppose that $A$ is real and symmetric matrix (or tensor) of dimension $3 \times 3$, with its spectral decomposition
$$A = \sum_{i=1}^3 \lambda_i\ n_i\otimes n_i$$ where $\lambda_i$, $n_i$ and $\otimes$ denote the eigenvalues, eigenvectors and dyadic product, respectively. Further, let $a$ be a vector of the form
$$ a = \sum_{i=1}^3 f(\lambda_i)\ n_i$$
with an at least twice-differentiable function $f(\lambda_i)$.
I need to compute the derivative (third-order tensor) $B$ with its components
$$B_{ijk}=\frac{\partial a_i}{\partial A_{jk}}$$
also in the case that the eigenvalues are not distinct (e.g. $\lambda_1=\lambda_2\neq \lambda_3$ or even $\lambda_1=\lambda_2= \lambda_3$). I know that this is possible for a matrix $C$
$$C = \sum_{i=1}^3 f(\lambda_i)\ n_i\otimes n_i$$
In this case, the derivative $\partial C/\partial A$ (fourth order tensor) is always computable, also if the eigenvalues are not distinct (see e.g. R.W. Ogden, Non-Linear Elastic Deformations, 1997, p. 162)