I am trying to calculate the following gradient
$$\nabla_{\mathbf{X}} \left( \mathbf{a}^{T} \mathbf{X} \mathbf{a} \right)$$
where I am using the convention that $\mathbf{a}$ is a column vector. I am wondering what the steps are to extract the solution from the matrix cookbook, which is:
$$\nabla_{\mathbf{X}} \left( \mathbf{a}^{T} \mathbf{X} \mathbf{a} \right) = \mathbf{a}\cdot\mathbf{a}^{T}$$
See this question for the basics and the notation.
The derivative of the scalar function $f(X)$ with respect to $X$, where $X$ is a matrix, is the matrix $A$ with $A_{i,j}=\dfrac{df(X)}{dX_{i,j}}$.
And here,
$$f(X)=a^TXa=\sum_{i,j} X_{i,j}a_ia_j$$
So that
$$\dfrac{df(X)}{dX_{i,j}}=a_ia_j$$
And finally
$$A=\frac{df(X)}{dX}=aa^T$$