Hessian of a function with a symmetric matrix

hessian-matrixmatricesmultivariable-calculusoptimization

I have seen the following function defined

$ f(x,y) = \begin{bmatrix} x-x_0 \\ y-y_0 \end{bmatrix}^T A \begin{bmatrix} x-x_0 \\ y-y_0 \end{bmatrix}$

for a symmetric matrix A.

It then states the Hessian of the function is $H = A + A^T = 2A$

I understand that if a matrix is symmetric then $A + A^T = 2A$. However, I am completely confused how this Hessian is achieved. Can somebody explain why this is a property?

Best Answer

If $A=\left[\begin{smallmatrix}a&b\\c&d\end{smallmatrix}\right]$, then\begin{multline}f(x,y)=ax^2-2axx_0+ax_0^{\,2}+bxy+cxy-bx_0y-cx_0y+\\+dy^2-bxy_0-cxy_0+bx_0y_0+cx_0y_0-2dyy_0+dy_0^{\,2}.\end{multline}and the Hessian of this expression is$$\begin{bmatrix}2a&b+c\\b+c&2d\end{bmatrix}.$$And this is equal to$$\begin{bmatrix}a&c\\b&d\end{bmatrix}+\begin{bmatrix}a&b\\c&d\end{bmatrix}.$$

Related Question