# Thread: Hessian Matrix help

1. ## Hessian Matrix help

I need to calculate the Hessian matrix for this function in "very simple terms":

$\displaystyle f(x) = (Ax \cdot x)e^{||x||^{2}}$.

I have no idea how to do it in "simple terms."

If you could either help me get started or tell me the answer, I could do the rest.

2. ## Re: Hessian Matrix help

Let $\displaystyle g(x)=x^tAx, h(x)=e^{x^tx}$. Then for any vector $\displaystyle v$, and real number s, we have
$\displaystyle g(x+sv)=g(x)+s v^t(A+A^t)x+s^2v^tAv$
$\displaystyle h(x+sv)=e^{x^tx+2sx^tv+s^2v^tv}=h(x)e^{2sx^tv+s^2v ^tv}$
=$\displaystyle h(x)[1+2sx^tv+s^2v^tv+(2sx^tv+s^2v^tv)^2/2+o(s^2)]$
=$\displaystyle h(x)+2sh(x)x^tv+s^2h(x)[v^tv+2(x^tv)^2]+o(s^2)$
Then the $\displaystyle s^2$ term of $\displaystyle f(x+sv)=g(x+sv)h(x+sv)$ is
$\displaystyle g(x)h(x)[v^tv+2(x^tv)^2]+2v^t(A+A^t)xh(x)x^tv+v^tAvh(x)$
=$\displaystyle v^t[ g(x)h(x)(I+2xx^t)+2h(x)(A+A^t)xx^t+h(x)A]v$
So the hessian is $\displaystyle 2h(x)[g(x)I+2(g(x)I+A+A^t)xx^t+A]$