# A Wolfram Notebook on the World of Limits

## Introduction

Introduction

Limits of functions play a foundational role in calculus, since the notions of derivatives and integrals are defined using limiting processes. Yet limits have a life of their own and occur in many other areas, including number theory, geometry and computational complexity.

Furthermore, they exist in different flavors, such as sequence limits, function limits, recursive sequence limits and multivariate limits. Here, you will be taken on a tour through this fascinating world using examples that illustrate the wide variety of limiting behaviors that are seen in practice.

## Periodic Sequences

Periodic Sequences

Many sequences that arise in practice (for example, in signal communication) are periodic in the sense that their values repeat themselves at regular intervals. The length of any such interval is called the period of the sequence. As an example, consider the following sequence that is defined using Mod:

Clickinthecode,thenholdandpresstorunit

a[n_]:=Mod[n,6]

In[1]:=

A plot of the sequence shows that the sequence is periodic with period :

6

DiscretePlot[a[n],{n,0,20}]

In[2]:=

Out[2]=

This sequence does not converge since it oscillates between and . Hence, DiscreteLimit, introduced in Version 11.2, returns Indeterminate in this case:

0

5

DiscreteLimit[a[n],n∞]

In[3]:=

Indeterminate

Out[3]=

DiscreteMinLimit and DiscreteMaxLimit can be used to compute the lower and upper limits of oscillation, respectively, in such cases. Thus we have:

DiscreteMinLimit[a[n],n∞]

In[4]:=

0

Out[4]=

DiscreteMaxLimit[a[n],n∞]

In[5]:=

5

Out[5]=

Although Sin and Cos are periodic when viewed as functions over the real numbers, the above integer sequence behaves in a bizarre manner and is very far from being a periodic sequence, as confirmed by the following plot:

Hence, the limit of this sequence does not exist:

Using the same method, DiscreteMaxLimit returns a rather messy-looking result in terms of algebraic Root objects for this example:

## Recursive Sequences

Recursive Sequences

Sequence limits occur in a natural way when we try to compute the value of infinitely nested radicals. For example, consider the problem of evaluating the following nested radical:

The successive terms in the expansion of the radical can be generated by using RSolveValue, since the sequence satisfies a nonlinear recurrence. For example, the third term in the expansion is obtained as follows:

## Asymptotic Analysis

Asymptotic Analysis

The answer given by this estimate for the number 200 is remarkably close to 4 trillion:

With a much larger integer, we get an even better approximation for the number of partitions almost instantaneously, as seen in the following example:

## Function Limits

Function Limits

The following plot provides visual confirmation that the limit is indeed 1:

l’Hôpital’s rule gives a powerful method for evaluating many limits that occur in practice. However, it may require a large number of steps before arriving at the answer. For example, consider the following limit:

That limit requires six repeated applications of l’Hôpital’s rule to arrive at the answer 0, since all the intermediate computations give indeterminate results:

Thus, we see that l’Hôpital’s rule has limited utility as a practical algorithm for finding function limits, since it is impossible to decide when the algorithm should stop. Hence, the built-in Limit function uses a combination of series expansions and modern algorithms that work well on inputs involving exponentials and logarithms, the so-called “exp-log” class. In fact, Limit has received a substantial update in Version 11.2 and now handles a wide variety of difficult examples, such as the following, in a rather comprehensive manner (the last two examples work only in the latest release):

## Multivariate Limits

Multivariate Limits

The directional dependence of the limiting value implies that the true multivariate limit does not exist. In Version 11.2, Limit handles multivariate examples with ease, and quickly returns the expected answer Indeterminate for the limit of this function at the origin:

This example indicates that, in general, the limit of a multivariate function does not exist. In other cases, such as the following, the limit exists but the computation is subtle:

The answer can be confirmed by applying Limit to the function directly:

Version 11.2 evaluates 90% of the entire collection in the benchmark, which is remarkable since the functionality for multivariate limits is new in this release:

The term “failure” in the table refers to examples that did not return a solution during the allotted time of ten seconds for individual examples.

Version 11.2 also evaluates a higher fraction of an even larger collection of around 1,000,000 univariate limits from Wolfram|Alpha when compared with Version 11.1:

Limit has been one of the most dependable functions in the Wolfram Language ever since it was first introduced in Version 1 (1988). The improvements for this function, along with DiscreteLimit and other new functions in Version 11.2, have facilitated our journey through the world of limits. I hope that you have enjoyed this brief tour, and welcome any comments or suggestions about the new features.