MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Re: Another damn simplifying problem: ArcTan


On 27 Aug 2005, at 09:11, Andrzej Kozlowski wrote:

> On 25 Aug 2005, at 11:33, Mathieu McPhie wrote:
>
>
>> Can someone please explain this to me: (M v4.something)
>>
>> In:=  Simplify[ArcTan[-x]+ArcTan[x]]
>> Out= 0
>>
>> In:=  Simplify[ArcTan[-x,1]+ArcTan[x,1]]
>> Out= ArcTan[-x,1]+ArcTan[x,1]
>>
>> Note, I want something more complicated than this obviously. Actually
>> want something like
>>
>> Simplify[ArcTan[-x,y]+ArcTan[x,y]]
>>
>> but above is the easiest example of this infuriating programs  
>> problem.
>>
>> Cheers, Mathieu
>>
>>
>>
>
>
> In Mathematica 5.1 the situation does not look much better.
>
>
> First however, note that
>
>
> Simplify[ArcTan[x,-y]+ArcTan[x,y],{x>0}]
>
> 0
>
> Unfortunatley
>
> Simplify[ArcTan[x,-y]+ArcTan[x,y],{x<0}] returns
>
> ArcTan[x,-y]+ArcTan[x,y] instead of 0.
>
> Adding assumptions on y does not help.
>
> Your formula
>
> ArcTan[x,-y]+ArcTan[x,y]
>
> is not surprisingly harder for Mathematica to simplify since we have:
>
>
> ArcTan[-x, y] + ArcTan[x, y] /. {x -> 1, y -> -1}
>
>
> -Pi
>
>
> ArcTan[-x, y] + ArcTan[x, y] /. {x -> 1, y -> 1}
>
> Pi
>
>   etc.
>
>
>
>
>
> Still Mathematica ought to manage these cases with assumptions on x
> and y and it doesn't. In fact, for x>0 one can get the answer isn
> this way:
>
>
> Simplify[ComplexExpand[ArcTan[x, -y] + ArcTan[x, y],TargetFunctions->
> {Re,Im}], {x > 0}]
>
> 0
>
>
>
>
> Andrzej Kozlowski
>
>
>

This last line was of course a mistake, I did not notice that I had  
ArcTan[x,-y]+ + ArcTan[x, y] ( which already works without  
ComplexExpand ) instead of  ArcTan[-x, y] + ArcTan[x, y]. However, we  
actually can get the "correct answer" as follows:

PowerExpand[FullSimplify[TrigToExp[ArcTan[-x, y] +
      ArcTan[x, y]], {x > 0, y > 0}]]


Pi


However, our excitement is somewhat damped by:


PowerExpand[FullSimplify[TrigToExp[ArcTan[-x, y] +
      ArcTan[x, y]], {x > 0, y < 0}]]

Pi

which is only correct "up to sign" (the answer is -Pi). Of course  
using PowerExpand alone "proves" little, but combined with numerical  
verification such as


ArcTan[-x, y] + ArcTan[x, y] /.
   {x -> Rationalize[Random[], 0],
    y -> Rationalize[Random[], 0]}


Pi


ArcTan[-x, y] + ArcTan[x, y] /.
   {x -> Rationalize[Random[], 0],
    y -> -Rationalize[Random[], 0]}


-Pi

it could be reasonably treated as a "probabilistic proof".

Andrzej Kozlowski



  • Prev by Date: Re: Re: ListDensityPlot and transparency
  • Next by Date: Re: help working with functions (follow-up)
  • Previous by thread: Re: Another damn simplifying problem: ArcTan
  • Next by thread: a simple question on label every curve in one graph by (Multiple)ListPlot, thanks