2
$\begingroup$

Bug introduced in 9.0 or earlier and persisting through 11.0.1 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$
  • $\begingroup$ Please, try to be as descriptive as possible when asking questions. $\endgroup$ – Sektor Jul 16 '15 at 12:45
  • $\begingroup$ What happens if you actually evaluate that beastie at nonnegative integers? $\endgroup$ – J. M. will be back soon Jul 16 '15 at 15:48
  • $\begingroup$ clearly a b-g. SeriesCoefficient gives the correct result if you specify any particular n. $\endgroup$ – george2079 Jul 16 '15 at 16:00
  • $\begingroup$ This bug is present even in Math 7.0.1 on win7x64. $\endgroup$ – innaiz Mar 6 '17 at 11:53
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$
  • $\begingroup$ Thanks a lot, but what's the reason mma give me the wrong outputs? $\endgroup$ – van abel Jul 17 '15 at 0:19
  • $\begingroup$ Its algorithm failed; hence the need for a workaround. $\endgroup$ – Bob Hanlon Jul 17 '15 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$
  • $\begingroup$ Use FindSequenceFunction[Rest@clist, n] // FullSimplify and you will get the same result as mine. $\endgroup$ – Bob Hanlon Jul 16 '15 at 17:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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