Re: Simplifying expression involving Log and I
- To: mathgroup at smc.vnet.net
- Subject: [mg38033] Re: [mg38010] Simplifying expression involving Log and I
- From: Adam Strzebonski <adams at wolfram.com>
- Date: Tue, 26 Nov 2002 00:50:17 -0500 (EST)
- References: <C559331D-0050-11D7-9F21-00039311C1CC@tuins.ac.jp>
- Sender: owner-wri-mathgroup at wolfram.com
According to the default complexity measure ArcTan[y/x]
is not simpler than ArcTan[x, y].
In[1]:= LeafCount /@ {ArcTan[x, y], ArcTan[y/x]}
Out[1]= {3, 6}
One can use ComplexityFunction to specify that two-argument
ArcTan should be replaced whenever possible.
In[2]:= f=1000 Count[#, ArcTan[_, _], {0, Infinity}]+LeafCount[#]&;
In[3]:= FullSimplify[ArcTan[x, y], {x > 0, y < 0}, ComplexityFunction->f]
y
Out[3]= ArcTan[-]
x
With this ComplexityFunction we get a somewhat better result
for the original problem, though still not the desired form.
In[4]:= FullSimplify[ComplexExpand[
d*Pi + I*d*(Log[M] - 2*Log[(-I)*Sqrt[(M*r)/d] +
Sqrt[M - (M*r)/d]]), TargetFunctions -> {Re, Im}],
M > 0 && 0 < r < d, ComplexityFunction->f]
1
Out[4]= d (Pi - 2 ArcTan[------------])
d
Sqrt[-1 + -]
r
Best Regards,
Adam Strzebonski
Wolfram Research
Andrzej Kozlowski wrote:
> This will take you pretty close:
>
> FullSimplify[ComplexExpand[
> d*Pi + I*d*(Log[M] - 2*Log[(-I)*Sqrt[(M*r)/d] +
> Sqrt[M - (M*r)/d]]), TargetFunctions -> {Re, Im}],
> M > 0 && 0 < r < d]
>
>
> d*(Pi + 2*ArcTan[Sqrt[M - (M*r)/d], -Sqrt[(M*r)/d]])
>
> Still, there appears to be something missing among the rules
> FullSimplify is applying.
> It seems related to the following behaviour, that certianly suggests a bug:
>
> FullSimplify[ArcTan[x, y], {x > 0, y < 0}]
>
>
> ArcTan[x, y]
>
>
> FullSimplify[ArcTan[2*x, 2*y], {x > 0, y < 0}]
>
>
> ArcTan[y/x]
>
> On Monday, November 25, 2002, at 03:58 PM, Dave Snead wrote:
>
>> Hi,
>>
>> I'm trying to simplify (M, r, d are positive reals with r<d)
>> d*Pi + I*d*(Log[M] - 2*Log[(-I)*Sqrt[(M*r)/d] + Sqrt[M - (M*r)/d]])
>>
>> to
>>
>> 2*d*ArcCos[Sqrt[r/d]]
>>
>> I've tried applying
>>
>> FullSimplify[#,M>0 && 0<r<d]&
>>
>> and
>>
>> ExpToTrig
>>
>> but Mathematica won't get rid of the Log and the I and give me the
>> ArcCos.
>>
>> Does anyone know which Mathematica functions to apply to my expression to
>> give me the simplification I want?
>>
>> Thanks in advance.
>>
>>
>>
>>
>>
>>
>>
> Andrzej Kozlowski
> Yokohama, Japan
> http://www.mimuw.edu.pl/~akoz/
> http://platon.c.u-tokyo.ac.jp/andrzej/
>