Let $f(x) = f(x+2\pi)$ be a bounded real function given by the Fourier series of the form
$$
f(x) = \sum_{k=1}^N a_k \sin(kx + \phi_k).
$$
What is the total variation $V(f)$ of this function over one period? In this case, one should be able to use that $V(f) = \int |f'(x)|dx$ and that
$$
f'(x) = \sum_{k=1}^{N} k a_k \cos(kx + \phi_k),$$
but how?
If instead the function is given by an infinite Fourier series, then what are the conditions on the $a_k$ terms for the total variation to be finite?