# Is the Hessian of the 'generalized least square function' positive semi-definite?

Let $F:\mathbb{R}^n\rightarrow \mathbb{R}$ a scalar field which has a quadratic from,

$$F(\mathbf{x}) = \frac{1}{2}\mathbf{d}(\mathbf{x})^\top\Lambda\mathbf{d}(\mathbf{x})$$ with $\mathbf{d}:\mathbb{R}^n\rightarrow\mathbb{R}^m$ being a twice differentiable vector field, and $\Lambda\in \mathbb{R}^{m\times m}$ being a symmetric, positive semi-definite matrix. Thus, $F$ is the objective function in generalized least square problems such as Gauss-Newton. Let $\mathtt{J}_\mathbf{d}$ be the Jacobian of $\mathbf{d}$ and $\mathtt{H}_\mathbf{d}$ its second derivative, the $n\times m \times m$ Hessian tensor.

Due to the product rule, the first derivative of $F$ becomes: \begin{equation} \nabla F = \frac{1}{2}( \mathbf{d}(\mathbf{x})^{\top} \Lambda \mathtt{J}_ \mathbf{d}(\mathbf{x}) )^\top + \frac{1}{2}( \mathtt{J}_ \mathbf{d} (\mathbf{x})^{\top} \Lambda \mathbf{d}(\mathbf{x}) = \mathtt{J}_\mathbf{d}(\mathbf{x})^{\top} \Lambda \mathbf{d}(\mathbf{x}), \end{equation} using the fact that $\Lambda$ is symmetric. Again by means of the product rule, the second derivation or Hessian of $F$ is \begin{equation} \mathtt{H}_F (\mathbf{x}) = \mathtt{J} _\mathbf{d}(\mathbf{x})^\top \Lambda \mathtt{J} _ \mathbf{b}(\mathbf{x}) + \mathtt{H}_\mathbf{d}(\mathbf{x}) \Lambda \mathbf{d}(\mathbf{x}), \end{equation} right?

Question: Is $\mathtt{H}_F$ is positive semi-definite?

It isn't (you have proven it yourself). Take $n=m=1$, $d(x) = 1-x^2$ and $\Lambda =1$. Then we have $$F(x) = d(x)^2/2 = (1-x^2)^2/2$$ and the Hessian is given by $$H_F(x) = \frac{d^2}{dx^2} F(x) = -2x ( 1-x^2)$$ which is smaller than 0 for $0<x<1$ and $x<-1$.