Question: Why do two wrongs make a right?

In Hansen's book "A table of Series and Products" there is an unsourced listed identity 43.6.1:

S1 := Sum(2^k*tanh(2^k*x), k = 0 .. n - 1) = 2^n*coth(2^n*x) -   coth(x)

It appears to be to be numerically correct, and can be obtained from a second identity

S6:=Sum(2^(-k)*tanh(2^(-k)*x), k = 1 .. n) =- 2^(-n)*coth(2^(-n)*x) + coth(x)

by "summing in reverse order". S6 is also numerically correct.

Starting from S1 and reversing the order, gives

S2 := Sum(2^(n - k - 1)*tanh(2^(n - k - 1)*x), k = 0 .. n - 1) = 2^n*coth(2^n*x) - coth(x)

Then shifting the index gives

 S3 := Sum(2^(-k)*tanh(2^(-k)*x), k = -n + 1 .. 0) =  2^n*coth(2^n*x) - coth(x)

both of which test OK numerically since n>0. Now it begins to get strange.

In S3, let n->-n (highly illegal) to obtain

S4 := Sum(2^(-k)*tanh(2^(-k)*x), k = n + 1 .. 0) = 2^(-n)*coth(2^(-n)*x) - coth(x)

and, surprisingly Maple tests S4 to be correct numerically.

Here's how that happened. The lower limit of the S4 sum exceeds the upper limit, so there are three possible ways to interpret this:

1. In standard mathematical usage, this is usually set to zero by caveat;

2. In a practical sense, one might expect the order of summation to be irrelevant so S4 is the same as

S5:= Sum(2^(-k)*tanh(2^(-k)*x), k = 0 .. n + 1) = 2^(-n)*coth(2^(-n)*x) - coth(x)

but that fails numerically.

3. Maple has a built-in algorithm (see the help page on "Sum") that interprets

Sum(f(k), k = m .. n) = -Sum(f(k), k = n + 1 .. m - 1)

when m exceeds n and that is why S4 works numerically and, when applied to S4 gives the result S6.

So where did Maple's prescription come from, and what is it's justification?

Thank you

Please Wait...