$G'(0) = \int_{[0,1] \backslash Z(g)} h(x) \cdot \text{sign}(g(x)) \mathrm{d}x$ Today during an exam I got the following exercise :

Let $h, g \in C^0([0,1], \| \cdot \|_1)$ such that the set : $Z(g) = \{x \in [0,1] \mid g(x) = 0\}$ is a finite union of intervals. Then let's defined :
$$ G : t \mapsto \| g + th \|_1$$
If the function $G$ has a derivative at $0$ prove that :
$$G'(0) = \int_{[0,1] \backslash Z(g)} h(x) \cdot sign(g(x)) \mathrm{d}x$$

First of all I don't understand how $G$ is defined because do we consider that :
$$G(t) = \int_{[0,1]} \mid g(x) + th(x) \mid \mathrm{d}x$$
Or we consider that :
$$G(t) = \int_{[0,1]} \mid g(t) + th(t) \mid \mathrm{d}t$$
?
Then I tried considering :
$$\frac{G(h) - G(0)}{h}$$
In order to find the derivative. Yet the $\mid \cdot \mid$ make the task not so easy.
So I tried the to split the integrand and study the part : $\int_{Z(g)}$
I get (using the second interpretation of $G$) :
$$\frac{\int_{Z(g)} \mid th(t) \mid \mathrm{d}t}{t} $$
But it doesn't seem to help...
 A: It has to be
$$G(t)=\int_0^1|g(x)+th(x)|\,dx $$
otherwise $G(t)$ does not depend on $t$. We have
$$\frac{G(t)-G(0)}{t}=\int_0^1\frac{|g(x)+th(x)|-|g(x)|}{t}\,dx= $$
By triangle inequality,
$$\frac{|g(x)+th(x)|-|g(x)|}{t}\leq |h(x)|\in L^1(0,1) $$
Thus by dominated convergence, if $G'(0)$ exists, then
$$G'(0)=\int_0^1\lim_{t\to 0} \frac{|g(x)+th(x)|-|g(x)|}{t}\,dx$$
Now we distinsguish three cases.

*

*If $g(x)=0$, i.e. $x\in Z_g$, then  $$ \lim_{t\to 0} \frac{|g(x)+th(x)|-|g(x)|}{t}=\lim_{t\to 0}\frac{|t|h(x)}{t}$$
Notice that the above limit exists if and only if $h(x)=0$, and in this case, it is equal to $0$. Recall that we are assuming that $G'(0)$ exists. Now suppose by contradiction that there existed an $x_0\in [0,1]$ such that $g(x_0)=0$ but $h(x_0)\neq 0$. Since $Z_g$ is a finite union of intervals, we have $x_0\in [a,b]$ with $g(x)=0$ on $[a,b]$. Moreover, since $h(x_0)\neq 0$ and $h$ is continuous, we have $h(x)\neq 0$ on $(x_0-\varepsilon,x_0+\varepsilon)\subset [a,b]$. Thus the above limit does not exist on a  whole interval $(x_0-\varepsilon,x_0+\varepsilon)$ (not just on $x_0$!). This implies that $G'(0)$ is not defined, contradicting our assumption. Therefore the above limit always exists and is equal to $0$.

*

*If $g(x)>0$, then for $t$ small enough we have $g(x)+th(x)>0$. Thus
$$\lim_{t\to 0} \frac{|g(x)+th(x)|-|g(x)|}{t}=\lim_{t\to 0} \frac{g(x)+th(x)-g(x)}{t}=h(x)=h(x)\cdot\operatorname{sign}(g(x))$$


*Similarly, if $g(x)<0$ then
$$\lim_{t\to 0} \frac{|g(x)+th(x)|-|g(x)|}{t}=\lim_{t\to 0} \frac{-g(x)-th(x)+g(x)}{t}=-h(x)=h(x)\cdot\operatorname{sign}(g(x))$$
Hence
$$G'(0)=\int_{[0,1]\setminus Z_g}h(x)\cdot \operatorname{sign}(g(x))\,dx $$
