quadratic matrix derivation using chain rule Giving
$$f(x) = x^T A x$$
with $x \in \mathbb{R}^{n} $ and $A \in \mathbb{R}^{n \times n}$, than 
$$ \frac{\partial f(x)}{\partial x} = (A + A^T) x$$
I tried to prof this with the chain rule. With $u=x^T$ and $v = Ax$. So $u' = I$ and $v' = A \ I$. Giving me
$$ \frac{\partial f(x)}{\partial x} =  A x + x^T A $$
I know that $(x^TA)^T = A^T x $, but why can I use this here, or am I missing something? Why can I transpose just one part of my equation? 
I know how to prove this with the sum version of $f(x)$ but I wonder if the chain rule works easier and got somehow stuck. 
 A: I suggest you write it out: 
$$
f(x) = \sum_i \sum_j x_i a_{ij} x_j
$$
The derivative of that with respect to $x_k$ is straightforward, once you realize that $\frac{\partial x_i}{\partial x_k} = \delta_{ik}$. You then get, using the multiplication rule:
\begin{align}
\frac{\partial f(x)}{\partial x_k} 
&= \sum_i \sum_j \frac{\partial x_i a_{ij} x_j}{\partial x_k} \\
&= \sum_i \sum_j \frac{\partial x_i}{\partial x_k} a_{ij} x_j +  x_i a_{ij} \frac{\partial x_j} {\partial x_k} \\
&= \sum_i \sum_j \delta_{ik} a_{ij} x_j +  x_i a_{ij} \delta_{jk} \\
&= \sum_j a_{kj} x_j +  \sum_i x_i a_{ik}\\
&= \sum_j a_{kj} x_j +  \sum_j x_j a_{jk}\\
&= \sum_j a_{kj} x_j +  \sum_j a_{jk}x_j 
\end{align}
which is the $k$th entry of $Ax + A^t x$. 
To answer your original question -- "Am I doing the chain rule wrong?" -_ I have to say I don't know, because I don't know where you got the formulas that you're using in your solution. Are you just assuming that the chain rule you know from one-variable calculus works the same way for multivariable stuff and multi-index derivatives? It looks that way, but maybe you've got a reference that gives all these things as theorems. I've tried looking at such things, often get befuddled, and then just work it out directly as I've done above. 
A: It is better to prove this using the definition of the derivative.  Rewriting $x^\top A$
$\begin{align*}
f(x+v) &= (x+v)^\top A (x+v)\\
&=\langle x+v, A(x+v)\rangle\\
&=\langle x,Ax\rangle + \langle v,Ax\rangle + \langle x,Av\rangle + \langle v,Av\rangle \\
&=f(x)+\langle v, Ax\rangle + \langle v, A^\top x \rangle + \langle v,Av\rangle \\
&=f(x)+\langle v, \left(A +A^\top\right) x \rangle + \langle v,Av\rangle
\end{align*}$
Now $\langle v, Av\rangle $ is of order $|v|^2$, since $|\langle v,Av\rangle | \leq |A|_{op} |v|^2$, where $|A|_{op}$ is the operator norm of $A$.
So by the definition of the derivative,
$$\frac{d}{dx} x^\top Ax = \left(A +A^\top\right) x$$
