Solution (source code)

= Solution

Put $q(x)=x^TAx$ and $t(x)=x^Tb$. The <product rule> gives
$$
\boxed{\nabla h(x)=2t(x)Ax+q(x)b.}
$$
Differentiate each term. The <derivative> of $2tAx$ is $2(Ax)b^T+2tA$, while that of $qb$ is $2b(Ax)^T$. Hence
$$
\boxed{H_h(x)=2(x^Tb)A+2(Ax)b^T+2b(Ax)^T.}
$$
The last two terms are transposes of each other, so this <Hessian matrix> is symmetric, as expected.