TITLE: $\sum_{n=1}^\infty a_n \cos nx$ unbounded near $0$ if $\sum a_n$ diverges?
QUESTION [7 upvotes]: If $a_n$ is a decreasing positive sequence and tends to $0$, and given$$\sum_{n=1}^\infty a_n=+\infty$$
can we prove that $$\lim_{x\rightarrow 0}\sum_{n=1}^{\infty} a_n \cos nx =+\infty$$
or at least prove the series above is unbounded for $x$ in a neighborhood of $0$?
For the power series $$\sum_{n=1}^\infty a_n \left(1-x\right)^n $$ the conclusion holds, because $\left(1-x\right)^n$ is positive.
I wonder if trigonometric series can have the similar conclusion, so I tested several $a_n$, plotted the graph, and discovered that it is probably true.
However, since $\cos nx$ is not identically positive, it is hard to give a rigorous proof, and I cannot give a counter-example either.
Anyone has some ideas?

REPLY [3 votes]: All I can think of at this moment is the following very restricted partial result:

Claim. If $(a_n)$ is non-negative, non-increasing and $n a_n \leq C$ for some constant $C > 0$, then
$$ \lim_{x\to 0} \sum_{n=0}^{\infty} a_n \cos(n x) = \sum_{n=0}^{\infty} a_n, $$
regradless of the convergence of $\sum_{n=0}^{\infty} a_n$.

Since the claim is obvious if $\sum_{n=0}^{\infty} a_n < \infty$, we may focus on the case $\sum_{n=0}^{\infty} a_n = \infty$. To this end, define an auxiliary sequence $(b_n)$ by $a_n - a_{n+1} = b_n$. Then

$b_n \geq 0$ and $a_m = a_n + \sum_{k=m}^{n-1} b_k$ for $0 \leq m < n$,
$a_n = \sum_{k=n}^{\infty} b_k$, and
$\sum_{k=0}^{\infty} (k+1)b_k = \sum_{n=0}^{\infty} a_n = \infty$. (This follows from Tonelli's theorem.)

Moreover, we can apply summation by parts
\begin{align*}
\sum_{n=0}^{N} a_n \cos(nx)
&= a_N \sum_{n=0}^{N} \cos(nx) + \sum_{n=0}^{N-1} \left( \sum_{k=n}^{N-1} b_k \right) \cos(nx) \\
&= a_N D_N(x) + \sum_{k=0}^{N-1} b_k D_k(x),
\end{align*}
where $D_k(x) = \sum_{n=0}^{k} \cos(nx)$. Now if $x \in (0, \pi]$, then $D_n(x)$ is bounded in $n$. So, as $N\to\infty$, the above converges to
\begin{align*}
\sum_{n=0}^{\infty} a_n \cos(nx)
= \sum_{k=0}^{\infty} b_k D_k(x).
\end{align*}
Now notice that $D_k(x) = \cos(kx/2)\sin((k+1)x/2)/\sin(x/2)$. So, if $x \in (0, 1)$ and $k \leq 1/x$, then
$$ D_k(x) \geq \frac{\cos(1/2) \cdot \frac{2}{\pi} (k+1)x/2}{x/2} = c(k+1) $$
for $c = \frac{2}{\pi}\cos(1/2) > 0$. So
\begin{align*}
\sum_{n=0}^{\infty} a_n \cos(nx)
&\geq \sum_{0 \leq k \leq 1/x} b_k D_k(x) - \sum_{k > 1/x} \frac{b_k}{\sin(x/2)} \\
&\geq c \sum_{0 \leq k \leq 1/x} (k+1)b_k - \frac{a_{\lceil 1/x \rceil}}{\sin(x/2)}.
\end{align*}
Since $a_{\lceil 1/x \rceil} = \mathcal{O}(x)$ as $x \to 0^+$, we have $\frac{a_{\lceil 1/x \rceil}}{\sin(x/2)} = \mathcal{O}(1)$, and so, letting $x\to 0^+$ proves the desired claim.