TITLE: Find the derivative of $h(x) = \min_{u \in [x,b]} f(u)$
QUESTION [5 upvotes]: Let $f:\mathbb{R}\rightarrow \mathbb{R}$ be a differentiable function. And let $b\in \mathbb{R}$ be a fixed number, consider the function $h:(-\infty,b]\rightarrow \mathbb{R} $ given by
\begin{equation} 
h(x) = \min_{u \in [x,b]} f(u) \end{equation}
I want to find $h'(x)$. Following the definition
\begin{equation}
h'(x) = \lim_{\epsilon \to 0} \frac{h(x+\epsilon)-h(x)}{\epsilon}
\end{equation}
then
\begin{equation}
h'(x) = \lim_{ \epsilon \to 0} \frac{\min_{u \in [x+\epsilon,b]} f(u)-\min_{u \in [x,b]} f(u)}{\epsilon}
\end{equation}
But at this point I don't know how to continue.
Do you think is possible to find $h'(x)$ without knowing an expression for $f(u)$? or
Do you know how to find $h'(x)$ using other technique?
Thanks in advance.

REPLY [5 votes]: Preliminary and Notation. The figure below displays an example of $h$. It will provide an insight on how $h'$ is related to the behavior of $f$ and $f'$.

This suggests that it might be convenient to study the right and left derivatives:
\begin{align*}
h_+'(x) &:= \lim_{y \to x^+} \frac{h(y) - h(x)}{y - x}, & 
h_-'(x) &:= \lim_{y \to x^-} \frac{h(y) - h(x)}{y - x}.
\end{align*}

Properties of $h'_{\pm}$. Note that $h \leq f$ always holds. Since both $f$ and $h$ are continuous, the set
$$ U = \{ x \in (-\infty, b) : h(x) < f(x) \} $$
is open. For each $t \in U$, we define $I_t$ as the connected component of $U$ containing $t$. Then $I(t)$ is an open interval, so we may write $I_t = (l_t, u_t)$. Then it is clear that $h$ is constant on each closed interval $\overline{I_t} = [l_t, u_t]\cap\mathbb{R}$. This immediately implies the next observation.
Lemma 1. For each connected component $I_t$ of $U$, we have the following.

$h_+'(x) = 0$ for all $x \in [l_t, u_t) \cap \mathbb{R}$;
$h_-'(x) = 0$ for all $x \in (l_t, u_t]$.

(Note: At this point, you can jump to the Conclusion part below before delving into the lemmas.)
Next, we define the set $F$ by
$$ F = (-\infty, b] \setminus U = \{x \in (-\infty, b] : h(x) = f(x) \}. $$
Note that $F$ is closed. Then the next two lemmas demonstrate how the one-sided derivatives of $h$ behave on $F$.
Lemma 2. Let $x_0 \in F$ be accumulated from the right in the sense that $(x_0, x) \cap F \neq \varnothing$ for any $x > x_0$. Then $h'_+(x_0) = f'(x_0)$.
Proof. Clearly we must have $x_0 < b$. Then for each $x > x_0$, we define $ c_x = \min (F \cap [x, b]) $. This is well-defined since $F\cap [x, b]$ is a non-empty compact set. Moreover,

If $x \in F$, then $h(x) = f(x)$ and $c_x = x$. So
$$ \frac{h(x) - h(x_0)}{x - x_0}
= \frac{f(x) - f(x_0)}{x - x_0}
= \frac{f(c_x) - f(x_0)}{c_x - x_0}. $$

If $x \notin F$, then $x \in (l_x, u_x)$ and hence $c_x = u_x$. Since $x < u_x$ and $h(x) = h(u_x) = f(u_x)$, we get
$$ \frac{h(x) - h(x_0)}{x - x_0}
\geq \frac{f(u_x) - f(x_0)}{u_x - x_0}
= \frac{f(c_x) - f(x_0)}{c_x - x_0}. $$



Together with $h \leq f$, these prove that
$$ \frac{f(x) - f(x_0)}{x - x_0} \geq \frac{h(x) - h(x_0)}{x - x_0} \geq \frac{f(c_x) - f(x_0)}{c_x - x_0} \quad \text{for } x > x_0. $$
Furthermore, since $x_0$ is accumulated from the right, $c_x \to x_0$ as $x \to x_0^+$. Therefore the desired conclusion follows by letting $x \to x_0^+$. $\square$
Lemma 3. Let $x_0 \in F$ be accumulated from the left in the sense that $(x, x_0) \cap F \neq \varnothing$ for any $x < x_0$. Then $h'_-(x_0) = f'(x_0)$.
Proof. Define $c_x = \min (F \cap [x, b])$ as before. Then arguing similarly as before, we find that
$$ \frac{f(x_0) - f(x)}{x_0 - x} \leq \frac{h(x_0) - h(x)}{x_0 - x} \leq \frac{f(x_0) - f(c_x)}{x_0 - c_x} \quad \text{for } x < x_0. $$
So by letting $x \to x_0^-$ and noting that $c_x \to x_0$ by the assumption, the desired claim follows. $\square$
Finally, we observe:
Lemma 4. If $x_0 \in F$ and $x_0 < b$, then $f'(x_0) \geq 0$.
Proof. Assume otherwise that $f'(x_0) < 0$. Then $h(x) \leq f(x) < f(x_0) = h(x_0)$ for any $x > x_0$ that is sufficiently close to $x_0$. This contradicts the fact that $h$ is non-decreasing. $\square$
Lemma 5. If $t \in U$ and $u_t < b$, then $f'(u_t) = 0$.
Proof. Since $u_t \in F$, Lemma 4 tells that $f'(u_t) \geq 0$. So it suffices to show that $f'(u_t) > 0$ is impossible.
Indeed, assume otherwise that $f'(u_t) > 0$. Then $f(x) < f(u_t)$ for any $x < u_t$ that is sufficiently close to $u_t$, which forces that $h(x) < h(u_t)$. However, this contradicts the fact that $h$ is constant on $[l_t, u_t] \cap \mathbb{R}$. $\square$

Conclusion. Let $U$ and $(l_t, u_t)$ for $t \in U$ be as before. Also, let $x_0 < b$.

If $x_0 = l_t$ for some $t \in U$ and $f'(x_0) > 0$, then
$$ h'_-(x_0) = f'(x_0) > 0 = h'_+(x_0), $$
and so, $h$ is not differentiable at $x_0$.

Otherwise, $h$ is differentiable at $x_0$ and satisfies
$$ h'(x_0) = \begin{cases} 0, & \text{if } h(x) < f(x), \\ f'(x), & \text{otherwise.} \end{cases} $$


Moreover, we have the following observations.

$h'_-(b) = \max\{0, f'_-(b)\}$.

$f'(u_t) = 0$ whenever $t \in U$ and $u_t < b$.