8

Backslide introduced in 9, persisting through 11.2.


Consider the series $\sum_{n=1}^\infty\sin\frac{50}{n^2}$. The terms are eventually positive.

ListPlot[Table[Sin[50/n^2], {n, 1, 40}]]

Which produces this image.

enter image description here

Therefore, I was able to use the Limit Comparison Test.

a[n] := Sin[50/n^2]
b[n] := 50/n^2
Limit[a[n]/b[n], n -> ∞]

Which produced an answer of 1. Because this limit is strictly positive and $\sum_{n=1}^\infty\frac{50}{n^2}$ is convergent ($p$-series with $p=2>1$), by the Limit Comparison Test, the series $\sum_{n=1}^\infty\sin\frac{50}{n^2}$ is also convergent. However,

SumConvergence[Sin[50/n^2], n]

does not produce a "True" response. I also tried:

Assuming[n >= 10, SumConvergence[Sin[50/n^2], n]]

Which was also unsuccessful. Is this something I should report?

xzczd
  • 65,995
  • 9
  • 163
  • 468
David
  • 14,883
  • 4
  • 44
  • 117
  • This must be a bug. In Version 8.0 'SumConvergence[Sin[50/n^2], n] ' yields the expected 'True'. – Akku14 Mar 17 '17 at 06:55
  • The issue is introduced in v9, since it just returns unevaluated rather than a wrong answer, I think it's better to call it a "backslide". @akku14 – xzczd Jan 09 '18 at 06:17

1 Answers1

4

The problem is that the Sin in the term triggers a heuristic check that prevents the integral test from being performed. The assumption is that if the function contains Sin, then it is not monotonic, I suppose.

I don't know a good way around it, especially since I know you're usually interested in natural-looking methods that your students can understand without a bunch of complicated explanations. Here's a proof of concept workaround, I suppose:

term /: Integrate[term[n_], args___] := (foo = Stack[]; Integrate[Sin[50/n^2], args]);
term[n_Integer] := Sin[50/n^2];
SumConvergence[term[n], n, Method -> "IntegralTest"]

(*  True  *)

foo
(*
  {SumConvergence, Block, CompoundExpression, CompoundExpression, Set, 
  Sum`SumConvergenceDump`iSumConvergence, Block, CompoundExpression, 
  Set, Quiet, Sum`SumConvergenceDump`SumConvergenceTestMethod, Block, 
  CompoundExpression, Set, Catch, CompoundExpression, 
  CompoundExpression, Set, Sum`SumConvergenceDump`SumIntegralTest, 
  Block, CompoundExpression, Set, Quiet, Check, CompoundExpression, Set}
*)

The foo = Stack[] may be omitted. It was only to prove SumConvergence made the journey to the integral test of term.


Update: Less hacky -- user-defined test.

myIntegralTest[e_, k_] := (* one could also check the hypotheses *)
 FreeQ[Quiet@Integrate[e, {k, 10^10, Infinity}], Integrate];

SumConvergence[Sin[50/n^2], n, Method -> myIntegralTest]
(*  True  *)

SumConvergence[1/n, n, Method -> myIntegralTest]
(*  False  *)

Alternatively (again, inadequate checking of hypotheses):

myLCT[e_, k_] := SumConvergence[Normal@Series[e, {k, Infinity, 2}], k];

SumConvergence[Sin[50/n^2], n, Method -> myLCT]
(*  True  *)

It's odd that there's a hook for user-defined methods in Sum and SumConvergence, but they're not documented.


Another hack, with term as above:

Internal`InheritedBlock[{Sum`SumConvergenceDump`SumIntegralTest},
 Sum`SumConvergenceDump`SumIntegralTest[Sin[50/n^2], args___] :=
  Sum`SumConvergenceDump`SumIntegralTest[term[n], args];
 SumConvergence[Sin[50/n^2], n]
 ]

(*  True  *)
Michael E2
  • 235,386
  • 17
  • 334
  • 747
  • Interesting. How did you notice that hidden syntax of Method? – xzczd Jan 10 '18 at 05:23
  • 1
    I think the first method I tried was something like foo[args___] := (Print[{args}]; True). But I confirmed it with PrintDefinitions -- the code is inspectable. – Michael E2 Jan 10 '18 at 05:34