Let $A$ be some matrix function of $x$, $A:\mathbb{R}^n \to \mathbb{R}^{n\times n}$.
My question is, is there some general formula for the gradient of
$$f(x) =\dfrac{1}{2} x^TA(x)x$$
I only know some special cases:
$A$ is a constant, symmetric matrix, then $\nabla f(x) = Ax$
$A$ is a constant, assymmetric matrix, then $\nabla f(x) = \dfrac{1}{2} (A^T+A)x$
$A$ is $\text{diag}(x)$, then $\nabla f(x) = \dfrac{3}{2} Ax$
I'm stuck because I don't understand how to find a simpler expression for the derivative $D[A(x)x]$, where,
\begin{align*} \nabla f(x) &= \nabla \dfrac{1}{2} x^TA(x)x\\ &= \nabla \dfrac{1}{2} x^Tg(x) \\ &= \dfrac{1}{2}A(x)x + \dfrac{1}{2}x^TD[A(x)x] \end{align*}