3
$\begingroup$

Sometimes when trying to find the limit of a function $f(n)$ when $n\to\infty$ using Limit[f,n->Infinity], it seems that Mathematica is unable to compute it numerically. Instead, I get a result like

Limit[f,n->Infinity]

in place of a numerical value. I'm guessing it is unable to simplify the expression enough to be able to compute a value. In this case it would be helpful at least to know if the limit exists, but I haven't found a way to determine this after reading the Mathematica documentation.

My questions are:

If Mathematica returns the original expression when using Limit[], does this mean it is unable to compute the limit, or am I missing something?

How may I determine the existence of a limit in Mathematica, when it is not possible to determine a value for it?

$\endgroup$

1 Answer 1

6
$\begingroup$

Mathematica is not always able to calculate limits and sometimes not only gives up, but makes mistakes.

For example, writing:

Limit[n Sin[2 Pi E n!], n -> Infinity]

we get:

Indeterminate

when, in reality, the limit exists and is valid 2 Pi.

On the other hand, by writing:

DiscreteLimit[n Sin[2 Pi E n!], n -> Infinity]

we get the correct result:

$2 \pi$

A last chance that could sometimes be comfortable is the following:

Limit[(1 - Cos[x])/x^2, x -> 0]
Needs["NumericalCalculus`"]
NLimit[(1 - Cos[x])/x^2, x -> 0, WorkingPrecision -> 15]

through which we obtain:

$\frac{1}{2}$

0.500000

I hope it is useful.

$\endgroup$
3
  • 1
    $\begingroup$ Limit[n Sin[2 Pi E n!], n -> Infinity] doesn't exist, so Indeterminate is no mistake $\endgroup$
    – Coolwater
    Jul 7, 2018 at 9:34
  • 1
    $\begingroup$ To reinforce comment by @Coolwater, look at LogLinearPlot[n Sin[2 Pi E n!], {n, 1, 100}, WorkingPrecision -> 200, PlotRange -> All] $\endgroup$
    – Bob Hanlon
    Jul 7, 2018 at 13:09
  • 2
    $\begingroup$ The limit exist if $n\in\mathbb N$, and it doesn't if $n\in\mathbb R$ (cf. the code by Bob Hanlon vs. Show[DiscretePlot[n Sin[2 Pi E n!], {n, 1, 30}, WorkingPrecision -> 100], Plot[2 Pi, {n, 1, 30}]]). The output my MMA is correct: Indeterminate in the real case, 2 Pi in the discrete case. $\endgroup$ Jul 7, 2018 at 13:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.