Skip to main content
Official response added
Source Link

EDIT 19.05.20: official rejection of bug statement from Wolfram added.

Official statement of Wolfram

Here is the official answer to my bug report

Betreff: Re: [CASE:4544347] Bug report Sum[], Integrate[]
Datum: Mon, 18 May 2020 12:09:25 -0500
Von: Wolfram Technical Support [email protected]

"Hello Wolfgang,

This behavior is not a bug. As is documented in several places in the documentation

https://support.wolfram.com/39071?src=mathematica https://reference.wolfram.com/language/ref/FullSimplify.html#482986235 and https://reference.wolfram.com/language/ref/Sum.html#87823560

Mathematica assumes that unspecified symbolic variables are in general complex. Your symbolic expression fails at integers, but this is a measure-zero set of the complex plane, so the 'generic' validity of the Sum is upheld.

Further information on how to use GenerateConditions and Assumptions to avoid these issues is also available in the documentation at the included links."

My comment: To me this answer is remarkable but neither satisfactory nor useful for practical purposes. Considering that I have provided a Mathematica expression which yields the correct values also at integers the simple question is: why doesn't Mathematica return this expression? (Also, the Integrate question was not answered.)

Bottom line: I have received two different strange answers to my observation.

EDIT 19.05.20: official rejection of bug statement from Wolfram added.

Official statement of Wolfram

Here is the official answer to my bug report

Betreff: Re: [CASE:4544347] Bug report Sum[], Integrate[]
Datum: Mon, 18 May 2020 12:09:25 -0500
Von: Wolfram Technical Support [email protected]

"Hello Wolfgang,

This behavior is not a bug. As is documented in several places in the documentation

https://support.wolfram.com/39071?src=mathematica https://reference.wolfram.com/language/ref/FullSimplify.html#482986235 and https://reference.wolfram.com/language/ref/Sum.html#87823560

Mathematica assumes that unspecified symbolic variables are in general complex. Your symbolic expression fails at integers, but this is a measure-zero set of the complex plane, so the 'generic' validity of the Sum is upheld.

Further information on how to use GenerateConditions and Assumptions to avoid these issues is also available in the documentation at the included links."

My comment: To me this answer is remarkable but neither satisfactory nor useful for practical purposes. Considering that I have provided a Mathematica expression which yields the correct values also at integers the simple question is: why doesn't Mathematica return this expression? (Also, the Integrate question was not answered.)

Bottom line: I have received two different strange answers to my observation.

added 1007 characters in body
Source Link

This self answer consists of three parts. In the first past we provide closed expression for the sum for all vaues of the parameter $x \gt 0$, the second part shows a close relation between the correct result and the wrong one returned by Mathematica, finally, I briefly discuss a well appreciated but wrong answer.

Looking for anWe start with deriving an integral representation usingof the sum.

Using the formula

which returns the condition x>1 and the (correct) expression si[x>1,n] above.

Assumptions-> 0<x<1 returns But what happens in the remaining region of $x$?

Integrate[Log[1/z] (z^n - z^(n x))/(z - z^x), {z, 0, 1}, 
 Assumptions -> 0 < x < 1]

(* Out (-PolyGamma[1, n/(-1 + x)] + PolyGamma[1, (n x)/(-1 + x)])/(-1 + x)^2 *)

At $x=1/2$ this gives

4 (-PolyGamma[1, -2 n] + PolyGamma[1, -n])

which is just as wrong as the generic result sg[x,n].

Hence also Integrate[] has a similar bug as Sum[].

What's the remedy? Well, let usone idea is to just set x->1/2 before doing the integral:

ThisNow the result corresponds to the general correct formula (2)si[x,n].

This heuristic trick results ingives (2)si[x,n] valid for 0<x<1.

Comment on Soler's answerRelation between correct and wrong expression

§1 Soler's formula is wrong for almost any real n Let us compare these two expressions for $x = 2$

This answer received pretty much support from the community.

The main assertion refers to this formula

s0 = PolyGamma[1, 1 - 2 n] - PolyGamma[1, 1 - n] (* wrong *);
s1 = PolyGamma[1, n] - PolyGamma[1, 2 n] (* correct *);

and states: "Unless you explicitly state otherwise, Sum evaluates generically, ignoring specific conditions. In your case, the result for generic n is correct"

In fact the expression s0 is wrong for any positive integer n. Simpliy because it is divergent.

And here we show that the formula s0 is wrong almost everywhere.

In the first part I haves0 is returned by Mathematica, and it is wrong, as it leads to infinite values for positive integer n, s1 was derived by analytic continuation, and it is true as it gives the formulacorrect values for positive integers n.

s1 = PolyGamma[1, n] - PolyGamma[1, 2 n];

and provedFor brevity we shall say s0 is wrong if it to be true for positive integers ndoes not conincide with s1.

So the problem can be decoupled from the divergence.

But we can derive the difference quite generally using the reflection formulareflection formula of the polygamma function (https://de.wikipedia.org/wiki/Polygammafunktion)

s1 - s0 = [Pi]^2/Sin[n [Pi]]^2 - [Pi]^2/Sin[2 n [Pi]]^2

s1 - s0 = \[Pi]^2/Sin[n \[Pi]]^2 - \[Pi]^2/Sin[2 n \[Pi]]^2

Hence s0s0 is incorrect for all real nn except finitelycountably many values. This is sometimes stated as "almost always inccorect".

§2 The strange method of SolerComment on the strange answer of Soner

But let's nevertheless turn toI make this comment because this answer was pretty much appreciated by the "reasoning"community.

In spite of Solerthis support this answer is planily wrong, and this goes for the result as well as for the method.

The answer starts with the bold face line "it is not a bug", and then states: "Unless you explicitly state otherwise, Sum evaluates generically, ignoring specific conditions. In your case, the result for generic n is correct" and he quotes s0.

In fact the expression s0 is wrong for any positive integer n. Simply because it is divergent. And we have furthermore shown that s0 is wrong almost everywhere.

But let's nevertheless turn to the "reasoning" of Soner:

The first step is clear: an expansion in nn about the value n=10n=10 in question. To first order this yields

Now the magic (or was it perhaps meant as a test of the audience?): the author just throws away the divergent part (by suddenly applying an additional limit n->inf, remember that we were at n=10) and declare the rest as the value of the function.

It is interesting that the finite partSimply stated: this is indeed the value of the sum (the intimate relation between correct and incorrect formulas has been shown strictly using the reflection formula above) but the procedure applied here looks more like a joke to menot mathematics. With the same "method" youhe could as well "prove" that Zeta[1] = 0.

Looking for an integral representation using the formula

which returns the condition x>1 and the expression si[x>1,n] above.

Assumptions-> 0<x<1 returns

4 (-PolyGamma[1, -2 n] + PolyGamma[1, -n])

which is just as wrong as the generic result.

What's the remedy? Well, let us just set x->1/2 before doing the integral

This corresponds to the general formula (2).

This heuristic trick results in (2) valid for 0<x<1.

Comment on Soler's answer

§1 Soler's formula is wrong for almost any real n

This answer received pretty much support from the community.

The main assertion refers to this formula

s0 = PolyGamma[1, 1 - 2 n] - PolyGamma[1, 1 - n] ;

and states: "Unless you explicitly state otherwise, Sum evaluates generically, ignoring specific conditions. In your case, the result for generic n is correct"

In fact the expression s0 is wrong for any positive integer n. Simpliy because it is divergent.

And here we show that the formula s0 is wrong almost everywhere.

In the first part I have derived by analytic continuation the formula

s1 = PolyGamma[1, n] - PolyGamma[1, 2 n];

and proved it to be true for positive integers n.

But we can derive the difference quite generally using the reflection formula of the polygamma function (https://de.wikipedia.org/wiki/Polygammafunktion)

s1 - s0 = [Pi]^2/Sin[n [Pi]]^2 - [Pi]^2/Sin[2 n [Pi]]^2

Hence s0 is incorrect for all real n except finitely many values. This is sometimes stated as "almost always inccorect".

§2 The strange method of Soler

But let's nevertheless turn to the "reasoning" of Soler:

The first step is clear: an expansion in n about the value n=10 in question. To first order this yields

Now the magic: the author just throws away the divergent part (by suddenly applying an additional limit n->inf, remember that we were at n=10) and declare the rest as the value of the function.

It is interesting that the finite part is indeed the value of the sum (the intimate relation between correct and incorrect formulas has been shown strictly using the reflection formula above) but the procedure applied here looks more like a joke to me. With the same "method" you could as well "prove" that Zeta[1] = 0.

This self answer consists of three parts. In the first past we provide closed expression for the sum for all vaues of the parameter $x \gt 0$, the second part shows a close relation between the correct result and the wrong one returned by Mathematica, finally, I briefly discuss a well appreciated but wrong answer.

We start with deriving an integral representation of the sum.

Using the formula

which returns the condition x>1 and the (correct) expression si[x>1,n] above.

But what happens in the remaining region of $x$?

Integrate[Log[1/z] (z^n - z^(n x))/(z - z^x), {z, 0, 1}, 
 Assumptions -> 0 < x < 1]

(* Out (-PolyGamma[1, n/(-1 + x)] + PolyGamma[1, (n x)/(-1 + x)])/(-1 + x)^2 *)

At $x=1/2$ this gives

4 (-PolyGamma[1, -2 n] + PolyGamma[1, -n])

which is just as wrong as the generic result sg[x,n].

Hence also Integrate[] has a similar bug as Sum[].

What's the remedy? Well, one idea is to just set x->1/2 before doing the integral:

Now the result corresponds to the general correct formula si[x,n].

This heuristic trick gives si[x,n] valid for 0<x<1.

Relation between correct and wrong expression

Let us compare these two expressions for $x = 2$

s0 = PolyGamma[1, 1 - 2 n] - PolyGamma[1, 1 - n] (* wrong *);
s1 = PolyGamma[1, n] - PolyGamma[1, 2 n] (* correct *);

s0 is returned by Mathematica, and it is wrong, as it leads to infinite values for positive integer n, s1 was derived by analytic continuation, and it is true as it gives the correct values for positive integers n.

For brevity we shall say s0 is wrong if it does not conincide with s1.

So the problem can be decoupled from the divergence.

But we can derive the difference quite generally using the reflection formula of the polygamma function (https://de.wikipedia.org/wiki/Polygammafunktion)

s1 - s0 = \[Pi]^2/Sin[n \[Pi]]^2 - \[Pi]^2/Sin[2 n \[Pi]]^2

Hence s0 is incorrect for all real n except countably many values. This is sometimes stated as "almost always inccorect".

Comment on the strange answer of Soner

I make this comment because this answer was pretty much appreciated by the community.

In spite of this support this answer is planily wrong, and this goes for the result as well as for the method.

The answer starts with the bold face line "it is not a bug", and then states: "Unless you explicitly state otherwise, Sum evaluates generically, ignoring specific conditions. In your case, the result for generic n is correct" and he quotes s0.

In fact the expression s0 is wrong for any positive integer n. Simply because it is divergent. And we have furthermore shown that s0 is wrong almost everywhere.

But let's nevertheless turn to the "reasoning" of Soner:

The first step is clear: an expansion in n about the value n=10 in question. To first order this yields

Now the magic (or was it perhaps meant as a test of the audience?): the author just throws away the divergent part (by suddenly applying an additional limit n->inf, remember that we were at n=10) and declare the rest as the value of the function.

Simply stated: this is not mathematics. With the same "method" he could as well "prove" that Zeta[1] = 0.

elaborate more on the wrong answer of Soler
Source Link

Closed expressions for the sum

To begin with, let me write down these closed expressions for the sum

Comment on Soler's answer

§1 Soler's formula is wrong for almost any real n

The main asertioneassertion refers to this formula

s0 = PolyGamma[1, 1 - 2 n] - PolyGamma[1, 1 - n] ;

and states: "Unless you explicitly state otherwise, Sum evaluates generically, ignoring specific conditions. In your case, the result for generic n is correct"

In fact the expression s0 is wrong for any positive integer n. Simpliy because it is divergent.

And here we show that the formula s0 is wrong almost everywhere.

In the first part I have derived by analytic continuation the formula

s1 = PolyGamma[1, n] - PolyGamma[1, 2 n];

and proved it to be true for positive integers n.

It is easy to show that s0 is wrong not only for positive integers n but also for real values, say n=1/5.

{s0, s1} /. n -> 1/5
% // N

(* Out[350]= {PolyGamma[1, 3/5] - PolyGamma[1, 4/5], PolyGamma[1, 1/5] - PolyGamma[1, 2/5]}

Out[351]= {1.33674, 18.992}
*)

But we can derive the difference quite generally using the reflection formula of the polygamma function (https://de.wikipedia.org/wiki/Polygammafunktion)

$$(-1)^m \Psi_m(1-z) = \Psi_m(z) -\pi \frac{d^m}{dz^m}{\cot(\pi z)$$

which gives

s1 - s0 = [Pi]^2/Sin[n [Pi]]^2 - [Pi]^2/Sin[2 n [Pi]]^2

This quantity vanishes only for n=k[PlusMinus]1/3, k[Element]Integers.

Hence s0 is incorrect for all real n except finitely many values. This is sometimes stated as "almost always inccorect".

§2 The strange method of Soler

But let's nevertheless turn to the "reasoning" of Soler:

It is interesting that the finite part is indeed the value of the sum (the intimate relation between correct and incorrect formulas has been shown strictly using the reflection formula above) but the procedure applied here looks more like a joke to me. With the same "method" you could as well "prove" that Zeta[1] = 0.

To begin with, let me write down these closed expressions for the sum

Comment on Soler's answer

The main asertione states: "Unless you explicitly state otherwise, Sum evaluates generically, ignoring specific conditions. In your case, the result for generic n is correct"

In fact the expression is wrong for any positive integer n. Simpliy because it is divergent.

But let's nevertheless turn to the "reasoning":

It is interesting that the finite part is indeed the value of the sum but the procedure applied here looks more like a joke to me. With the same "method" you could as well "prove" that Zeta[1] = 0.

Closed expressions for the sum

To begin with, let me write down these closed expressions for the sum

Comment on Soler's answer

§1 Soler's formula is wrong for almost any real n

The main assertion refers to this formula

s0 = PolyGamma[1, 1 - 2 n] - PolyGamma[1, 1 - n] ;

and states: "Unless you explicitly state otherwise, Sum evaluates generically, ignoring specific conditions. In your case, the result for generic n is correct"

In fact the expression s0 is wrong for any positive integer n. Simpliy because it is divergent.

And here we show that the formula s0 is wrong almost everywhere.

In the first part I have derived by analytic continuation the formula

s1 = PolyGamma[1, n] - PolyGamma[1, 2 n];

and proved it to be true for positive integers n.

It is easy to show that s0 is wrong not only for positive integers n but also for real values, say n=1/5.

{s0, s1} /. n -> 1/5
% // N

(* Out[350]= {PolyGamma[1, 3/5] - PolyGamma[1, 4/5], PolyGamma[1, 1/5] - PolyGamma[1, 2/5]}

Out[351]= {1.33674, 18.992}
*)

But we can derive the difference quite generally using the reflection formula of the polygamma function (https://de.wikipedia.org/wiki/Polygammafunktion)

$$(-1)^m \Psi_m(1-z) = \Psi_m(z) -\pi \frac{d^m}{dz^m}{\cot(\pi z)$$

which gives

s1 - s0 = [Pi]^2/Sin[n [Pi]]^2 - [Pi]^2/Sin[2 n [Pi]]^2

This quantity vanishes only for n=k[PlusMinus]1/3, k[Element]Integers.

Hence s0 is incorrect for all real n except finitely many values. This is sometimes stated as "almost always inccorect".

§2 The strange method of Soler

But let's nevertheless turn to the "reasoning" of Soler:

It is interesting that the finite part is indeed the value of the sum (the intimate relation between correct and incorrect formulas has been shown strictly using the reflection formula above) but the procedure applied here looks more like a joke to me. With the same "method" you could as well "prove" that Zeta[1] = 0.

Comment on the most appreciated answer
Source Link
Loading
added 413 characters in body
Source Link
Loading
Source Link
Loading