Bounding $\|f(a)-f(b)\|$ for $a,b$ in the unit ball Let $f:\Bbb{R}^3 \to \Bbb{R}$ be given by 
$$f(x,y,z) = x^2 +\cos(xyz) -z^2$$
I want to show that for any $a,b \in B(0,1)$ (the unit open ball around the origin) $$\|f(a)-f(b)\|\le 2\sqrt{5}$$
In a addition I wonder if this is the best bound I could get? 
My attempt: 
I know $f(a+h) \approx f(a) + \nabla f(a) \cdot h$.  If i put $h = b-a$ then I get 
$$\|f(b)-f(a)\| \approx \|\nabla f(a) \cdot h\| \le \|\nabla f(a)\|\|b-a\|$$
by Cauchy Schwarz. The distance between $b$ and $a$ is less than $2$ so can I show that the magnitude of the gradient is bounded above by $\sqrt 5$? But I think there is a better way to find the bound because when I use "$\approx$" I am not really sure if it is a lower or upper bound, and furthermore I know the approximation is only good when $h$ (or $b-a$) is pretty small. 
 A: If I'm reading the problem correctly, elementary algebra is all that's needed . . .

Let $B(0,1)$ denote the standard open unit ball in $\mathbb{R}^3$, and let $B[0,1]$ denote the standard closed unit ball in $\mathbb{R}^3$.

For $(x,y,z)$ in $B[0,1]$, let $f(x,y,z) = x^2 + \cos(xyz) - z^2$

The goal is to show $|f(a) - (b)| \le 2\sqrt{5}$ for all $a,b \in B(0,1)$.

Let $M$ be the maximum value of $f$ on $B[0,1]$, and let $m$ be the minimum value of $f$ on $B[0,1]$.

Since $f$ is continuous, the following statements are equivalent:


*

*$|f(a) - (b)| \le 2\sqrt{5}$ for all $a,b \in B(0,1)$.$\\[4pt]$

*$M - m  \le 2\sqrt{5}$.$\\[4pt]$


Evaluating $M$ is easy . . .

For $(x,y,z) \in B[0,1]$, we have


*

*$x^2 \le 1$.$\\[4pt]$

*$\cos(xyz) \le 1$.$\\[4pt]$

*$-z^2 \le 0$.


It follows that $M = f(1,0,0) = 2$.

For a crude lower on bound $m$, we have


*

*$x^2 \ge 0$.$\\[4pt]$

*$\cos(xyz) > 0$.$\\[4pt]$

*$-z^2 \ge -1$.


It follows that $m > -1$.

Thus, we have $M - m < 3 < 2\sqrt{5}$.
A: Your approach is fine.
By the mean value theorem exists $ a \in B(0,1) $ such that
$$ \|f(b)-f(a)\| \le \|\nabla f(a)\|\|b-a\| < 2 \|\nabla f(a)\| $$
Having in mind that $ x^2 + y^2 + z^2 < 1 $ we can bound $ \|\nabla f(a)\| $ as follows
$$ \begin{align}
\|\nabla f(a)\| &= \sqrt{\left(x^2 \left(y^2+z^2\right)+y^2 z^2\right) \sin(x y z)^2 +4 \left(x^2+z^2\right)} \\
&< \sqrt{ \left(x^2 \left( 1-x^2 \right) + y^2 z^2\right) \sin(x y z)^2 + 4 \left( 1 - y^2 \right)} \\
\end{align} $$
Now since
$$ x^2 \left( 1-x^2 \right) \le \frac{1}{4} $$
$$ y^2 z^2 \le \frac{1}{4} $$
$$ \sin(x y z)^2 < 1 $$
and
$$ 1 - y^2 \le 1 $$
then
$$ \begin{align}
\|\nabla f(a)\| &< \sqrt{ \left( \frac{1}{4} + \frac{1}{4} \right) \cdot 1 + 4 \cdot 1} \\
&< \sqrt{5}
\end{align} $$
As you wanted to show.
Furthermore I have a strong intuition that we can lower the upper bound to $\require{enclose}\enclose{horizontalstrike}{\|f(a)-f(b)\| \le 1} $ $ \|f(a)-f(b)\| \le 2 $ and that it occurs in the boundary of the unit ball. But for that we would need Lagrange multipliers.
