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](https://math.stackexchange.com/questions/547239/total-variation-of-continuous-differentiable-function) but it is NOT clear .