I am new into vector calculus and I want to calculate the following: $\nabla_c(-2x^TDc+c^Tc)=-2D^Tx+2c$.
I used the intuitive way for $u(c)=c^Tc$ and got
$u(c+h)=(c+h)^T(c+h)=u(c)+2h^Tc+h^Th$. $u(c+h)-u(c) = 2h^Tc+h^Th$.
The first term is linear in $c$ with factor $2h^T$ and the second term is quadratic, i.e. unimportant for small h. Therefore $u'(c)=2c$
I tried it the same way for $u(c)=-2x^TDc$ and got
$u(c+h)=-2x^TD(c+h)=-2x^TDc-2x^TDh=u(c)-2x^TDh$
So $u(c+h)-u(c)=-2x^TDh$ and for small $h$ it should be $u'(c)=-2x^TD$
What am I doing wrong in the first term?