We are given a function $f :\mathbb{R}^{n} \rightarrow \mathbb{R}$ such that:
$\nabla{f}(x) = Px$
where $P \in M_{n \times n}$ is an $n \times n$ matrix, and $x \in \mathbb{R}^{n}$.
What is the Hessian?
I believe the Hessian is simply $P$, but want to confirm this to be the case.
If $x = (x_{1}, \ldots , x_{n}) \in \mathbb{R}^{n}$, and suppose we are given that that $\nabla f(x) = P x$, where $P = (P_{ij})$, $1 \leq i, j \leq n$ is an $n\times n$ matrix. Then we are given that $$\frac{\partial f}{\partial x_{k}}(x) = P_{k1}x_{1} + P_{k2} x_{2} + \ldots + P_{kn} x_{n}, $$ for each $1 \leq k \leq n$. We see then that $$ \frac{\partial^{2} f}{\partial x_{l}\partial x_{k}}(x) = P_{kl} $$ and so the Hessian is $$ \text{Hess}f = \bigg( \frac{\partial^{2} f}{\partial x_{i}\partial x_{j}} \bigg) = (P_{ji}) = P^{T}, $$ the transpose of the original matrix $P$. Please let me know if anything seems off, as this is my first time seeing this question.