結果 : define total variation of a function