Limits Unlimited

Adam Strzebonski and Devendra Kapadia, 
Wolfram Research, Inc.

Join the Conversation #WolframTechConf

Plan for the Talk

Improvements for Limit

Max and Min Limits

Multivariate Limits

Discrete Limits

Documentation and Benchmarking

Function Limits

Extended univariate limit scope

Undirected limits (Reals, Complexes)

Conditional results (GenerateConditions)

Returns Indeterminate if proves that no limit exists

Multivariate limits

MinLimit and MaxLimit

Typesetting and new documentation

Extended univariate limit scope

The major extension here is a new implementation of Gruntz’s algorithm. There are also a few special case improvements.

(Underscript[\[Limit], x->∞])(E^((E^x)+(x^2))) (-Erf[(E^(-(E^x)))-x]-Erf[x])

(Underscript[\[Limit], x->∞])((4 (E^(E^((16/(x^8))+(20/(x^(5/7)))+21 (x^(6/11))+((432 (x^(49/45)))/17)))))/(9 ((Log[Log[-Log[(4/(3 (x^(5/14))))]]])^(7/6))))

(Underscript[\[Limit], x->-∞])(3 x+(Sqrt[9 (x^2)+4 x-Sin[x]]))

Success rate for the benchmark of 1 million limits from W|A increased from 93% to 97%.

Undirected limits

In earlier versions Limit was computing directed limits. With the default setting Direction->Automatic, limits at finite points were computed from the right.

(Underscript[\[Limit], x->(SuperPlus[0])])(1/x)

The default setting of Direction is now Reals, which means limits from both sides must exist and be equal.

(Underscript[\[Limit], x->0])(1/x)

To get the behaviour from older versions one can set Direction -> -1 (the setting of Direction is ignored when the limit point is infinite).

Direction -> Complexes requires the limit to exist for an arbitrary approach in the complex plane.

(Underscript[\[Limit], x->0])x Sin[(1/x)]

(Underscript[\[Limit], x(Underscript[->, (Complexes)])0])x Sin[(1/x)]

Limit[x Sin[(1/x)],x->0,Direction->I]

Conditional results

Limit may now return conditionally valid results.

(Underscript[\[Limit], x->∞])((x^n)-((Log[x])^(n+1)))

Conditions are chosen to be consistent with assumptions.

Limit[(x^n)-((Log[x])^(n+1)),x->∞,Assumptions->n<0]

With GenerateConditions -> None conditions are not generated.

Limit[(x^n)-((Log[x])^(n+1)),x->∞,GenerateConditions->None]

With GenerateConditions -> False conditions are generated, but not reported.

Limit[(x^n)-((Log[x])^(n+1)),x->∞,GenerateConditions->False]

Indeterminate and Interval output

If Limit proves that no limit exists it returns Indeterminate.

(Underscript[\[Limit], x->∞])Sin[x]

Interval output is returned when Limit knows bounds on all limit points, but it cannot prove that the limit does not exist.

(Underscript[\[Limit], x->∞])(Sin[x]+((x Cos[x])/(x+1)))

In the earlier versions Limit returned Interval in some of the cases in which it now returns Indeterminate. If Interval result is preferable, Indeterminate output may be disabled using the Method option (or globally with SetSystemOptions[“LimitOptions” -> {“AllowIndeterminateOutput” -> False}]]).

Limit[Sin[x],x->∞,Method->{"AllowIndeterminateOutput"->False}]

Multivariate Limits

Multivariate limits of rational functions.

(Underscript[\[Limit], {x,y}->0])(((x^2)+(x^4)+(y^2)+x (y^2))/((x^2)-(x^2) y+(y^2)))

Plot3D[(((x^2)+(x^4)+(y^2)+x (y^2))/((x^2)-(x^2) y+(y^2))),{x,-1,1},{y,-1,1}]

(Underscript[\[Limit], {x,y}->0])(((x^4)+(y^2))/((x^2)+(x^4)+(y^2)+x (y^2)))

Plot3D[(((x^4)+(y^2))/((x^2)+(x^4)+(y^2)+x (y^2))),{x,-1,1},{y,-1,1}]

The limit is computed over the set of points at which the function is defined.

(Underscript[\[Limit], {x,y}->0])(((x^2)-(y^2))/(Cos[x]-Cos[y]))

Plot3D[(((x^2)-(y^2))/(Cos[x]-Cos[y])),{x,-1,1},{y,-1,1}]//Quiet

Limit of a rational function with 3 variables.

(Underscript[\[Limit], {x,y,z}->0])((x y-x z+y z)/((x^2)+(y^2)+(z^2)))

A complete algorithm exists for multivariate limits of rational functions. Limit also has many special case methods, so it can handle most textbook multivariate limit problems.

The success rate for the benchmark of almost 120,000 limits from W|A is 91%.

MinLimit and MaxLimit

(Underscript[\[MinLimit], x->∞])(Sin[x]+2 Cos[3 x])

(Underscript[\[MaxLimit], x->∞])(Sin[x]+2 Cos[3 x])

Plot[{Sin[x]+2 Cos[3 x],%%,%},{x,-10,10}]

(Underscript[\[MinLimit], {x,y}->0])(((x^4)+(y^2))/((x^2)+(x^4)+(y^2)+x (y^2)))

(Underscript[\[MaxLimit], {x,y}->0])(((x^4)+(y^2))/((x^2)+(x^4)+(y^2)+x (y^2)))

Plot3D[(((x^4)+(y^2))/((x^2)+(x^4)+(y^2)+x (y^2))),{x,-1,1},{y,-1,1}]

minl=(Underscript[\[MinLimit], x->∞])(Sin[x]+2 Cos[π x]+4 Mod[x,(Sqrt[2])])

maxl=(Underscript[\[MaxLimit], x->∞])(Sin[x]+2 Cos[π x]+4 Mod[x,(Sqrt[2])])

Plot[{Sin[x]+2Cos[Pi x]+4Mod[x,Sqrt[2]],minl,maxl},{x,-10,10}]

Plot[{Sin[x]+2Cos[Pi x]+4Mod[x,Sqrt[2]],minl,maxl},{x,-100,100},PlotPoints->500]

Discrete Limits

Motivation

Many limiting processes are inherently discrete in nature.

For example, the area of a circle is the limit of the area of a regular n-sided polygon, as n ->∞.

area[n_,r_] = Area[RegularPolygon[r,n]]

Animate[Grid@List@{Graphics[{Red,Circle[],Hue[0.6,0.5],RegularPolygon[n]}],a==N[area[n,r],{5,5}]},{n,Join[Range[3,10],{15,20,100,1000}],Appearance->"Labeled"},SaveDefinitions->True, DefaultDuration-> 10, AnimationRepetitions-> 3]

Other examples of discrete limits arise in number theory, signal processing, and dynamical systems.

The New Discrete Limit Functions

Version 11.2 introduces DiscreteLimit, DiscreteMaxLimit, and DiscreteMinLimit for computing limits of sequences.

For example,

DiscreteLimit[Sin[n π], n->∞]

They should be useful for many purposes (college calculus, discrete calculus, etc.).

Examples for Discrete Limits

Periodic Sequences

Limit involving a periodic sequence:

b[n_]:=Mod[n,5]+1

DiscretePlot[b[n],{n,1,20},PlotRange->{0,6}]

The limit does not exist:

DiscreteLimit[b[n],n->∞]

The max limit is 5:

DiscreteMaxLimit[b[n],n->∞]

The min limit is 1:

DiscreteMinLimit[b[n],n->∞]

Densely Aperiodic Sequences

Here is a densely aperiodic sequence:

p[n_]:=(E^(((Sin[2 n])^2)/(2+Cos[n])))

DiscretePlot[p[n],{n,1,550,5}]

The limit does not exist:

DiscreteLimit[p[n],n->∞]

The max limit is obtained using the real maximum:

DiscreteMaxLimit[p[n], n -> ∞]

N[%]

The min limit is 1:

DiscreteMinLimit[p[n], n -> ∞]

Number Theoretic Sequences

Prime is of asymptotic to n log(n):

(Underscript[\[Limit], n(Underscript[->, (Integers)])∞])((Prime[n])/(n Log[n]))

Limit involving PartitionsP:

(Underscript[\[Limit], n(Underscript[->, (Integers)])∞])((n PartitionsP[n])/(E^((Sqrt[(2/3)]) (Sqrt[n]) π)))

Recursive Sequences

Compute the limit of a trigonometric recursive sequence:

RSolveValue[{x[n+1]==Cos[x[n]]/2 , x[1]== π/3}, x[∞], n]

N[%]

Visualize the convergence of the sequence to its limiting value:

ListPlot[RecurrenceTable[{x[n+1]== Cos[x[n]]/2 , x[1]== π/3}, x[n], {n,1,15}],PlotStyle->Red]

Documentation and Benchmarking

Documentation

The reference page for Limit has been completely rewritten for Version 11.2.

The ref pages for DiscreteLimit and other functions too contain examples for typesetting, applications, etc.

Benchmarking

We ran a benchmark of more than 100,000 Wolfram Alpha examples for multivariate limits with Version 11.2 
and Maple 2017.

The results of this benchmark run are summarized below:

We also ran a benchmark of around 1,000,000 Wolfram Alpha examples for univariate limits with Version 11.2, 
Maple 2017, and SymPy 1.0.

The results of this benchmark run are summarized below:

A set of 1000 multivariate limits from the benchmark will be made available soon.

These benchmark results clearly demonstrate the power of the new limit functionality in Version 11.2.

Conclusion

Version 11.2 includes a wide range of functions for exploring the world of limits.

Further improvements will be related to development in Series and other Asymptotics functions.