I know how to differentiate a product of matrices wrt a given matrix-entry e.g., $X_{i, j}$. However, I'm not sure if I'm thinking correctly about how to do that when I have a vector i.e., just one column.
I have $\mathbf{x^{\top}Ax}$ and I want it's derivative wrt $x_{i}$. Suppose that $\mathbf{x}$ is $4 \times 1$ and that $\mathbf{A}$ is $4 \times 4$ and symmetric! What follows is correct?
$$ \frac{\partial \mathbf{x^{\top}Ax}}{\partial x_{1}} = 2\mathbf{J}^{1\cdot}\mathbf{Ax} = 2 \begin{bmatrix} 1 & 1 & 1 & 1\\ 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 \end{bmatrix} \mathbf{Ax}. $$
Tks in advance!
The answer is simple, Greg explained clearly in the comments section.
We know that $$ \frac{\partial \mathbf{x}^{\top}\mathbf{Ax}}{\partial \mathbf{x}} = 2\mathbf{Ax}. $$ So, if now I want the derivative wrt $x_{k}$ I just multiply it by the $k^{\text{th}}$ basis vector. i.e., $$ \frac{\partial \mathbf{x}^{\top}\mathbf{Ax}}{\partial x_{k}} = 2e_{k}^{\top}\mathbf{Ax} = e_{k}^{\top} \frac{\partial \mathbf{x}^{\top}\mathbf{Ax}}{\partial \mathbf{x}}. $$