# Math Help - Hessian Matrix help

1. ## Hessian Matrix help

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

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