# Cosine series with non-negative coefficients, that is continuous at $0$ but not everywhere

Is there an cosine series with non-negative terms, that is continuous at $x=0$, but not continuous everywhere?

More specifically, do there exist $a_n\geq0$ such that

$$f(x) = \sum_{n=1}^\infty a_n \cos(nx)$$

• converges for $x=0$
• converges almost everywhere
• is continuous at $x=0$
• is not a continuous function?

For motiviation, see this related question.

• If you take a bounded even function which is $2 \pi$-periodic, continuous at zero and disctontinuous somewhere else, then its Fourier series will converge to it almost everywhere, and will be made only by cosines. – Crostul Aug 27 '18 at 9:52
• But will we know its Fourier coefficients are $\geq0$? For the example of a symmetric step function, this is not the case. – Neuromath Aug 27 '18 at 9:57
• By "is not a continuous function" you mean that there is no continuous function $g$ such that $f=g$ a.e.? – amsmath Aug 27 '18 at 10:09
• OP, I suggest editing your post title and maybe also your post to point out the non-negativity assumption more clearly. – Calvin Khor Aug 27 '18 at 10:30
• This is simple. First, if $(a_n)\in\ell^1$, then the series obviously converges for every $x$. If $x_k\to x$, then $f(x_k)-f(x) = \sum_na_n(\cos(nx_k)-\cos(nx))$. Each summand converges to zero and is bounded by $2|a_n|$. Hence, Lebesgue's majorized convergence theorem implies that the whole thing tends to zero as $k\to\infty$. – amsmath Aug 27 '18 at 10:49

If the series converges at $x=0$, then $\sum_na_n$ converges. And since $a_n\ge 0$, it follows that $(a_n)\in\ell^1$. But then the series converges at every $x$ and defines a continuous function $f$. To see the latter, let $(x_k)$ be a sequence in $\Bbb R$ that converges to $x\in\Bbb R$. Then $$f(x_k)-f(x) = \sum_na_n(\cos(nx_k)-\cos(nx)).$$ Now, the $n$-th summand converges to zero as $k\to\infty$ is bounded by $2|a_n|$. Hence, by Lebesgue's majorized convergence theorem, it follows that $f(x_k)\to f(x)$ as $k\to\infty$.

• Marked as answered, but I still don't get how you used Lebesgues domainated convergence theorem here. (Assuming that's what you mean.) That theorem is about convergence of integrals, we are talking about convergence of limits. – Neuromath Aug 29 '18 at 7:18
• @Neuromath The theorem is stated for integrals with respect to arbitrary measures. Here, it is the counting measure $\mu(A) = \#(A\cap\Bbb Z)$. – amsmath Aug 29 '18 at 15:57

For each $n,$ $|a_n\cos (nx)|\le a_n,$ and we're given $\sum a_n <\infty.$ By the Weierstrass M test, $\sum a_n\cos (nx)$ converges uniformly on $\mathbb R.$ Since each summand is continuous on $\mathbb R,$ so is $f(x).$ Thus the answer to your question is no.

If $f(x)$ is continous at $x=0$ then we know

$$\exists L \land \forall \epsilon \exists \delta \gt 0 \ \land \ if \ |x| \lt \delta \ then \ |f(x)-L| \lt \epsilon$$

This immediately implies that there exists infinitly many $x \neq 0$ such that $|\sum_{n=0}^{\infty} a_n cos(nx) - L| \lt \epsilon$.

• I don't know how to find non continuous cases for $a_n$ - part of your question. Just thought this might be helpful for other aspects of the question. – marshal craft Aug 27 '18 at 10:49
• Also as some comented ask, not at no point do we consider when $x=0$ because our $\delta =0$ which is not found in definition of continuity. – marshal craft Aug 27 '18 at 10:52
• Woops yes I redact last comment because it explicitly $f(x)=L$ to be cont at $x$. – marshal craft Aug 27 '18 at 15:11