I am taking derivative of
$$X^TAX, X \in {\rm I\!R}^n$$
using Frechet Derivative where $$f(x + h) = f(x) + <\nabla f(x), h> + O||h|| $$.
So I have
$$f(x + h) = X^TAX + X^TAh + h^TAX +h^TAh$$
and with the two terms in between, I have
$$<X^T(A+A^T), h> $$
and I think this $X^T(A+A^T)$ is the derivative of $X^TAX$. However, since $X$ is a $n \times 1$ vextor, while $X^T(A+A^T)$ is a $1 \times n$ vector. Am I doing anything wrong here? I saw some matrix calculus instructions also have this answer. I don't know what is happening.
So the problem is if I am doing gradient decent, I will have to do $x - \nabla f(x)$, but the dimensions don't match, so I think there must be something wrong.