Let the total variation be defined as:
$ \displaystyle{ TV=\int_{-\infty}^{\infty} \left |\frac{\partial f}{\partial x} \right | dx }. $
For the function,
$ f(x) = \cases{ 1 & $x<0$ \\ \sin \left( \pi \,x \right) & $0\leq x\leq 1$ \\ 2 & $x>1$\\ }, $
Maple software produces a result of $TV=\mathbf{2}$. But I think it must be $\mathbf{5}$. Maple is missing the left and right jump in the function and only integrating the $\sin(\pi x)$ !.
Am I missing something here? I think Maple will not do such a mistake, so I do not understand what is wrong in my interpretation. If someone understands the mistake then please help me out.

Maple is just doing a simple Riemann integral here. That area under the curve calculation just ignores the simple undefined values at 0 and 1.