Can you help me to compute the partial derivative $\frac{\partial g}{\partial x}$ of the following function ?
$g(x)=\frac{1}{2}(x-y)^TM(x-y)+h^2(\frac{1}{2}x^TLx-x^TJd+x^Tf_e)$
where :
$x,y,f_e\in\mathbb{R}^n$
$d\in\mathbb{R}^s$
$M,L\in\mathbb{R}^{n\times n}$ and symmetrics ($M=M^T$ and $L=L^T$)
$J\in\mathbb{R}^{n\times s}$
$h\in\mathbb{R}$
I've computed :
$\frac{\partial g}{\partial x}=(M+h^2L)x-h^2Jd+\frac{1}{2}My+h^2f_e$
Am I right ?
The basics derivatives are $$\nabla Ax=A\qquad\nabla x^TA=A^T\qquad\nabla x^TAx=x^T(A+A^T)$$ Then $$\nabla g(x)=\frac12(x-y)^T(M+M^T)+h^2\Big(\frac12x^T(L+L^T)-(Jd)^T+f_e^T\Big)\\=(x-y)^TM+h^2(x^TL-d^TJ^T+f_e^T)$$