I am trying to find $\frac{\partial (x'Ax)}{\partial x}$ where x is a vector (2 x 1 vector) and A is a matrix (say 2x2 dimensions).
When I looked up in http://www.matrixcalculus.org/ I found the answer to be $(A.x)' + x'.A$ where $'$ stands for transpose.
I tried to solve this using $\frac{\partial (CB)}{\partial x} = \frac{\partial{C}}{\partial x}B + C\frac{\partial B}{\partial x}$ where $C = x'A$ and $B = x$. With this in perspective, I am getting the derivative as $A'x + x'A$.
Clearly with $x$ being a column vector and $A$ being a square matrix, my answer is wrong since individual terms ($A'x$ and $x'A$)have different shapes.
Where am I getting the calculations wrong. Any help ?