CONTEXT
My starting point is Question A.6 of Putnam 2020 competition, that goes like that
For a positive integer $N$, let $f_N$ be the function defined by $$ f_N(x) = \sum_{n=0}^N \frac{N+1/2-n}{(N+1)(2n+1)} \sin((2n+1)x). $$ Determine the smallest constant $M$ such that $f_N(x) \leq M$ for all $N$ and all real $x$.
MY ANSWER
Aiming to show that $M=\frac{\pi}4$, I proceeded as follows.
It is straightforward to get $$f'_N(x) = \frac1{2(N+1)}\sum_{n=0}^N (2N+1-2n)\cos((2n+1)x).$$ It is useful to work with complex numbers, in order to have a better form of the derivative, that is \begin{eqnarray} f'_N(x) &=& \frac1{2(N+1)}\Re\left\{e^{jx}\sum_{n=0}^N(2N+1-2n)e^{j2nx}\right\}=\\ &=&\frac1{2(N+1)}\Re\left\{e^{jx}(2N+1)\sum_{n=0}^N e^{j2nx}+je^{jx}\frac{d}{dx}\left(\sum_{n=0}^Ne^{j2nx}\right)\right\}. \end{eqnarray}
Using geometric sums, for $x\neq k\pi$, we can write \begin{eqnarray}f'_N(x) &=& \frac1{2(N+1)}\Re\left\{(2N+1)e^{j(N+1)x}\cdot\frac{\sin((N+1)x)}{\sin x}+\right.\\ &+ &\left.je^{jx}\frac{d}{dx}\left(e^{jNx}\ \cdot \frac{\sin((N+1)x)}{\sin x}\right)\right\}. \end{eqnarray} After a few more steps we end up with $$ f'_N(x) = \frac{\cos x\sin^2((N+1)x)}{2(N+1)\sin^2 x}, \ \ \mbox{for}\ \ x\neq k\pi.\tag{1}\label{1} $$ For $x=k\pi$ we can use the definition or, better, take the limit of \eqref{1}, which leads to $$ f'_N(x) = \begin{cases} \frac{\cos x\sin^2((N+1)x)}{2(N+1)\sin^2 x} & (x\neq k\pi)\\ (-1)^k\frac{N+1}2 & (x = k\pi). \end{cases}\tag{2}\label{2} $$ From \eqref{2} we note that the derivative of $f_N(x)$ changes sign only at $x = \frac{\pi}2+k\pi$, and therefore the global maximum is in $x=\frac{\pi}2$. Thus $$f_N(x) \leq f_N\left(\frac{\pi}2\right).$$
We want now to show that the searched for constant is $M = \frac{\pi}4$, by proving that the sequence $f_N(\pi/2)$ monotonically converges to $\pi/4$. We have \begin{eqnarray} f_N\left(\frac{\pi}2\right) &=& \sum_{n=0}^N(-1)^n\cdot \frac{N+1/2-n}{(N+1)(2n+1)}=\\ &=&\sum_{n=0}^N(-1)^n \frac{N+1-(n+1/2)}{(N+1)(2n+1)}=\\ &=&\underbrace{\sum_{n=0}^N(-1)^n\frac1{2n+1}}_{S_N}-\frac1{2(N+1)}\sum_{n=0}^N(-1)^n=\\ &=& \begin{cases}S_N & (N \ \ \mbox{odd})\\ S_N -\frac1{2(N+1)}& (N \ \ \mbox{even}).\end{cases} \end{eqnarray} Convergence is now proved since we have that $S_N \to \frac{\pi}4$. Observe also that \begin{eqnarray} f_{2N+1}(\pi/2) = S_{2N+1} = S_{2N} -\frac1{4N+3}>S_{2N}-\frac1{4N+2}=f_{2N}(\pi/2), \end{eqnarray} and that $$f_{2N}(\pi/2) = S_{2N} - \frac1{4N+2} = S_{2N-1} + \frac1{4N+1}-\frac1{4N+2}>S_{2N-1}=f_{2N-1}(\pi/2).$$ This completes the proof.
FURTHER OBSERVATIONS
Inspired by the analytical results and by the plot below, that shows $f_N(x)$ for the first few values of $N$, I wanted to prove that the series of functions converges pointwise to a sort of square wave defined by
$$ f(x)= \begin{cases} (-1)^k\frac{\pi}4 & (k\pi < x <(k+1)\pi)\\ 0 & (x=k\pi), \end{cases} $$ without explicitly resorting to Fourier analysis with which I am not yet too familiar.
Simmetries allow us to work on the interval $[0,\pi/2]$. Convergence to $0$ when $x=k\pi$ is obvious, and convergence to $\pi/4$ when $x=\pi/2$ has been proved above.
I then observed, using \eqref{1}, that for any fixed $\overline x\neq k\pi$ the derivative tends to zero as $N\to \infty$, that is $$ \lim_{N\to \infty}f'_N(\overline x) = 0.\tag{3}\label{3}$$ Suppose that, for some $\overline{x} \neq k\pi$, $f_N(\overline x)\not \to \pi/4$. This means that there exists $\varepsilon > 0$ such that we can construct a subsequence $\left(f_{n_k}(\overline x)\right)_{k\in \mathbb Z}$, yielding, for all $k$, $$\left|f_{n_k}(\overline x)-\frac{\pi}4\right|>\varepsilon.$$ By the convergence in $\pi/2$ we can also take $k$ large enough so that $$\left|f_{n_k}\left(\frac{\pi}2\right) - \frac{\pi}4\right|< \frac{\varepsilon}2.$$ Thus we have \begin{eqnarray} \left|\frac{f_{n_k}(\overline x)-f_{n_k}(\pi/2)}{\overline x -\pi/2}\right| &=& \left|\frac{f_{n_k}(\overline x)-\pi/4 + \pi/4- f_{n_k}(\pi/2)}{\overline x -\pi/2}\right|\geq \\ &\geq&\left|\frac{|f_{n_k}(\overline x)-\pi/4| - |f_{n_k}(\pi/2)-\pi/4|}{\overline x -\pi/2}\right|>\frac{\varepsilon}{\pi},\tag{4}\label{4} \end{eqnarray} for sufficienlty large $k$. However, Mean Value Theorem used in conjunction with \eqref{4}, contradicts \eqref{3}. Therefore $f_{N}(\overline{x}) \to \pi/4$. (See EDIT below for an improvement.)
QUESTIONS
- Is my proof of the original Putnam question OK? (I am pretty confident about $f'_N(x)$, less about the steps that follow \eqref{2}.)
- Is my proof of pointwise convergence of $f_N(x)$ using \eqref{3} and MVT OK? (Now edited below.)
I deliberately omitted some steps of 1., to make the proof hopefully more readable, but if it is necessary I can fill in the missing details.
EDIT
On a second thought, I believe there is an important missing step in my proof of pointwise convergence.
As stated we have, for $\overline x \neq k\pi$, $$\lim_{N\to \infty} f'_N(\overline x) = 0,$$ but we need a stronger condition. I.e., for $0<\overline x < x <\pi/2$, $$f'_N(x) = \frac{\cos x \sin^2((N+1)x)}{2(N+1)\sin^2x}\leq\frac1{2(N+1)\sin^2\overline x},$$ so that, given some arbitrary $\varepsilon > 0$, if we take $N>\frac{\pi}{2\varepsilon\sin^2\overline x}-1$ we can guarantee $$f'_N(x) < \frac{\varepsilon}{\pi},\tag{5}\label{5}$$ for all $x \in (\overline x,\pi/2)$.
Now, as we said above, if we assume by contradiction that $f_N(\overline x) \not \to \pi/4$, condition \eqref{4} and MVT tell us that there exists $\xi_k \in (\overline x, \pi/2)$, such that $$|f_{n_k}(\xi_k)|>\frac{\varepsilon}{\pi},$$ for arbitrarily large $k$, which contradicts \eqref{5}.
