Let $U \subset \mathbb{R}^d$ be a convex open set. Suppose a continuously differentiable vector-valued function $f : U \to \mathbb{R}^d$ satisfies that its derivative $D f : U \to \mathbb{R}^{d \times d}$ is symmetric and positive semidefinite. Is there a convex function $\varphi : U \to \mathbb{R}$ such that $\nabla \varphi = f$?
I guess the answer is yes. I attempted to show that $f$ is cyclically monotone, but I could show only the monotonicity as follows. Let $x_1, \dots, x_k \in U.$ Then, Taylor's theorem says $$ f(x_{i+1}) = f(x_i) + \left( \int_0^1 D f ((1 - s) x_i + s x_{i+1}) d s \right) (x_{i+1} - x_i) . $$ Thus, we have $$ (x_{i+1} - x_i)^\prime (f(x_{i+1}) - f(x_i)) = (x_{i+1} - x_i)^\prime \left( \int_0^1 D f ((1 - s) x_i + s x_{i+1}) d s \right) (x_{i+1} - x_i) \geq 0 $$ by the positive semidefiniteness of $D f.$
In this proof, the symmetry of $D f$ is not used, but I am not sure how it helps.
EDIT: If $f$ is the gradient of some function, the monotonicity implies that the antiderivative is convex, but I am not assuming that $f$ is a gradient. Also, if $f$ is linear, p.240 of Rockafellar's book claims the answer is yes. I would like to know what happens if $f$ is nonlinear.