Let $f(x) = x^TAx$ and you want to evaluate $\frac{df(x)}{dx}$. This is nothing but the gradient of $f(x)$.
There are two ways to represent the gradient one as a row vector or as a column vector. From what you have written, your representation of the gradient is as a row vector.
First make sure to get the dimensions of all the vectors and matrices in place.
Here $x \in \mathbb{R}^{n \times 1}$, $A \in \mathbb{R}^{n \times n}$ and $f(x) \in \mathbb{R}$
This will help you to make sure that your arithmetic operations are performed on vectors of appropriate dimensions.
Now lets move on to the differentiation.
All you need to know are the following rules for vector differentiation.
$$\frac{d(x^Ta)}{dx} = \frac{d(a^Tx)}{dx} = a^T$$ where $x,a \in \mathbb{R}^{n \times 1}$.
Note that $x^Ta = a^Tx$ since it is a scalar and the equation above can be derived easily.
(Some people follow a different convention i.e. treating the derivative as a column vector instead of a row vector. Make sure to stick to your convention and you will end up with the same conclusion in the end)
Make use of the above results to get,
$$\frac{d(x^TAx)}{dx} = x^T A^T + x^T A$$
Use product rule to get the above result i.e. first take $Ax$ as constant and then take $x^T A$ as constant.
So, $$\frac{df(x)}{dx} = x^T(A^T + A)$$
What sort of object can be the derivative of a vector-valued function whose values are row vectors and whose arguments are column vectors? Generally, what kind of object can be the derivative of a function whose values are members of one vector space $W$ and whose arguments are members of another vector space $V$?
$$
f: V\to W
$$
The answer is that the value of such a derivative at any point in $V$ is a linear transformation from $V$ into $W$, and it may be a different linear transformation at each point in $V$. But if $f$ is itself linear, then it's the same linear transformation at each point in $V$: it's $f$ itself.
Transposition is linear. Therefore the value of its derivative at each point in its domain is itself.
Often one represents a linear transformation by a matrix. What would be the matrix in this case? No matter what basis you pick for the domain $V$, it seems natural to pick as a basis of $W$ the set of transposes of the basis vectors you chose for $V$. In that case, the matrix would be the identity matrix.
Best Answer
You can do it componentwisely:
$$\frac{d(x^Ta)}{dx}=\left(\frac{d(x_1a_1+x_2a_2+\cdots+x_na_n)}{dx_1}, \frac{d(x_1a_1+x_2a_2+\cdots+x_na_n)}{dx_2}, \cdots, \frac{d(x_1a_1+x_2a_2+\cdots+x_na_n)}{dx_n}\right)\\ =(a_1,a_2,\cdots, a_n)=a^T$$