4
$\begingroup$

Bug introduced in 9.0 or earlier and persisting through 12.2 or later


Executing the following

SeriesCoefficient[Log[1/2 (1 + Sqrt[1 - x])], {x, 0, n}, 
   Assumptions -> {n >= 1, n ∈ Integers}]

I get: mma-outputs-error which clearly asserts that the solution should be zero identically (and can be obtained by apply FullSimplify)– so, did Mathematica make a mistake?

$\endgroup$
4
  • $\begingroup$ Please, try to be as descriptive as possible when asking questions. $\endgroup$
    – Sektor
    Commented Jul 16, 2015 at 12:45
  • $\begingroup$ What happens if you actually evaluate that beastie at nonnegative integers? $\endgroup$ Commented Jul 16, 2015 at 15:48
  • $\begingroup$ clearly a b-g. SeriesCoefficient gives the correct result if you specify any particular n. $\endgroup$
    – george2079
    Commented Jul 16, 2015 at 16:00
  • $\begingroup$ This bug is present even in Math 7.0.1 on win7x64. $\endgroup$
    – innaiz
    Commented Mar 6, 2017 at 11:53

2 Answers 2

9
$\begingroup$

Here is a workaround:

f[x_] = Log[1/2 (1 + Sqrt[1 - x])];

Generate a sequence from several of the coefficients

seq = Table[
   SeriesCoefficient[f[x], {x, 0, n}],
   {n, 8}];

Find the function that generates that sequence

coef[n_] = FindSequenceFunction[seq, n] //
  FullSimplify

-(Pochhammer[3/2, -1 + n]/ (4*n*Gamma[1 + n]))

For an alternative form for the coefficients

coef2[n_] = coef[n] // FunctionExpand

-(Gamma[1/2 + n]/(2*n^2*Sqrt[Pi]* Gamma[n]))

Verifying that these are the general coefficients for the original function

f[x] == Sum[coef[n]*x^n, {n, 1, Infinity}] == 
  Sum[coef2[n]*x^n, {n, 1, Infinity}] // Simplify

True

$\endgroup$
2
  • $\begingroup$ Thanks a lot, but what's the reason mma give me the wrong outputs? $\endgroup$
    – van abel
    Commented Jul 17, 2015 at 0:19
  • $\begingroup$ Its algorithm failed; hence the need for a workaround. $\endgroup$
    – Bob Hanlon
    Commented Jul 17, 2015 at 0:43
3
$\begingroup$

Interesting, doing nearly the same thing as @BobHanlon:

 clist = CoefficientList[
        Normal@Series[Log[1/2 (1 + Sqrt[1 - x])], {x, 0, 12}], x];
 FindSequenceFunction[clist, n]

yields a (Correct) DifferenceRoot expression:

DifferenceRoot[ Function[{[FormalY], [FormalN]}, {(-1 + 3 [FormalN] - 2 [FormalN]^2) [FormalY][[FormalN]] + 2 [FormalN]^2 [FormalY][1 + [FormalN]] == 0, [FormalY][1] == 0, [FormalY][2] == -(1/4)}]][n]

The difference here is clist includes the 0 first term. Not so useful but maybe it will give some insight to the cause of the error.

$\endgroup$
1
  • $\begingroup$ Use FindSequenceFunction[Rest@clist, n] // FullSimplify and you will get the same result as mine. $\endgroup$
    – Bob Hanlon
    Commented Jul 16, 2015 at 17:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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