Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Bug introduced in 7.0 and fixed in 9.0.0

According to the documentation


However, for $a_n=1/(n+2)$ I obtain

{Sum[1/(n + 2) x^n, {n, 0, Infinity}], GeneratingFunction[1/(n + 2), n, x]} // FullSimplify
% /. x -> .2
(*{-((x + Log[1 - x])/x^2), PolyLog[2, x]/x}*)
(*{0.578589, 1.05502}*)



I'm using Mathematica on a Linux x86 (32-bit)

share|improve this question ; first sentence under 'Details and Options' – Eckhard Sep 3 '13 at 15:37
For me it gives identical results (0.578589) under v9.0.1. Which version do you use? GeneratingFunction[1/(n + 2), n, x] ==> (-1-(Log[1-x]/x))/x – István Zachar Sep 3 '13 at 15:41
@István what expression is produced by GeneratingFunction[1/(n + 2), n, x]? – Mr.Wizard Sep 3 '13 at 15:42
@Mr.Wizard (-1 - Log[1 - x]/x)/x in v9. PolyLog[2, x]/x in v8. – Szabolcs Sep 3 '13 at 15:44
@Eckhard If you suspect a bug and you are using anything else than the latest version (9.0.1 at this time), please indicate the version in the question. – Szabolcs Sep 3 '13 at 15:45
up vote 8 down vote accepted

This appears to be a bug in version 8 that was fixed in version 9.

Sum[a[n] x^n, {n, 0, Infinity}] gives (-x - Log[1 - x])/x^2 in both.

In version 8.0.4,

GeneratingFunction[a[n], n, x] gives PolyLog[2, x]/x, which is incorrect.

In version 9.0.1,

GeneratingFunction[a[n], n, x] gives (-1 - Log[1 - x]/x)/x which is equivalent to the result from Sum.

share|improve this answer
Is there a way to know in advance if the result of GeneratingFunction[] will be correct, or two work around the problem? – Eckhard Sep 3 '13 at 16:04
@Eckhard Well, a bug is a bug. It's not intentionally included. Symbolic results can typically be verified numerically, in the same way you did. You can calculate the function value for a particular x using NSum (the numerical version of Sum) and check that the results match. Numerical calculations can go awry too, but this happens less frequently than with symbolic ones. Generally, symbolic algebra software do have bugs, no matter which one you are using, and it is good practice to verify results. – Szabolcs Sep 3 '13 at 16:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.