# Limit of sequence of functions behaving strange

I'm trying to determine the limit of the sequence of functions

$$f_n(x)=\left(\frac{1}{\pi}\arctan(n x) + 1/2\right)^n.$$

I define

f[x_, n_] := (1/2 + ArcTan[n x]/Pi)^n


And enter

Limit[f[x, n], n -> Infinity]


Assuming[x > 0, Limit[f[x, n], n -> Infinity]]


I get the answer $$e^{-\frac{1}{x\pi}}.$$

While

Assuming[x < 0, Limit[f[x, n], n -> Infinity]]


Why does the normal Limit give the answer assuming that x<0? Is this a bug, or have I missed something?

• Please only use the tag bugs post-hoc, if it is confirmed by WRI or the community. – István Zachar Oct 16 '13 at 12:19
• I think it's a bug. The result is not always 0 as you check by using 1 for instance in place of x. – b.gates.you.know.what Oct 16 '13 at 12:51
• Probably a bug or at least a limitation in calculus code. Limit will rely on Series and at least for elementary functions that will ignore branch cut issues unless assumptions are provided that give a clear indication of what side of such a cut we are on. – Daniel Lichtblau Oct 16 '13 at 15:55

It's not a bug in 11.1, but if this is still the case in 11.2, then it will be a bug. :)

Functions that take Assumptions are allowed to make assumptions when necessary. But they are also supposed to tell you when they do that. This is controlled by the GenerateConditions option. Limit in version 11.1 doesn't have this option. It's old, and I don't know that we have a defined behavior. But we're giving Limit a facelift in 11.2, including adding the option. When, unless you disable GenerateConditions, it should report the non-generic assumption x < 0. There will also be a dedicated function for taking limits of sequences instead of functions.

• How exciting! Since Limit is very related to Series, does that mean Series is getting a facelift too? – QuantumDot Sep 1 '17 at 3:19
• Not yet. I think it is safer to say that we will be laying down pieces for Series before we tackle it head on. – Itai Seggev Sep 4 '17 at 21:44
• Cool; may I make a request? Could you make these functions so they are easily user-extensible? – QuantumDot Sep 5 '17 at 1:44
• You're certainly free to make the request... :) More seriously, I would suggest sending a report to support@wolfram.com with the suggestion, being as specific as possible. If it's logged in our database as something customers are asking for, it has a higher chance of being implemented. – Itai Seggev Sep 5 '17 at 18:54

Let's plot the limit of $f$ for a varying value of $x$ as $n$ approches $+\infty$:

DiscretePlot[Limit[f[x, n], n -> Infinity], {x, -10, 10, 0.5}] Based on this discontinuity, I would not be surprised if Limit cannot handle it. Besides, when I evaluate Limit[f[x, n], n -> Infinity], I don't get a result. In conclusion, since you have two different regimes, you should specify which regime you are in.

Assuming[x < 0, Limit[f[x, n], n -> Infinity]]

Output: $0$

Assuming[x > 0, Limit[f[x, n], n -> Infinity]]

Output: $e^{-\frac{1}{\pi x}}$

These answer can be visually justified based on the following plots:

Plot[f[-1, n], {n, 0, 10}, Frame -> True, FrameLabel -> {"n", "f[1,n]"}] Plot[f[+1, n], {n, 0, 10}, Frame -> True, FrameLabel -> {"n", "f[1,n]"}] No problem with

Limit[(1/2 + ArcTan[n x]/Pi)^n, n -> Infinity, Assumptions -> x > 0]


$e^{-\frac{1}{\pi x}}$