8
$\begingroup$

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?

$\endgroup$
2
  • $\begingroup$ This must be a bug. In Version 8.0 'SumConvergence[Sin[50/n^2], n] ' yields the expected 'True'. $\endgroup$
    – Akku14
    Mar 17, 2017 at 6:55
  • $\begingroup$ 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 $\endgroup$
    – xzczd
    Jan 9, 2018 at 6:17

1 Answer 1

4
$\begingroup$

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  *)
$\endgroup$
2
  • $\begingroup$ Interesting. How did you notice that hidden syntax of Method? $\endgroup$
    – xzczd
    Jan 10, 2018 at 5:23
  • 1
    $\begingroup$ 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. $\endgroup$
    – Michael E2
    Jan 10, 2018 at 5:34

This site is temporarily in read-only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .