Derivative of positive part of a function Let $f,g: A \to \mathbb{R}$ be two continuous functions defined on a compact subset $A \subset R^{2}$. Define $H:\mathbb{R}^{+} \to \mathbb{R}$ by $$H(\epsilon):=\int\int_{A}(f+\epsilon g)^{+}\mathrm{d}y\mathrm{d}x$$ where the plus superscript represents the positive part of a function, i.e. $$(f+\epsilon g)^{+} = \mathrm{max}_{(x,y) \in A} \{f+\epsilon g,0\}$$
Strictly prove (by using definition of derivative) that $H$ is differentiable at $\epsilon=0$ and calculate $H'(0)$.
My approach: We have $$\lim_{\delta \to 0}\frac{H(\delta)-H(0)}{\delta} =\lim_{\delta \to 0}\int\int_{A} \frac{(f+\delta g)^{+}-f^{+}}{\delta}\mathrm{d}y\mathrm{d}x =\lim_{\delta \to 0}\int\int_{A} \frac{\delta g+|f+\delta g|-|f|}{2\delta}\mathrm{d}y\mathrm{d}x = \lim_{\delta \to 0}\int\int_{A} \frac{g}{2}+\frac{|f+\delta g|-|f|}{2\delta}\mathrm{d}y\mathrm{d}x $$
Note I have used $f^{+}=\frac{|f|+f}{2}$ for converting the positive parts to absolute values.
Then I tried to use triangle inequality to squeeze the limit, e.g. $$\frac{g}{2}+ \frac{|f+\delta g|-|f|}{2\delta} \leq \frac{g}{2}+ \frac{|f|+|\delta g|-|f|}{2\delta} =g^{+}$$ and similarly one can show $-g^{-} =\mathrm{min}_{(x,y)\in A}\{g,0\}$ to be a lower bound. But these bounds are not sharp enough for computing the limit.
 A: A promising attempt (subject to be made rigorous):
First of all it's clear that $$\lim_{\delta \to 0}\frac{(f(z)+\delta g(z))^{+}-f^{+}(z)}{\delta} = g^{+}(z) $$ for each fixed $z \in f^{-1}\{0\}$, for each $z \in f^{-1}(-\infty,0) $  the limit is $0$, for each $\z \in f^{-1}(0,\infty)$ the limit is $g(z)$.
We next need to clarify for $$\lim_{\delta \to 0}\int_{A}\frac{(f(z)+\delta g(z))^{+}-f^{+}(z)}{\delta}\mathrm{d}z = \int_{A}\lim_{\delta \to 0}\frac{(f(z)+\delta g(z))^{+}-f^{+}(z)}{\delta}\mathrm{d}z$$
I think here is where a Dominated Convergence Theorem (DCT) is needed. Is there a DCT which permits interchange the pointwise limit and $\int$?
(Note that our limit is of the form $\lim_{\delta \to 0}$ rather than something like $\lim_{n \to \infty}f_n$, the later one has got an associated well-known DCT )
A: The trick is to split $A$ into parts where both $f$ and $g$ have constant sign, and then look at each part separately. Let
$$\begin{gather}
P_f = \{ x \in A : f(x) > 0\}\\
Z_f = \{ x \in A : f(x) = 0\}\\
N_f = \{ x \in A : f(x) < 0\}
\end{gather}$$
and similarly for $g$.
On $(Z_f \cup N_f) \cap (Z_g \cup N_g)$, we have $(f + \varepsilon g)^+ = 0$ for all $\varepsilon \geqslant 0$, so that part does not contribute anything.
On $B := (P_f \cup Z_f) \cap (P_g \cup Z_g)$ (we have duplicated $Z_f \cap Z_g$, but that doesn't contribute anything, so it doesn't matter), we have $(f + \varepsilon g)^+ = f + \varepsilon g$ for all $\varepsilon \geqslant 0$, so that part contributes
$$\frac{H_B(\varepsilon) - H_B(0)}{\varepsilon} = \frac{1}{\varepsilon} \left(\int_B (f + \varepsilon g) - \int_B f\right) = \int_B g,$$
the difference quotient is independent of $\varepsilon$, so that part is very easy.
Now the two parts $P_f \cap N_g$ and $N_f \cap P_g$ remain.
Let's consider $C := P_f \cap N_g$ first. On $N_g$, write $h = -g$. For $\varepsilon > 0$, let $C_\varepsilon = \{ x \in C : f(x) < \varepsilon h(x) \}$. On $C$, we then have $(f + \varepsilon g)^+ = (f - \varepsilon h)^+ = (f-\varepsilon h)\cdot (1 - \chi_{C_\varepsilon})$, and hence
$$\begin{align}
\frac{H_C(\varepsilon) - H_C(0)}{\varepsilon} &= \frac{1}{\varepsilon}\left(\int_C (f-\varepsilon h)^+ - \int_C f\right)\\
&= \frac{1}{\varepsilon}\left(\int_C (f-\varepsilon h) - \int_{C_\varepsilon} (f - \varepsilon h) - \int_C f\right)\\
&= -\int_C h + \frac{1}{\varepsilon}\int_{C_\varepsilon} (\varepsilon h - f)\\
&= \int_C g + \int_{C_\varepsilon} \left(h - \frac{f}{\varepsilon}\right).
\end{align}$$
By definition of $C_\varepsilon$, the integrand $h - f/\varepsilon$ is positive on $C_\varepsilon$, and since $f$ is positive on $C$, it is smaller than $h$, hence
$$0 \leqslant \int_{C_\varepsilon} (h - f/\varepsilon) \leqslant \int_{C_\varepsilon} h \to 0,$$
since $C_\varepsilon$ is shrinking to $\varnothing$.
On $D := N_f \cap P_g$, we argue similarly, with $D_\varepsilon = \{x \in D : \lvert f(x)\rvert < \varepsilon g(x)\}$, we have
$$(f + \varepsilon g)^+ = (f + \varepsilon g) \cdot \chi_{D_\varepsilon}$$
on $D$ and
$$\frac{H_D(\varepsilon) - H_D(0)}{\varepsilon} = \int_{D_\varepsilon} g + f/\varepsilon \to 0$$
since the integrand is sandwiched between $0$ and $g$, and $D_\varepsilon$ shrinks to $\varnothing$.
Altogether we obtain
$$\lim_{\varepsilon \to 0^+} \frac{H(\varepsilon) - H(0)}{\varepsilon} = \int_{B \cup C} g.$$
A: Okay! Now that we know what $H$ is, this should be doable. You're going to want to partition $A$ into two measurable sets: the closed set $f^{-1}([0,\infty))$ and the open set $f^{-1}((-\infty,0))$. Everything is easy on the first set. The second set will turn out to contribute zero to the derivative; the trick will be to show that its contribution to $H(\epsilon)$ decreases fast enough.
A: I think that the statement is false without additional assumptions on $f$ and/or $g$.
Consider the case $f(x,y)\equiv0$. Then
$$H(\epsilon)-H(0)=\int\nolimits_A (\epsilon g)^+\ {\rm d}(x,y)= \cases{\epsilon \int\nolimits_A g^+\ {\rm d}(x,y)\quad&$(\epsilon>0)$ \cr
-\epsilon \int\nolimits_A g^-\ {\rm d}(x,y)\quad&$(\epsilon<0)$ \cr}\ .$$
It follows that
$${H(\epsilon)-H(0)\over\epsilon}=\cases{\int\nolimits_A g^+\ {\rm d}(x,y)\geq0\quad&$(\epsilon>0)$ \cr -\int\nolimits_A g^-\ {\rm d}(x,y)\leq0\quad&$(\epsilon<0)$ \cr}\ .$$
It follows that the limit $H'(0)$ does not exist unless the two last integrals are both zero, which would imply $g(x,y)\equiv0$.
