If I take $\frac{d}{dx}[ x^T x]$ for some vector $x=[x_1,x_2..]^T$. I can use the product rule to get $\frac{d}{dx}[x^T]x+x^T \frac{d}{dx}[x]$. and then by taking the transpose out of the derivative $(\frac{d}{dx}[x])^T x+x^T d/dx[x]=I^Tx+x^TI=x+x^T$.
Clearly I am making a mistake because these matrices have different dimensions. What am I doing wrong?