# Alternating series test for non-decreasing terms

In Calculus we teach that if the $a_n$ are positive and decreasing with limit equal to zero, then the alternating series $\sum_n (-1)^na_n$ converges. One can in general not leave out the assumption that the $a_n$ (eventually) decrease, as the example $a_{2n}:=1/n$ and $a_{2n+1}:=1/2^n$ shows. However, most examples are series where the $a_n$ are given by some function $a_n=f(n)$ (for $n\gg 0$).

So my question is, for which class of functions $\mathcal F$ do we have the property that if $f$ is a positive function in $\mathcal F$ and $\lim_{x\to \infty}f(x)=0$, then the alternating series $\sum_n (-1)^nf(n)$ converges. For instance, any o-minimal class will work, since any $f$ with limit zero at infinity must eventually be decreasing. But I think if we add the sine function to this class and close under addition, multiplication and composition, this is still true. In fact, I would almost dare to postulate that the class of elementary functions (i.e., the ones our students work with), have this property, and so we do not need to bug'' them with this extra condition.

-
Take any function and modify it to have $f(\frac1n)=0$ for all $n\gg0$. I think that you might want to put some more restrictions, or elaborate slightly more on $\cal F$. (Also double spaces break into paragraphs and ease up the reading.) – Asaf Karagila Feb 20 '13 at 23:18
I have in mind classes of functions that are obtained from primitive functions by means of standard operations: addition, multiplication, composition, perhaps even integration and derivative. So you no functions defined "by cases" or so. I am really envisioning this as a Calculus level problem. – Hans Schoutens Feb 20 '13 at 23:27
This is a bit tangential, but the motivation is highly unclear to me. To me the main (only?) point of teaching this entire result is to check if students know that they need to check all the hypothesis in a result before applying it. IMO if one were to remove this aspect, the entire result could be omitted. (But perhaps I am forgetting a place where it is actually important. Am I?) – user9072 Feb 21 '13 at 2:40
I am already happy if my students recognize that it is this test that applies--checking that it is decreasing adds another level of complexity to the problems that they cannot handle (imagine that you gave them a function likes Greg's counterexample below to check) and which I was trying to avoid. So far, o-minimality then seems the only way to exclude this non-tame phenomenon. – Hans Schoutens Feb 21 '13 at 3:38
If you expect that all natural functions are eventually monotone, you'll probably restrict yourself to an o-minimal class. Then, as shown in Greg's answer, sines and cosines won't be allowed. – ACL Feb 21 '13 at 7:54

$$f(x) = \frac{2(\cos \pi x/2)^2}{x} + \frac{(\sin \pi x/2)^2}{2^{(x-1)/2}}$$ is certainly a function in the class you describe, but $f(2n) = 1/n$ and $f(2n+1)=1/2^n$, which breaks the alternating series test as you've remarked.