Re: Re: Another damn simplifying problem: ArcTan
- To: mathgroup at smc.vnet.net
- Subject: [mg60003] Re: [mg59982] Re: [mg59910] Another damn simplifying problem: ArcTan
- From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
- Date: Sun, 28 Aug 2005 03:07:38 -0400 (EDT)
- References: <200508251033.GAA10111@smc.vnet.net> <200508270811.EAA15239@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
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
- References:
- Another damn simplifying problem: ArcTan
- From: Mathieu McPhie <m.mcphie@fz-juelich.de>
- Re: Another damn simplifying problem: ArcTan
- From: Andrzej Kozlowski <akoz@mimuw.edu.pl>
- Another damn simplifying problem: ArcTan