Proving coefficient $a_n = O(1/n) $ and $b_n =O(1/n)$ in fourier series This question was asked in my real analysis quiz and I was unable to solve it.
So, I am asking for help here.
Question : If $f(x) \sim a_0 /2 + \sum_{n=1}^{\infty} \left(a_n \cos(nx) + b_n \sin (nx)\right) $ and if f is of bounded variation on $[0,2\pi]$ show that $a_n =O(1/|n |) $  and $b_n =O(1/|n|)$.
Using the condition of bounded variation i wrote $f =g-h$ where $g$ and $h$ are increasing on $[0,2 \pi]$. But  I am not able to use any result of fourier series to proceed.
Do you mind giving me some hints on how to prove it?
Thanks for your time.
 A: As noted in the comment by @Gary, the quoted solution by @user515599 works only in the special case when $f$ is the integral of its derivative, i.e., when $f$ is absolutely continuous [1], so it does not apply, e.g., to the Cantor function. To handle the general case of bounded variation $f$, it is convenient to use the Riemann-Stieltjes integral [2]
$\int_a^b g \,\mathrm {d}f$, which exists when  $f$ has bounded variation and $g$ is continuous (and also exists if  $f$ is continuous and $g$ has bounded variation.)   In these cases, the integration by parts formula holds:
$${\displaystyle \int _{a}^{b}f(x)\,\mathrm {d} g(x)=f(b)g(b)-f(a)g(a)-\int _{a}^{b}g(x)\,\mathrm {d} f(x)}\,$$
holds. See the references in [2] for this and other properties of the RS integral.
We need two more properties of this integral:
(*) Let $g$ be continuous in $[a,b]$,  with the maximum of $|g|$ in that interval equaling $M$.  If the variation of $f$ over $[a,b]$ equals $V$, then
$$\Bigl|\int_a^b g \,\mathrm {d}f \Bigr| \le MV \,.$$
This follows immediately from the definition of the RS integral.
(**) Given a   continuously differentiable function $g$ on $[a,b]$  and $f$ of bounded variation,  the equality
$${\displaystyle \int _{a}^{b}f(x)\,\mathrm {d} g(x)=\int _{a}^{b}f(x)g'(x)\,\mathrm {d} x}
$$
holds. See [2].
Thus, returning to your question, if the variation of $f$ over $[0,2\pi]$ equals $V$, then using integration by parts and  (**) above,
$$2\pi a_n=\int_0^{2\pi} f(x) \cos(nx) \, dx=-\frac{1}{n} \int_0^{2\pi}  \sin (nx)\, \mathrm {d}f$$
so by (*),
$$2\pi |a_n| \le V/n \,.$$
A similar argument applies to bound $b_n$.
[1] https://en.wikipedia.org/wiki/Absolute_continuity
[2] https://en.wikipedia.org/wiki/Riemann%E2%80%93Stieltjes_integral
A: Since $f$ is of bounded variation on a compact interval $[0,2\pi]$ it is differentiable almost everywhere and so there exists a function, denoted $f'\in L^1[0,2\pi]$ such that
$$f(x)=f(a)+\int_a^x f'(y) \lambda(d y),\quad x,a\in  [0,2\pi]$$
Let $\hat{f}_n$ denote the Fourier coefficient of a function $f$. Then using integration by parts
\begin{align}
    i n \hat{f}_n &= -  \int_0^{2\pi} f(x) (- in) e^{-i n x} \frac{1}{2\pi} d y \\
    &= - \frac{1}{2\pi} [f(2\pi) e^{-2\pi i n}-f(0)] + \int_0^{2\pi} f'(x) e^{-i n x} \frac{1}{2\pi} d y \\
    &=c+ \int_0^{2\pi} f'(x) e^{-i n x}\frac{1}{2\pi} d y \\
    &= c+ \hat{(f')}_n
\end{align}
divide both sides by $i n$ for $n\neq 0$ in $\mathbb Z$.
Ignoring the constant $c$ we have
\begin{align*}
   |\hat f_n| =\frac{1}{|in|} \left| \int_{[0,2\pi]} f'(x) e^{-i n x}  dx\right| \leq \frac{1}{|n|} \int_{[0,2\pi]} |f'| |e^{-i n x }| dx\leq \frac{1}{|n|} \int_{[0,2\pi]} |f'| dx =\frac{1}{|n|}\|f'\|_{L^1}
   \end{align*}
since $i$ and $e^{-i n x}$ have norm one and $f'$ is in $L^1$ by assumption we are done.
