Question: I'm reading the book "Numerical Optimization" by Nocedal and Wright and on page 14 of the book they present a form of the multivariate Taylor theorem which I find to be a bit peculiar. It is stated that if $f:\mathbb{R}^{n}\to\mathbb{R}$
 is twice continuously differentiable then $$\nabla f\left(x+p\right)=\nabla f\left(x\right)+\int\limits \_{0}^{1}\nabla^{2}f\left(x+tp\right)pdt$$
This strikes me as a bit odd since both of those gradients are vector valued but that integral seems like it should be a scalar... I'd appreciate it if someone could clarify what exactly do the authors mean by this equation.

Answer: 
$\nabla^2 f(x+tp)$ is an operator (called [hessian matrix](https://en.wikipedia.org/wiki/Hessian_matrix)), 
Therefore $\nabla^2 f(x+tp) p$ is a vector-valued function and its integration is too.
The Laplace operator in the integral remainder only acts on $f$, not on the vector $p$.