### a trivial exercise.

Let's find a sum

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

the sum can be re-written as

with almost all terms canceling each other, leaving

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

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

with the sum in question being

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

so that

therefore

where the integral is standard. Now,

VoilĂ !

And just to check that things are not too far askew, a sub-exercise in a pointless programming:

PS: of course this post is an exercise in tex2img usage.

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

the sum can be re-written as

with almost all terms canceling each other, leaving

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

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

with the sum in question being

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

so that

therefore

where the integral is standard. Now,

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.