The Math Forum

Ask Dr. Math - Questions and Answers from our Archives
Associated Topics || Dr. Math Home || Search Dr. Math

Showing That the Sum of the Infinite Series cos(n)/n Converges

Date: 04/01/2008 at 02:10:57
From: Mike
Subject: Test of convergence of a given series

The question is if the sum of the series from n = 1 to infinity of
(cos n)/(n) converges or diverges.

I can't seem to find a test to see whether the series converges or
diverges.  Each test that I've tried doesn't seem to solve the
problem.  I've tried the direct comparison test, the limit comparison
test, the ratio test, and the root test.  The problem seems very
complicated, and I am utterly stumped!

Date: 04/12/2008 at 20:03:57
From: Doctor Vogler
Subject: Re: Test of convergence of a given series

Hi Mike,

Thanks for writing to Dr. Math.  That's a very good question, and a
very hard question too.  It turns out that none of the tests that you
usually learn in high school will be quite sufficient, although there
is one known as the Dirichlet test (not usually taught in high school)
which is a generalization of the Alternating Series test (meaning that
the A.S. test is a special case of the Dirichlet test) which *is*
sufficient.  It is described at

  Wikipedia: Dirichlet Test 

and proven using "partial summation"

  Wikipedia: Partial Summation 

which is an analog for series to the method of partial integration (or
"integration by parts") from calculus.

You can also prove that the series converges using partial summation
directly, or you can convert the series to an integral and then prove
that the integral converges.  Showing that the integral converges is
not terribly easy either, although this method allows you not only to
prove that the series converges but also to find its sum.  All of
these methods, however, share one other feature, which is that you
have to start by knowing how to sum a series like

  cos 1 + cos 2 + cos 3 + ... + cos k.

So let's start there.  The way to sum this series, or any series of
the form

  sum cos(nx)

for some number x is to use Euler's equation.  See

  Imaginary Exponents and Euler's Equation 

You change cos(nx) into (1/2)(e^(inx) + e^(-inx)), and then you split
the summation into a sum of two geometric series.  The formula for
geometric series works in complex numbers just as it does for real
numbers (since it's really just a polynomial factorization).  Then you
convert the result back into a formula in trig functions instead of
complex numbers.  In case that makes you uneasy, if you happen already
to know the answer, then you can simply prove using trig formulas and
induction that

   k            sin((k+1/2)x) - sin(x/2)
  sum cos(nx) = ------------------------
  n=1                  2 sin(x/2)

This is important for applying the Dirichlet test because you need to
apply the Dirichlet test with a_n = 1/n and b_n = cos(n), and you need
to prove that the sum

   k           sin(k + 1/2) - sin(1/2)
  sum cos(n) = ------------------------
  n=1                 2 sin(1/2)

is bounded independently of k.  Fortunately, since sin(k + 1/2) is
always between -1 and +1, that means that the sum of cos(n) from n=1
to n=k is always between -1/(2 sin(1/2)) - 1/2 and 1/(2 sin(1/2)) -
1/2, no matter what k is.  And that's enough to use the Dirichlet test
to prove that the series converges.

The other method is a little trickier, but here's one way to find the
sum of the series you want.  The idea is to use the fact that the
integral of sin(nx) dx is

  int sin(nx) dx = ------- + C.

Of course, we have to figure out what the constant is, so we should
choose convenient bounds on the integral, such as

  pi               cos(n)   (-1)^n
  int sin(nx) dx = ------ - ------
   1                 n         n

I'll leave it to you to prove that cos(n*pi) = (-1)^n when n is an
integer.  So this means that we need to find the summation

   k  cos(n)    k   (-1)^n   pi
  sum ------ = sum  ------ + int sin(nx) dx
  n=1   n      n=1     n      1

                k   (-1)^n   pi     k
             = sum  ------ + int ( sum sin(nx) ) dx
               n=1     n      1    n=1

This means that you don't actually need the sum of cos(n), but you
need the sum

   k            cos(x/2) - cos((k+1/2)x)
  sum sin(nx) = ------------------------
  n=1                  2 sin(x/2)

but you can find and/or prove this just like for the sum of cos(n).

That means that

   k  cos(n)    k   (-1)^n    pi  cos(x/2) - cos((k+1/2)x)
  sum ------ = sum  ------ +  int ------------------------ dx.
  n=1   n      n=1     n       1         2 sin(x/2)

This is interesting because it converts a sum with variable number of
terms (k terms) into a known sum (the sum on the right side is well 
known to converge to -ln(2) when k goes to infinity, since it equals 
the Taylor series for -ln(1+x) at x=1) plus a single integral on a 
finite interval (1 to pi), and the k only appears in the summand, not 
in the interval.  Well, it turns out that the first part of this 
integral can be evaluated exactly

   pi    cos(x/2)                        pi
   int  ---------- dx = [ ln |sin(x/2)| ]
    1   2 sin(x/2)                       1

                      = ln sin(pi/2) - ln sin(1/2)
                      = ln 1 - ln sin(1/2)
                      = -ln sin(1/2).

The second part of the integral can be shown to approach zero as k
grows to infinity, which means that

  -ln(2) - ln(sin(1/2)) = 0.042019505825368961725798384...

is the sum of cos(n)/n.

So the only thing left to do is prove my claim that the second part of
the integral is smaller in absolute value than a constant times 1/k. 
(It turns out that the difference between -ln(2) and the sum of
(-1)^n/n from n=1 to n=k is also smaller in absolute value than a
constant times 1/k, but this is easy to prove, since it's an 
alternating series with monotonic decreasing absolute value.  The
error term is smaller in absolute value than the absolute value of the
next term, which is smaller than 1/k.)

So let's have a close look at

   pi   cos((k+1/2)x)
   int  ------------- dx
    1     2 sin(x/2)

The denominator doesn't actually change very much, as it grows
monotonically from 2*sin(1/2) to 2*sin(pi/2) = 2.  The numerator, on
the other hand, oscillates rapidly (when k is large) between -1 and
+1.  So what we'd like to prove is that in each period (from +1 to -1
and back) the integral is very small, so that even when you add up all
such periods, the sum is still very small, smaller than a constant
times 1/k.

So we'll set

  a = floor((2k+1)/(4*pi))
  b = floor((2k+1)/4)

(the floor means to round *down* to the nearest integer) and then
separate the integral from 1 to pi into many pieces,

  the first one from 1 to 4(a+1)pi/(2k+1)
  the next b-a-1 pieces, for m=a+1 to m=b-1,
        from 4*m*pi/(2k+1) to 4(m+1)pi/(2k+1)
  the last piece from 4*b*pi/(2k+1) to pi


  (2k+1)/(4*pi) - 1 < a <= (2k+1)/(4*pi)


  (2k+1)/4 - 1 < b <= (2k+1)/4

the first and last pieces each have length no bigger than 4pi/(2k+1).
Since the integrand cos((k+1/2)x)/(2*sin(x/2)) has absolute value no
bigger than 1/(2*sin(1/2)), that means that the integrals on the first
and last pieces have absolute value no bigger than

  2*pi/((2k+1)sin(1/2)) < pi/sin(1/2) * 1/k.

The middle pieces require more attention, since there are many of
them, namely b-a-1 of them, and since

  (2k+1)/(4*pi) - 1 < a
  b <= (2k+1)/4

that means that there are

  b-a-1 < (2k+1)/4 - (2k+1)/(4*pi) < (2k+1)/5

of them.  So we need to prove that each one is smaller in absolute
value than a constant times 1/k^2.  They would, in fact, be zero if
the denominator were constant, so we should compare them to the
integral we would get with a constant denominator.  That is, the m'th
piece would be

  4(m+1)pi/(2k+1)  cos((k+1/2)x)
       int         ------------- dx
   4*m*pi/(2k+1)     2 sin(x/2)

which equals (by the change of variables u = (k+1/2)x )

  2(m+1)pi     cos(u)       1
    int     -------------  ---- du
   2*m*pi   sin(x/(2k+1))  2k+1

and since

  2(m+1)pi         cos(u)          1
    int     --------------------  ---- du = 0
   2*m*pi   sin((2m-1)pi/(2k+1))  2k+1

(this is the constant denominator), that means that our integral (on
the m'th piece) equals

  2(m+1)pi  cos(u)         1                   1
    int     ------ ( ------------- - -------------------- ) du
   2*m*pi    2k+1    sin(x/(2k+1))   sin((2m-1)pi/(2k+1))

and now we are going to take absolute values and get a bound on this,
because that difference in the integral is very small.  In particular,
note that

  |x - (2m-1)pi| <= pi


      1       1         sin v - sin u
  | ----- - ----- | = | ------------- |
    sin u   sin v       (sin u)(sin v)

                        sin((u-v)/2) cos((u+v)/2)
                    = | ------------------------- |
                             (sin u)(sin v)

                    <= --------------
                       |sin u||sin v|

since |sin t| <= |t| for all real numbers t, and |cos t| <= 1.  In our
case, with u = x/(2k+1) and v = (2m-1)pi/(2k+1), we have

  |u - v| <= pi/(2k+1)

and since

  1 <= u <= pi
  1 <= v <= pi

we also get

  sin u >= sin(1/2)
  sin v >= sin(1/2)

and therefore

      1       1                 pi
  | ----- - ----- | <=  -------------------
    sin u   sin v       2(2k+1)(sin(1/2))^2

and this means that our integral on the m'th piece, which was

  2(m+1)pi  cos(u)         1                   1
    int     ------ ( ------------- - -------------------- ) du
   2*m*pi    2k+1    sin(x/(2k+1))   sin((2m-1)pi/(2k+1))

has absolute value no bigger than

              1            pi
      2*pi  ------ -------------------.
             2k+1  2(2k+1)(sin(1/2))^2

Since there are fewer than 2k+1 of these middle pieces (all but the
first and last), the sum of all of them can't be bigger than


And since the first and last pieces are no bigger than


that means that the sum of all of them, which is

   pi   cos((k+1/2)x)
   int  ------------- dx
    1     2 sin(x/2)

is no bigger than

    1          pi^2         2*pi
  ------ ( ------------ + -------- )
  (2k+1)   (sin(1/2))^2   sin(1/2)

which is less than

  1        pi^2          pi
  - ( ------------- + -------- )
  k   2(sin(1/2))^2   sin(1/2)

thus proving that the integral approaches zero as k grows to infinity,
as we were trying to do.

And that does it!  So we have proven that the sum converges and equals

  -ln(2) - ln(sin(1/2)) = 0.042019505825368961725798384....
If you have any questions about this or need more help, please write
back and show me what you have been able to do, and I will try to
offer further suggestions.

- Doctor Vogler, The Math Forum 
Associated Topics:
High School Sequences, Series

Search the Dr. Math Library:

Find items containing (put spaces between keywords):
Click only once for faster results:

[ Choose "whole words" when searching for a word like age.]

all keywords, in any order at least one, that exact phrase
parts of words whole words

Submit your own question to Dr. Math

[Privacy Policy] [Terms of Use]

Math Forum Home || Math Library || Quick Reference || Math Forum Search

Ask Dr. MathTM
© 1994- The Math Forum at NCTM. All rights reserved.