Supremum of oscillations from Gibbs phenomenon The Fourier series $\sum_{n=1}^\infty \frac{\sin(nx)}{n}$ converges to $f(x) =(\pi-x)/2$ for $0 < x < 2\pi$ and to $0$ for $x=0$.  I'm interested to understand the Gibbs phenomena of overshooting partial sums near $x = 0.$
I would like to find in closed form: 
$$\sup_{x \in [0,\pi], n \in \mathbb{N}}\,\,\left|\sum_{k=1}^n \frac{\sin(kx)}{k}\right|.$$
I know how to find uniform bounds that are not sharp by working with partial sums.  So to get the supremum I think I should use the representation of partial sums in terms of Dirichlet kernel. 
Defining $S_n(x) = \sum_{k=1}^n \frac{\sin(kx)}{k}$, and taking the derivative and integrating I get 
$$S_n'(x) = \sum_{k=1}^n \cos(kx) = -\frac{1}{2}+ \frac{\sin[(n+1/2)x]}{2 \sin(x/2)}$$
$$S_n(x) = -\frac{x}{2} + \int_0^x \frac{\sin[(n+1/2)t]}{2 \sin(t/2)}  dt$$
How can I find the supremum for $x \in [0,\pi]$ and $n \in \mathbb{N}$?
 A: This is a Fourier series of a sawtoooth wave. I'm not sure that you can precisely specify that supremum in closed form. However, the essential aspect of Gibbs phenomenon  to "understand" here is that the partial sums will oscillate and overshoot the crest of the wave $\pi/2$ near the discontinuity at $x = 0$. We can show that
$$\limsup_{n \to \infty} \sup_{x \in [0,\pi]}S_n(x) > \frac{\pi}{2}$$ 
First note that since $\sin t$ alternates sign on intervals $[(k-1)\pi, k\pi],$ 
$$F(x) = \int_0^x \frac{\sin t}{t} \, dt $$
has relative maxima and minima at $\pi,2\pi, \dots$ and an absolute maximum value of $F(\pi)\approx 1.85 > \pi/2.$
Expressing the partial sum in terms of this integral will prove to be easier for analyzing the overshooting oscillations.
Starting with your last equation we have for $x \in[0,\pi],$
$$\tag{*}\begin{align}S_n(x) &= -\frac{x}{2} + \int_0^x \frac{\sin \left(n + \frac{1}{2}\right)t}{2 \sin \frac{t}{2}}\, dt \\ &= -\frac{x}{2} + \int_0^x \frac{\sin nt}{t} \, dt +  \int_0^x \left( \frac{\sin \left(n + \frac{1}{2} \right)t}{2 \sin \frac{t}{2}} - \frac{\sin nt}{t}\, \right)\, dt \\ &=-\frac{x}{2} + \int_0^{nx} \frac{\sin t}{t} \, dt + R_n(x) \end{align}$$
where a variable change $nt \to t$ has been applied and the remainder can be manipulated as
$$\begin{align} R_n(x) &= \int_0^x \left( \frac{\sin \left(n + \frac{1}{2} \right)t}{2 \sin \frac{t}{2}} - \frac{\sin nt}{t}\, \right)\, dt \\ &= \int_0^x \left( \frac{\sin nt\cos \frac{t}{2} + \sin\frac{t}{2} \cos nt}{2 \sin \frac{t}{2}} - \frac{\sin nt}{t}\, \right)\, dt \\&= \int_0^x \left(\frac{1}{2\tan \frac{t}{2}} - \frac{1}{t} \right)\sin nt + \frac{1}{2}\int_0^x \cos nt \, dt \\ &= \int_0^x \left(\frac{1}{2\tan \frac{t}{2}} - \frac{1}{t} \right)\sin nt + \frac{\sin nx}{2n}\end{align}$$
Using the Riemann-Lebesgue lemma we see that $R_n(x) \to 0$ as $n \to \infty$ and it can be shown (with some effort) that the convergence is uniform  for $x \in [0,\pi]$.  For any $\epsilon > 0$ we have $|R_n(x)| < \epsilon$ for all sufficiently large $n$ and all $x \in [0,\pi]$ and taking $x = \pi/n$ we have
$$\sup_{x \in [0,\pi]} S_n(x) > -\frac{\pi}{2n} + \int_0^\pi \frac{\sin t}{t} \, dt - \epsilon$$
Since $\epsilon$ can be arbitrarily close to $0$ we get
$$\limsup_{n \to \infty}\sup_{x \in [0,\pi]} S_n(x) >  \int_0^\pi \frac{\sin t}{t} \, dt \approx 1.85 > \frac{\pi}{2}$$
