Discrepancy in derivative of quadratic form

Suppose $A \in \mathbb{R}^{n\times n}$ is symmetric and $x,b,c \in \mathbb{R}^n$. I would like to compute $\nabla f$ where $$f = \frac{1}{2}x^T A x - x^Tb + c.$$ Now my issue is in how the derivative is calculated. I have seen $$\frac{\partial}{\partial x} x^TAx = x^T(A+A^T)$$ and also $$\frac{\partial}{\partial x} x^TAx = (A+A^T)x$$ which one is correct? In my readings I more frequently see this derivative as $x^T(A+A^T)$ however I also see that $\nabla f = Ax - b$ (for example, on Wikipedia), but the first definition does not imply the expression for $\nabla f$ (shouldn't we have $\nabla f = x^TA - b$)?

Thanks.


There is no correct or incorrect computations, there are mostly conventions. You may arrange your partial derivatives in a column or a row vector. The important thing is that you must stick to yourconvention all along the way: this choice will impose a certain structure on the chain rule for instance. The Wikipedia page wiki is the place to learn more on the two options.