Total variation of a continuously differentiable function Let $f\in C^1[0,1]$. For a partition $\mathcal {P} :0=a_0<a_1<\cdots <a_n=1$ , define $$S(\cal P)=\sum_{k=1}^n|f(x_k)-f(x_{k-1})|.$$Compute the supremum of $S(\cal P)$ over all possible partitions of $[0,1]$.
Here , $\displaystyle \sup_{\cal P}S(\cal P)$ is the total variation of he function $f$ in $[0,1]$. But if the function is unknown how we find the total variation ?
I saw this but it is NOT clear .
 A: Given any subinterval $[x,y]\subset [0,1]$ one has $|f(y)-f(x)|\leq \int_x^y |f'(t)|\>dt$. Therefore we at once obtain for any partition ${\cal P}$ of $[0,1]$ the estimate
$$S({\cal P}):=\sum_{k=1}^n|f(x_k)-f(x_{k-1})|\leq\int_0^1|f'(t)|\>dt\ .$$
Since the right hand side does not depend on the chosen ${\cal P}$ we can can conclude that
$$V_{[0,1]}(f):=\sup_{\cal P}S({\cal P})\leq\int_0^1|f'(t)|\>dt\ .\tag{1}$$
In reality we have equality here: Looking at the graph of a reasonable $f$ we  immediately realize that $V_{[0,1]}(f)$ is the sum of all "infinitesimal changes" of $f$ added up with a positive sign. For the proof, however, we need the continuity of $f'$ over the whole interval $[0,1]$.
Given an $\epsilon>0$ there is a partition  ${\cal P}$ with $|f'(x)-f'(y)|\leq \epsilon$ for any two points $x$, $y$ in the same subinterval of ${\cal P}$. Using this partition ${\cal P}$ we have for each subinterval $[x_{k-1},x_k]$ the estimate
$$\eqalign{\int_{x_{k-1}}^{x_k}|f'(t)|\>dt&\leq\bigl( |f'(x_k)|+\epsilon\bigr)(x_k-x_{k-1})\cr &=\left|\int_{x_{k-1}}^{x_k} f'(x_k)\>dt\right|+\epsilon(x_k-x_{k-1})\leq\left|\int_{x_{k-1}}^{x_k} f'(t)\>dt\right|+2\epsilon(x_k-x_{k-1})\cr
&=|f(x_k)-f(x_{k-1})|+2\epsilon(x_k-x_{k-1})\ .\cr}$$
Summing over $k$ we obtain
$$\int_0^1|f'(t)|\>dt=\sum_{k=1}^n\int_{x_{k-1}}^{x_k}|f'(t)|\>dt\leq S({\cal P})+2\epsilon\leq V_{[0,1]}(f)+2\epsilon\ .$$
Since $\epsilon>0$ was arbitrary this together with $(1)$ proves that indeed
$$V_{[0,1]}(f)=\int_0^1|f'(t)|\>dt\ .$$
The above argument is valid for vector-valued functions $f$ as well, and proves that the "geometrically defined" length of a $C^1$-curve in ${\mathbb R}^n$ is given by the well-known formula.
A: The other answer given treats the question elegantly.  However, being as fussy as I am, I can't help but take advantage of the opportunity to generalize.  Do we need continuity of the derivative?  Is the problem  much harder if you just assume integrability instead?

Assume that $f:[0,1]\to\mathbb{R}$ is differentiable and $|f'|$ is
  integrable (either Riemann or Lebesgue).  Prove
  $$V(f,[a,b])=\int_0^1 |f'(x)|\,dx.$$ 
[Note: The existence of $f'$
  everywhere is not enough to obtain the integrability of $|f'|$ in
  general.  Even if $|f'|$ is bounded it may not be Riemann integrable,
  even if $f$ is differentiable $|f'|$ may not be Lebesgue integrable.]

FTC (either for the Riemann integral or the Lebesgue integral)
 gives the inequality in one direction.
For the other direction, let $\epsilon>0$.  Since $f$ is differentiable there is, for each $x$, a  $\delta_1(x)>0$ 
 so that, provided $0<|y-x|<\delta_1(x)$,
 $$
 \left|  \frac{f(y)-f(x)}{y-x} -f'(x)  \right|  < \frac\epsilon{2(b-a)}. \ \ \ \ \ (A)
 $$
 Since $|f'|$ is integrable (assuming either Riemann or Lebesgue) there is a $\delta_2(x)>0$ for each $x$ so that
 $$
 \left| \sum_{i=1}^n | f'(\xi_i)| (x_i- x_{i-1})
 -\int_0^1 |f'(x)|\,dx  
  \right|  < \epsilon/2 \ \ \ \ \ \ (B)
  $$
  whenever   $\{([x_{i-1},x_i],\xi_i)\}$ is a partition  of $[a,b]$   finer than $\delta_2$. [Means only that $0<x_i-x_{i-1}<\delta_2(\xi_i)$.]
By Cousin's Covering Lemma, there must exist a partition  $\{([x_{i-1},x_{i}],\xi_i)\}$ of $[a,b]$   finer than $\delta=\min\{\delta_1,\delta_2\}$. Then, by (A), we have each
 $$
|f'(\xi_i)| - \left| \frac{f(x_i)-f(x_{i-1})}{ x_i- x_{i-1}}   \right|
\leq
 \left| \frac{f(x_i)-f(x_{i-1})}{ x_i- x_{i-1}} -f'(\xi_i)  \right|  < \frac\epsilon{2(b-a)} 
  $$
and so 
 $$
  \sum_{i=1}^n |f(x_i)-f(x_{i-1})|
 > \sum_{i=1}^n | f'(\xi_i)|(x_i- x_{i-1})  -\epsilon/2.
 $$
 Thus, by (B), 
  $$
V(f,[a,b])\geq    \sum_{i=1}^n |f(x_i)-f(x_{i-1})|
  > \int_0^1 |f'(x)|\,dx  -\epsilon 
  $$
Note: For the Riemann integral the function $\delta_2$ is just a constant.  Cousin's covering lemma can be, has been, and should be taught in an elementary analysis course.  So the proof is not advanced in this case, and not hard even for the Lebesgue integral if you know this characterization.
