# A simple series expansion which seems to be wrong

FullSimplify[SeriesCoefficient[ArcTanh[x]/(1 + x^2), {x, 0, n}]]


I shall not type the results but,

• not only they seems to be wrong (the first one is given as $$\frac {8+\pi}8$$ instead of $$1$$)

• they cannot evaluate (Indeterminate)

What could be happening ?

• yes, it is a bug. Jul 26, 2023 at 8:35
• MMA version 13.3 Windows. For n=1 I get: 1 Jul 26, 2023 at 8:44
• I forgot to precise that I am using version 13.1.0.0 Jul 26, 2023 at 8:46
• MMA Version 13.3 Mac I get the incorrect result. Jul 26, 2023 at 8:47
• Here's a workaround, strangely without the bug: an = D[ArcTanh[x]/(1 + x^2), {x, n}]/n!. Can check explicit terms with FullSimplify@Table[an /. x -> 0, {n, 0, 10}]. Jul 26, 2023 at 16:28

\$Version

(* "13.3.0 for Mac OS X ARM (64-bit) (June 3, 2023)" *)

Clear["Global*"]

f[x_] = ArcTanh[x]/(1 + x^2);

m = 13;

seq = {#, SeriesCoefficient[f[x], {x, 0, #}]} & /@ Range[m]

(* {{1, 1}, {2, 0}, {3, -(2/3)}, {4, 0}, {5, 13/15}, {6, 0}, {7, -(76/105)}, {8,
0}, {9, 263/315}, {10, 0}, {11, -(2578/3465)}, {12, 0}, {13, 36979/45045}} *)

coef[n_?EvenQ] := 0

coef[n_?OddQ] = Evaluate@Assuming[Mod[n, 2] == 1,
FindSequenceFunction[seq[[1 ;; ;; 2]], n] // FullSimplify]

(* 1/4 (2 LerchPhi[-1, 1, 1 + n/2] + π Sin[(n π)/2]) *)


Comparing with the original sequence,

seq === ({#, coef[#]} & /@ Range[m] // Simplify)

(* True *)


Checking some numeric values,

f[#] == NSum[(DownValues[coef][[2, -1]] /. n -> 2 n - 1 //
Simplify)*#^(2 n - 1),
{n, 1, Infinity}, NSumTerms -> 50, WorkingPrecision -> 15] & /@
RandomReal[1, 10, WorkingPrecision -> 15]

(* {True, True, True, True, True, True, True, True, True, True} *)
`