Message Boards Message Boards

Is this equal to ArcTan?

GROUPS:

Mathematica equates these

In[26]:= I*2*ArcTan[ratio] // TrigToExp

Out[26]= -Log[1 - I ratio] + Log[1 + I ratio]

and according to the docs, Mathematica defines ArcTan (the one-argument version) accordingly in terms of

Log[1 + I ratio] - Log[1 - I ratio]

I'm trying to figure out when exactly I can substitute the term on the right for the term on the left:

In[25]:= Reduce[
 Log[1 + I ratio] - Log[1 - I ratio] == 
  Log[(1 + I*ratio)/(1 - I*ratio)], ratio]

During evaluation of In[25]:= Reduce::nsmet: This system cannot be solved with the methods available to Reduce.

Out[25]= Reduce[-Log[1 - I ratio] + Log[1 + I ratio] == 
  Log[(1 + I ratio)/(1 - I ratio)], ratio]

I'm coming to think the substitution is valid for all complex values for 'ratio', but I can't get Mathematica to confirm it. Is it always valid? Is there a way to get confirmation from Mathematica?

POSTED BY: Joe Donaldson
Answer
26 days ago

They match except along the branch cut ratio == I * y for y < -1.

The following shows they differ by a constant (on path-connected sets in the domains of each function where the function is differentiable; so except along the branch cuts where they are discontinuous, of course):

FullSimplify[
 D[Log[1 + I ratio] - Log[1 - I ratio] == Log[(1 + I*ratio)/(1 - I*ratio)], ratio]
 ]

(*  True  *)
POSTED BY: Michael Rogers
Answer
26 days ago

Thanks much.

Since the expressions are equivalent for real values of 'ratio', is there some reason Wolfram chose one alternative over the other when selecting a definition for their ArcTan function? In other words, when ArcTan receives an argument along that branch cut you specified, e.g.,

In[32]:= {Log[1 + I ratio] - Log[1 - I ratio], 
  Log[(1 + I*ratio)/(1 - I*ratio)]} /. ratio -> (-2*I)

Out[32]= {-I \[Pi] + Log[3], I \[Pi] + Log[3]}

is there some advantage or significance to the particular answer returned by Mathematica; or was it that the difference is considered unimportant?

POSTED BY: Joe Donaldson
Answer
26 days ago

One expression is equal to 2*I*ArcTan[ratio] and the other is not (due to behavior on the branch cut). TrigToExp returns the one that is equal.

POSTED BY: Daniel Lichtblau
Answer
25 days ago

You're welcome. Here's my take on ArcTan/Log, but I don't know to what extent it represents the intentions or philosophy of Wolfram.

The poles, of course, have to be at ±I. While one might pick other lines for the branch cuts, the segments along the imaginary axis from each pole to infinity are symmetric and thus seem somewhat natural. For the values along the branch cuts, one may pick the values on any branch above the branch cut. I don't know to what degree the convention adopted by Mathematica is universal, but at the least, one should pick values that are continuous the principal branch, which usually leads to one of two choices. The choice for ArcTan[z] may be seen to be the value approached when winding about the pole in a counterclockwise direction. (If that's the rule that is always used for the base transcendental functions, then there would be a predictable regularity to the values, which would be desirable in a programming language.)

The counterclockwise rule also applies to Log[z] for z a negative real number: Log[-E] == 1 + I * Pi. However, when Log is transformed, the counterclockwise rule can get reversed: -Log[-E] == -1 - I * Pi, which is the value -Log[z] approaches when the negative real axis is approached clockwise (with respect to the pole at the origin), that is, from above the negative real axis. The orientation is also reversed for Log[-z], which has the branch cut on the positive real axis: For z = E, we have Log[-E] == 1 + I * Pi, but this is the value you get approaching the positive real axis in the clockwise direction.

So the base functions ArcTan[z] and Log[z] have a certain consistency to them, but your expressions

{Log[1 + I ratio] - Log[1 - I ratio], Log[(1 + I*ratio)/(1 - I*ratio)]}

transform Log in different ways, resulting in the orientation of the pole at ratio = -I in the second expression being reversed. Note that the term - Log[1 - I ratio] in the first expression reverses the orientation twice (once for each minus sign), so the first expression has the same counterclockwise rules at the branch cuts as I*2*ArcTan[ratio] (the factors I*2 are a rotation and scaling, which do not reverse orientation).

Sometimes one wants, or at least hopes, to avoid the branch cuts in a particular problem. In those cases it does not matter what value is taken on branch cuts. Sometimes, it does not matter even if the branch cuts are not avoided. For instance if the value t = ArcTan[z] is always used inside a trig. function, such as Sin[t], Cos[t], etc., then different values along the brach cuts won't matter. On the other hand, sometimes it does matter. It can be a pain if the argument is supposed to land approximately on the branch cut, but rounding error leads the argument to land unpredictably on one side or the other.

POSTED BY: Michael Rogers
Answer
25 days ago

Thanks both of you.

POSTED BY: Joe Donaldson
Answer
25 days ago

Group Abstract Group Abstract