## a very occasional diary

 nondescript[Nikita Danilov]

## 2009-08-21

### a trivial exercise.

Let's find a sum

$$\sum_{n=1}^\infty {1\over{n(n+2)}}$$

There is a well-know standard way, that I managed to recall eventually. Given that

$${1 \over n(n+2)} = {1 \over 2}\cdot \left({1\over n} - {1\over n+2}\right)$$

the sum can be re-written as

$$\sum_{n=1}^\infty {1\over{n(n+2)}} = \sum_{n=1}^\infty {1 \over 2}\left({1\over n} - {1\over n+2}\right) = {1\over 2}\left({1\over 1} - {1\over 3} + {1\over 2} - {1\over 4} + {1\over 3} - {1\over 5} + {1\over 4} - {1\over 6} \cdots\right)$$

with almost all terms canceling each other, leaving

$$\sum_{n=1}^\infty {1\over{n(n+2)}} = {1\over 2}\left(1 + {1\over 2}\right) = {3\over 4}$$

While this is easy to check, very little help is given on understanding how to arrive to the solution in the first place. Indeed, the first (and crucial) step is a rabbit pulled sans motif out of a conjurer hat. The solution, fortunately, can be found in a more systematic fashion, by a relatively generic method. Enter generating functions.

First, introduce a function

$$f(t) = \sum_{n=1}^\infty {t^{n + 1}\over n}$$

The series on the right converge absolutely when |t| < 1, so one can define

$$g(t) = \int f(t) dt = \int \sum_{n=1}^\infty {t^{n + 1}\over n} = \sum_{n=1}^\infty \int {t^{n + 1}\over n} = \sum_{n=1}^\infty {t^{n + 2}\over {n(n+2)}} + C$$

with the sum in question being

$$\sum_{n=1}^\infty {1\over{n(n+2)}} = g(1) - C = g(1) - g(0)$$

Definition of the g function follows immediately from the form of the original sum, and there is a limited set of operations (integration, differentiation, etc.) applicable to g to produce f.

The rest is more or less automatic. Note that

$$- ln(1 - t) = t + {t^2\over 2} + {t^3\over 3} + \cdots$$

so that

$$f(t) = t^2 + {t^3\over 2} + {t^4\over 3} + \cdots = - t \cdot ln(1-t)$$

therefore

$$g(t) = - \int t \cdot ln(1-t) dt = \cdots = {1\over 4} (1 - t)^2 - {1\over 2} (1 - t)^2 ln(1 - t) + (1 - t) ln(1 - t) + t + C$$

where the integral is standard. Now,

$$g(1) - g(0) = 1 - {1\over 4} = {3\over 4}$$

VoilĂ !

And just to check that things are not too far askew, a sub-exercise in a pointless programming:
scala> (1 to 10000).map(x => 1.0/(x*(x+2))).reduceLeft(_+_)
res0: Double = 0.749900014997506


PS: of course this post is an exercise in tex2img usage.
PPS: Ed. 2022: tex2img is gone, switch to mathjax.

#### 1 comment:

1. that's not pointless because of the xs
{"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 1, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "url": "http://www.cofault.com/2009/08/trivial-exercise.html", "fetch_time": 1675946506000000000, "content_mime_type": "text/html", "warc_filename": "crawl-data/CC-MAIN-2023-06/segments/1674764499966.43/warc/CC-MAIN-20230209112510-20230209142510-00800.warc.gz", "warc_record_offset": 53313754, "warc_record_length": 8871, "token_count": 948, "char_count": 2476, "score": 4.625, "int_score": 5, "crawl": "CC-MAIN-2023-06", "snapshot_type": "latest", "language": "en", "language_score": 0.6858518123626709, "file_path": "/sailhome/yjruan/project/latent-lm/data/processed/finemath-4plus/finemath-4plus/train-00023-of-00064.parquet"}