# How to prove the property of convex function in higher dimension

Suppose $f:\mathbb{R}^n\mapsto \mathbb{R}$ is convex, could anyone tell me how to prove the following fact?

(1) If $f\in C^1$, then for any $u,v$

$$f(v)\geqslant \langle\nabla f(u),v-u\rangle$$

(2) If $f\in C^2$, then for any $u,v$ $$\langle\nabla^2f(u)v,v\rangle\geqslant0$$

-

Formally, for any point $a$ and any nonzero vector $w$ the function $\varphi(t) = f(a+tw)$ is convex on $\mathbb R$.
• If $f$ is $C^1$, then so is $\varphi$. We have $\varphi(t)-\varphi(0)=\varphi'(\xi)\,t>\varphi'(0)\,t$ by the Mean Value Theorem and because $\varphi'$ is increasing. In terms of $f$ this translates into the inequality you want.
• If $f$ is $C^2$, then so is $\varphi$. Consequently, $\varphi''(0)\ge 0$ which translates into the inequality you want.