TITLE: Mean value theorem for a gradient of convex function
QUESTION [7 upvotes]: This is from an article, page 19. Let $J(u)=\sum \sqrt
 {u_i^2+\epsilon}$, and $p^{k+1}=\nabla J(u^{k+1})$, $p^{k}=\nabla
 J(u^{k})$. Since $J$ is convex, the mean value theorem tells us that
  $$p^{k+1}-p^{k} = D^{k+\frac{1}{2}}(u^{k+1}-u^k) $$ where
  $D^{k+\frac{1}{2}}$ is a diagonal matrix such that
  $$D^{k+\frac{1}{2}}_{i,i} = \epsilon
 ((u_i^{k+\frac{1}{2}})^2+\epsilon)^{-3/2}$$ for some
  $u^{k+\frac{1}{2}}$ between $u^k$ and $u^{k+1}$.

But I can't understand why there is such $D^{k+\frac{1}{2}}$. Let $f(u)=\sqrt {u^2+\epsilon}$, then $f'(u)=u/\sqrt{u^2+\epsilon}$, $f''(u)=\epsilon/\sqrt{u^2+\epsilon}^3$. I thought 2 implementation of MVT:
Method1: If we use MVT for components of $p^{k+1}-p^{k}$, then we obtain separately $u_i^{k+\frac{1}{2}}$, which is on the segment $[u_i^{k},u_i^{k+1}]$, but the whole $u^{k+\frac{1}{2}}$ may not be on the segment $[u^{k},u^{k+1}]$. I'm not sure the author meant this.
Method2: If we use MVT for $g(t)=\nabla J (u^{k+1}t + u^k (1-t))\cdot(u^{k+1}-u^k) = \sum \frac{u_i}{\sqrt{u_i^2+\epsilon}} (u_i^{k+1}-u_i^k)$, where $u_i=u_i^{k+1}t + u_i^k (1-t)$ then we have $g(1)-g(0)=g'(c) \Rightarrow (p^{k+1}-p^{k}) \cdot (u^{k+1}-u^k)= \sum \frac{\epsilon}{\sqrt{(u_i^{k+\frac{1}{2}})^2+\epsilon}^3}(u_i^{k+1}-u_i^k)^2$ where $u^{k+\frac 1 2}=u_i^{k+1}c + u_i^k (1-c)$ is on the segment $[u^{k},u^{k+1}]$. But how can we conclude that $p^{k+1}-p^{k} = D^{k+\frac{1}{2}}(u^{k+1}-u^k)$? Can we use convexity?
Summary: I want to know where to use MVT, and convexity.

REPLY [3 votes]: Given the $J$ he has, note
$$ \nabla J_i = \frac{u_i}{\sqrt{u_i^2 +\epsilon}} $$
Thus 
$$ \nabla^2 J_{ij} = \frac{\partial^2 J}{\partial u_i \partial u_j}= \delta_{ij} \left ( \frac{1}{\sqrt{u_i^2 +\epsilon}} - \frac{u_i^2}{(u_i^2 +\epsilon)^{3/2}}\right)=\frac{\delta_{ij} \epsilon}{(u_i^2 + \epsilon)^{3/2}}$$
The mean value theorem here is given by for $\nabla J_i$ is given by
$$ \nabla J_i (x) - \nabla J_i (y) = \nabla (\nabla J_i(u_i))\cdot  (x-y) $$
with $u_i$ between $x_i$ and $y_i$.  Thus 
$$ \nabla J (x) - \nabla J (y) = \nabla^2J(u)\cdot ( x-y) $$
NOTE that $u$ may not be on the line between $x$ and $y$. Convexity isn't really playing a direct role here, since you have a formula  for $J$. But you could probably make an argument in the general case using convex $\iff \nabla^2 J \geq 0$ (positive semi-definite).