Question about Riemann integral and total variation
Let $g$ be Riemann integrable on $[a,b]$, $f(x)=\int_a^x g(t)dt $ for $x \in[a,b]$.
Can I show that the total variation of $f$ is equal to $\int_a^b |g(x)| dx $?
Solution 1:
$\smash{\rlap{\phantom{\Bigg\{}}}\newcommand{\Var}{\mathrm{Var}}$ Break up $g(t)=g_+(t)-g_-(t)$ where $$ g_+(t)=\left\{\begin{array}{}g(t)&\text{if }g(t)\ge0\\0&\text{if }g(t)<0\end{array}\right.\tag{1} $$ and $$ g_-(t)=\left\{\begin{array}{}0&\text{if }g(t)\ge0\\-g(t)&\text{if }g(t)<0\end{array}\right.\tag{2} $$ Define $$ f_+(x)=\int_a^xg_+(t)\,\mathrm{d}t\tag{3} $$ and $$ f_-(x)=\int_a^xg_-(t)\,\mathrm{d}t\tag{4} $$ Then, $f(x)=f_+(x)-f_-(x)$, where $f_+$ and $f_-$ are montonic increasing.
Note that $$ |g(t)|=g_+(t)+g_-(t)\tag{5} $$ and $$ \Var_a^b(f)=\Var_a^b(f_+)+\Var_a^b(f_-)\tag{6} $$ In light of $(5)$ and $(6)$, assume that $g(t)\ge0$ and $f$ is monotonic increasing.
For any partition $P=\{t_i:0\le i\le n\}$ where $a=t_0\le t_{i-1}< t_i\le t_n=b$, define $$ \Var_{\lower{3pt}P}(f)=\sum_{i=1}^n|f(t_i)-f(t_{i-1})|\tag{7} $$ Since $g(t)\ge0$ and $f$ is monotonic increasing, for any partition of $[a,b]$, $$ \begin{align} \Var_{\lower{3pt}P}(f) &=\sum_{i=1}^n|f(t_i)-f(t_{i-1})|\\ &=\sum_{i=1}^nf(t_i)-f(t_{i-1})\\ &=f(b)-f(a)\\ &=\int_a^bg(t)\,\mathrm{d}t\\ &=\int_a^b|g(t)|\,\mathrm{d}t\tag{8} \end{align} $$ Combining $(5)$, $(6)$, and $(8)$, we can remove the restriction on $g$: $$ \int_a^b|g(t)|\,\mathrm{d}t=\mathrm{Var}_a^b(f)\tag{9} $$ for all Riemann integrable $g$, as required.
Detailed Explanation of $\mathbf{(6)}$:
The idea is that the increases in $f_+$ and $f_-$ are disjoint because $g(t)$ cannot be both positive and negative.
Given a partition of $[a,b]$, $P=\{t_i:0\le i\le n\}$ and its intervals $I_i=(t_{i-1},t_i)$, define the upper and lower Riemann sums as $$ {\sum_P}^+g=\sum_{i=1}^n\sup_{t\in I_i}g(t)\;|I_i|\quad\text{and}\quad{\sum_P}^-g=\sum_{i=1}^n\inf_{t\in I_i}g(t)\;|I_i|\tag{10} $$ Choose an $\epsilon>0$. Since $g$ is Riemann integrable, there is a partition of $[a,b]$, $P=\{t_i\}$ , so that $$ {\sum_P}^+g_+-{\sum_P}^-g_+<\epsilon\quad\text{and}\quad{\sum_P}^+g_--{\sum_P}^-g_-<\epsilon\tag{11} $$ Let $\mathcal{I}_\pm$ be the subcollection of $\{I_i\}$ where $\sup\limits_{I_i}g_+>0$ and $\sup\limits_{I_i}g_->0$. Since only one of $g_+(t)$ or $g_-(t)$ can be non-zero, we have that for $I_i\in\mathcal{I}_\pm$ $$ \inf\limits_{I_i}g_+=\inf\limits_{I_i}g_-=0\tag{12} $$ which implies that the lower Riemann sums of $g_+$ and $g_-$ restricted to $\mathcal{I}_\pm$ must be $0$: $$ {\sum_{\mathcal{I}_\pm}}^-g_+={\sum_{\mathcal{I}_\pm}}^-g_-=0\tag{13} $$ Thus, $(11)$ and $(13)$ imply that the upper Riemann sums of $g_+$ and $g_-$ restricted to $\mathcal{I}_\pm$ must be small: $$ {\sum_{\mathcal{I}_\pm}}^+g_+<\epsilon\quad\text{and}\quad{\sum_{\mathcal{I}_\pm}}^+g_-<\epsilon\tag{14} $$ Estimates $(14)$ show that $$ \Var_{\lower{3pt}\mathcal{I}_\pm}(f_+)<\epsilon\quad\text{and}\quad\Var_{\lower{3pt}\mathcal{I}_\pm}(f_-)<\epsilon\tag{15} $$ Let $\mathcal{I}_+$ be the subcollection of $I_i$ where $\sup\limits_{I_i}g_-=0$ and $\mathcal{I}_-$ be the subcollection where $\sup\limits_{I_i}g_+=0$. Then, $$ \Var_{\lower{3pt}\mathcal{I}_-}(f_+)=0\quad\text{and}\quad\Var_{\lower{3pt}\mathcal{I}_+}(f)=\Var_{\lower{3pt}\mathcal{I}_+}(f_+)>\Var_{\lower{3pt}P}(f_+)-\epsilon\tag{16} $$ $$ \Var_{\lower{3pt}\mathcal{I}_+}(f_-)=0\quad\text{and}\quad\Var_{\lower{3pt}\mathcal{I}_-}(f)=\Var_{\lower{3pt}\mathcal{I}_-}(f_-)>\Var_{\lower{3pt}P}(f_-)-\epsilon\tag{17} $$ Combining $(16)$ and $(17)$ yields $$ \begin{align} \Var_{\lower{3pt}P}(f) &\ge\Var_{\lower{3pt}\mathcal{I}_+}(f)+\Var_{\lower{3pt}\mathcal{I}_-}(f)\\ &>\Var_{\lower{3pt}P}(f_+)+\Var_{\lower{3pt}P}(f_-)-2\epsilon\tag{18} \end{align} $$ Since we can refine $P$ and make $\epsilon$ as small as we want, $(18)$ shows that $$ \Var_a^b(f)\ge\Var_a^b(f_+)+\Var_a^b(f_-)\tag{19} $$ The opposite inequality is immediate, so we get $(6)$.
Solution 2:
If $g$ is non-negative, $f$ is non-decreasing and the total variation is $f(b)-f(a)$ which coincides with $\int_a^b{|g(x)|}dx$, so the theorem is true.
For arbitrary $g$, write $g=g^+-g^-$, with at least one of $g^+(x)$ and $g^-(x)$ equal to 0.
Fix $\varepsilon>0$. There is a mesh $\delta^+>0$ such that for all partitions $a=x_0<\dots<x_n=b$ of $[a,b]$ finer than $\delta^+$ (i.e. $\max_i x_{i+1}-x_i\le\delta^+$), $$\sum_{i=1}^n (x_i-x_{i-1})\inf g^+([x_{i-1},x_i]) \ge \int_a^b{g^+(x)}dx - \varepsilon/2$$ We define $\delta^-$ symmetrically, and let $\delta=\min (\delta^+,\delta^-)$.
Now let's compute the total variation for a partition $x_0<\dots<x_n$ of $[a,b]$ finer than $\delta$: $$V=\sum_{i=1}^n |f(x_i)-f(x_{i-1})|$$ For any interval $I=[x_i,x_{i-1}]$, if $\inf g^+(I)>0$, then $g^+$ is always non-zero on this interval and $g^-$ must be identically zero. Then $$\begin{aligned} |f(x_i)-f(x_{i-1})| =&\int_I{g^+(x)}dx\\ \ge&(x_i-x_{i-1})\inf g^+([x_{i-1},x_i])\\ =&(x_i-x_{i-1})\inf g^+([x_{i-1},x_i]) + (x_i-x_{i-1})\inf g^-([x_{i-1},x_i]) \end{aligned}$$ The bound holds similarly when $\inf g^-(I)>0$. Finally when $\inf g^+(I)=\inf g^-(I)=0$, $$\begin{aligned} |f(x_i)-f(x_{i-1})| \ge&0\\ =&(x_i-x_{i-1})\inf g^+([x_{i-1},x_i]) + (x_i-x_{i-1})\inf g^-([x_{i-1},x_i]) \end{aligned}$$
So we can write $$V\ge \sum_{i=1}^n (x_i-x_{i-1})\inf g^+([x_{i-1},x_i]) + (x_i-x_{i-1})\inf g^-([x_{i-1},x_i])$$ and because the partition is finer than $\delta$: $$V \ge \left(\int_a^b{g^+(x)}dx - \varepsilon/2\right)+\left(\int_a^b{g^-(x)}dx - \varepsilon/2\right)$$ that is $$V \ge \int_a^b{|g(x)|}dx - \varepsilon$$
We also have the obvious upper bound $$V=\sum_{i=1}^n \left|\int_{x_{i-1}}^{x_i} {g(x)} dx\right|\le \sum_{i=1}^n \int_{x_{i-1}}^{x_i} {|g(x)|} dx = \int_a^b{|g(x)|}dx$$
Since this holds for all $\varepsilon$, the total variation (the upper bound of the total variation over all partitions) is precisely $\int_a^b{|g(x)|}dx$.