I wrote this so far for a help: Just reading the definition in Wikipedia, I can give you some ideas:
$$V_a^b\left( f \right) = \mathop {\sup }\limits_P \sum\limits_{i = 0}^{{n_P} - 1} {\left| {f\left( {{x_{i + 1}}} \right) - f\left( {{x_i}} \right)} \right|} $$
where $\sup$ runs over the set of all partitions $P$ of $[a,b]$,
$$\mathcal P=\{P=\{x_0,\dots, x_{n_P}\}:P\text{ is a partition of }[a,b]\}$$
If $f$ differentiable in $[a,b]$ then it is continuous and we can apply the MVT, which means