We consider a function $f : \mathbb{R}^n \rightarrow \mathbb{R}$. a. For all $x, y \in \mathbb{R}^n$, let $\varphi_{x,y} : \mathbb{R} \rightarrow \mathbb{R}$ be the function defined by $\varphi_{x,y}(t) = f(x + t(y-x))$ for all $t \in \mathbb{R}$. Show that $f$ is convex if and only if for all $x, y \in \mathbb{R}^n$, $\varphi_{x,y}$ is convex. b. Suppose that $f$ is differentiable on $\mathbb{R}^n$. Show that for all $x, y \in \mathbb{R}^n$, the function $\varphi_{x,y}$ is differentiable, and show that for all $t \in \mathbb{R}$, $\varphi_{x,y}^{\prime}(t) = \langle \nabla f(x + t(y-x)), y-x \rangle$. c. Deduce that if $f$ is differentiable on $\mathbb{R}^n$, then $f$ is convex if and only if for all $x, y \in \mathbb{R}^n$, $$f(y) \geqslant f(x) + \langle \nabla f(x), y-x \rangle.$$ d. Show that if $f : \mathbb{R}^n \rightarrow \mathbb{R}$ is differentiable on $\mathbb{R}^n$, then $f$ is convex if and only if for all $x, y \in \mathbb{R}^n$, $$\langle \nabla f(y) - \nabla f(x), y-x \rangle \geqslant 0.$$
We consider a function $f : \mathbb{R}^n \rightarrow \mathbb{R}$.\\
a. For all $x, y \in \mathbb{R}^n$, let $\varphi_{x,y} : \mathbb{R} \rightarrow \mathbb{R}$ be the function defined by $\varphi_{x,y}(t) = f(x + t(y-x))$ for all $t \in \mathbb{R}$. Show that $f$ is convex if and only if for all $x, y \in \mathbb{R}^n$, $\varphi_{x,y}$ is convex.\\
b. Suppose that $f$ is differentiable on $\mathbb{R}^n$. Show that for all $x, y \in \mathbb{R}^n$, the function $\varphi_{x,y}$ is differentiable, and show that for all $t \in \mathbb{R}$, $\varphi_{x,y}^{\prime}(t) = \langle \nabla f(x + t(y-x)), y-x \rangle$.\\
c. Deduce that if $f$ is differentiable on $\mathbb{R}^n$, then $f$ is convex if and only if for all $x, y \in \mathbb{R}^n$,
$$f(y) \geqslant f(x) + \langle \nabla f(x), y-x \rangle.$$
d. Show that if $f : \mathbb{R}^n \rightarrow \mathbb{R}$ is differentiable on $\mathbb{R}^n$, then $f$ is convex if and only if for all $x, y \in \mathbb{R}^n$,
$$\langle \nabla f(y) - \nabla f(x), y-x \rangle \geqslant 0.$$