I've recently stumbled upon the following problem from Brilliant:
Compute the following:
$$\lim_{n\to\infty}\max_{x\in[0,\pi]}\sum_{k=1}^n\frac{\sin(kx)}k$$
Options:
$\displaystyle\int_0^\pi\frac{\cos^2(x)}{x^2}~\mathrm dx$
$\displaystyle\int_0^\pi\frac{\sin^2(x)}{x^2}~\mathrm dx$
$\displaystyle\int_0^\pi\frac{\sin(x)}x~\mathrm dx$
$\displaystyle\int_0^\pi\frac{\cos(x)}x~\mathrm dx$
Already by looking at it, it doesn't make sense for 1 or 4 to be correct, since they both diverge. Instinct then tells me the answer should be 3, since $\sin^2$ doesn't appear in the problem. However, I haven't been able to get to it.
By differentiating, I can find potential maxima as follows:
$$\frac{\mathrm d}{\mathrm dx}\sum_{k=1}^n\frac{\sin(kx)}k=\sum_{k=1}^n\cos(kx)=\csc\left(\frac x2\right)\sin\left(\frac{nx}2\right)\cos\left(\frac{(n+1)x}2\right)$$
Obviously the sum is zero on the boundaries, so we are not interested in them. Aside from them though, there are a lot of points to consider. My suspicion is that the maximum occurs at $x=\frac\pi{n+1}$ since this point has every term in the summand being positive. Furthermore, if this is the case, then we can rearrange the original sum into a Riemann sum, getting 3 as the answer.
How may we continue? Or perhaps this is the wrong approach...?
One may also note that answer choice 2 is less than answer choice 3, and we can see 3 is a possible answer choice, meaning that if this exists and is one of the answer choices, it must be the 3rd one.
