# Symbolic and numeric limit disagreeing on branch cut of ArcTan

Bug introduced after 8.0.4 and before 9.0.1 and fixed in 11.1.0.

Investigating comments to my previous question lead me to the following problem:

 N[Limit[ ArcTan[Sqrt[-4 E^(I a)]], a -> 0]]
(* 4.71239 + 0.549306 I *)

Limit[N[ ArcTan[Sqrt[-4 E^(I a)]]], a -> 0]
(* 1.5708 - 0.549306 I *)


In a sense, both answers are acceptable, since the square of the tangent of both of them gives -4, but they appear to disagree on the branch cut for the ArcTan function. Any ideas what the problem might be?

• v8.0.4 gives the correct answer, while v9.0.1 outputs 4.71239 + 0.549306 I for both pieces of code. So this is bug (bugs?) introduced after v8.0.4 and partly fixed in v10. – xzczd May 29 '16 at 14:20
• @xzczd, just to assist debugging, what are the results of Series[ArcTan[Sqrt[-4 E^(I a)]], {a, 0, 0}] // Normal in all the versions you have? – J. M. will be back soon May 29 '16 at 14:26
• @J.M. v8.0.4 and v9.0.1 gives I ArcTanh + π Floor[(π - 2 Arg[-2 I + 2 Sqrt[-E^(I a)]])/(4 π)] + π Floor[(π + 2 Arg[-2 I + 2 Sqrt[-E^(I a)]])/(4 π)], v10.4.1 (Wolfram Cloud) gives I ArcTanh[ 2] + π Floor[(π - 2 Arg[-2 I + 2])/(4 π)] + π Floor[(π + 2 Arg[-2 I + 2])/(4 π)] (Though can't be proved by Simplify, this seems to be the same result as that in v8 and v9.) – xzczd May 29 '16 at 14:36
• @bbgodfrey ArcTan isn't a special function. – Artes Aug 15 '17 at 2:17
• @Artes I am uncertain of the definition of special function but will take you word for it that ArcTan does not fall in that category. Thanks, – bbgodfrey Aug 15 '17 at 2:21

I believe that

s = ArcTan[Sqrt[-4 E^(I a)]]
N[Limit[s, a -> 0]]
(* 4.71239 + 0.549306 I *)


is a bug in Limit. Plotting the function s

Plot[Evaluate[ReIm[s]], {a, -1, 1}] indicates that s assumes the value above nowhere in the vicinity of a == 0. (The same is true in the complex plane.) Furthermore,

Limit[s, a -> 0]
(* π + I ArcTanh *)


which can be transformed to

TrigToExp[%] // Simplify
(* 1/2 (3 π + I Log) *)


On the other hand,

Limit[TrigToExp[s], a -> 0]
(* 1/2 (π - I Log) *)


The answers should be identical but are not.

This situation is similar to the problem with Limit applied to ArcTan that was identified by J. M. in his first comment to my answer to 116041.

expr = -I (Sqrt[-1 - E^(-2 I ε)] - ArcTan[Sqrt[-1 - E^(-2 I ε)]]) +
I (Sqrt [-1 - E^(2 I ε)] - ArcTan[Sqrt[-1 - E^(2 I ε)]])
Limit[expr, ε -> 0]
(* 2 Sqrt - I Pi *)

Limit[expr // TrigToExp, ϵ-> 0] // FullSimplify
(* 2 (Sqrt - ArcSinh) *)


I recommend that this be reported to Wolfram, Inc as a bug.

Mathematically, the arctangent of the square root of -4 is

n Pi + I ArcTanh


or

n Pi - I ArcTanh


where n is an arbitrary integer. The problem exposed in the question is that Limit[s, a -> 0] is not choosing the same branch symbolically that Plot, N, etc. choose numerically. This should not be.

• Limit[s, a -> 0, Direction -> 1] does choose the same branch as Plot and N. – Karsten 7. May 29 '16 at 15:05
• @Karsten7. Good point! So, Limit gets the right answer half the time. Limit[s, a -> 0, Direction ->- 1], the default, should return π - I ArcTanh instead of π + I ArcTanh for consistency with numerical results. – bbgodfrey May 29 '16 at 15:46