8
$\begingroup$

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?

$\endgroup$
  • $\begingroup$ 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. $\endgroup$ – xzczd May 29 '16 at 14:20
  • $\begingroup$ @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? $\endgroup$ – J. M. is in limbo May 29 '16 at 14:26
  • $\begingroup$ @J.M. v8.0.4 and v9.0.1 gives I ArcTanh[2] + π 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.) $\endgroup$ – xzczd May 29 '16 at 14:36
  • $\begingroup$ @bbgodfrey ArcTan isn't a special function. $\endgroup$ – Artes Aug 15 '17 at 2:17
  • $\begingroup$ @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, $\endgroup$ – bbgodfrey Aug 15 '17 at 2:21
9
$\begingroup$

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}]

enter image description here

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[2] *)

which can be transformed to

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

On the other hand,

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

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[2] - I Pi *)

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

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

Addendum

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

n Pi + I ArcTanh[2]

or

n Pi - I ArcTanh[2]

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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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