# Example of a function for which $\int_1^\infty f(x)\;dx$ diverges and $\sum_{1}^\infty f(n)$ converges

I recently came across this one:

A function which is continuous and positive for $$x \geq 1$$ and such that $$\int_1^\infty f(x)\;dx$$ diverges and $$\sum_{1}^\infty f(n)$$ converges

I understand what the function $$g$$ is .

My questions are:

• Is there anything special about the function $$g$$ here?
• Why define $$f$$ by adding $$g$$ to $$\frac{1}{x^2}$$ ?
• Why $$f$$ is continuous?
• Is there any other simple functions $$g$$ instead of the given one to make $$f$$ easier?

For my second question, I think we know $$\sum \frac{1}{n^2} < \infty$$ and $$g(n)=0$$ for integer points. So we define like this. Is this correct?

For my third question, I think $$g$$ is continuous and $$\frac{1}{x^2}$$ is continuous, so their sum is continuous. Is there any reason apart from this?

Any help must be appreciated and thanks in advance!

• Second bullet: you want $f$ to be positive, while $g$ is only nonnegative. – Clement C. Sep 27 '18 at 12:50

Let consider for example

$$g(x)=\sin^2(2\pi x) \implies g(n)=\sin^2 (2\pi n)=0\quad \forall n$$

The $$1/x^2$$ term has been added in order to have $$f(n)>0$$.

The continuity was considered in order to exclude simple example for $$f$$ as for example $$f(x)=1$$ $$\forall x\not \in \mathbb{Z}$$ and $$f(x)=1/x^2$$ otherwise.

• It should be positive for $x\geq 1$ – Jakobian Sep 27 '18 at 12:53
• @Jakobian Thanks, I lost that detail at first! – user Sep 27 '18 at 13:01
• @gimusi: Actually we need $f(x) >0$ for all $x$. I'm misunderstand $f(n)>0$. can you explain it a bit more? – Chinnapparaj R Sep 27 '18 at 13:03
• @ChinnapparajR In the OP I read positive for any $x\ge 1$ anyway the example given works for any $x\neq 0$ and if we use $1/(x^2+1)$ for any $x$. – user Sep 27 '18 at 13:06
• @ChinnapparajR Without the term $1/n^2$ we would have $f(n)=0$ $\forall n$. – user Sep 27 '18 at 13:07

As little constraints are imposed on $$f$$, you can very well choose a smooth function which is zero at integer values and positive elsewhere, such as $$\sin^2(\pi x)$$.

If the function must be strictly positive, add a term with sufficient decrease speed to guarantee convergence of the series, say $$e^{-x}$$ (the book chose $$x^{-2}$$).

• Thanks! This one really helps for the intuition of such functions – Chinnapparaj R Sep 27 '18 at 13:24