Home > Archive > Mathematica > February 2007 > simple question
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| dimitris 2007-02-24, 4:25 am |
| Hello.
This post has a connection with a recent post of David Cantrell.
(I hope I don't miss anything!)
Consider the functions
In[37]:=
I1 = Pi/2 - ArcTan[u];
I2 = ArcTan[1/u];
For u>=0 the functions are equal as the following demonstrates
In[39]:=
Show[Block[{$DisplayFunction = Identity}, (Plot[{I1, I2}, {u, #1[[1]],
#1[[2]]}, PlotPoints -> 100, Axes -> False,
Frame -> {True, True, False, False}, PlotStyle -> {Red, Blue},
FrameTicks -> {Range[-2*Pi, 2*Pi, Pi], Range[-2, 4, 1]}] & ) /@
Partition[Range[-2*Pi, 2*Pi, Pi], 2, 1]]]
In[43]:=
I1 /. u -> 0
(Limit[I2, u -> 0, Direction -> #1] & ) /@ {1, -1}
Out[43]=
Pi/2
Out[44]=
{-(Pi/2), Pi/2}
However
None of these work
In[81]:=
FullSimplify[I1 - I2, u > 0]
FullSimplify[I1 == I2, u > 0]
FullSimplify[I1 - I2 == 0, u > 0]
Out[81]=
(1/2)*(Pi - 2*ArcCot[u] - 2*ArcTan[u])
Out[82]=
2*(ArcCot[u] + ArcTan[u]) == Pi
Out[83]=
2*(ArcCot[u] + ArcTan[u]) == Pi
Even for specific u we don't have "simplification" to zero
In[111]:=
FullSimplify[I1 - I2 /. u -> Pi]
N[%]
Out[111]=
(1/2)*(Pi - 2*(ArcCot[Pi] + ArcTan[Pi]))
Out[112]=
-2.220446049250313*^-16
Any ideas how to show that I1-I2=0 (or I1=I2) symbolically?
I personally tried (based on relevant material on the Help Browser, M.
Trott's Guidebook for Symbolics and Dana DeLouis' solution to David's
original post)
In[40]:=
equ = TrigToExp[I1 - I2 /. u -> Pi/2]
avoid = Count[#1, _ArcTan | _ArcCot | _ArcSin | _ArcCos | _ArcCsc |
_ArcSec | _Log, Infinity] & ;
FullSimplify[equ, ComplexityFunction -> avoid]
Out[40]=
Pi/2 - (1/2)*I*Log[1 - (2*I)/Pi] + (1/2)*I*Log[1 + (2*I)/Pi] -
(1/2)*I*Log[1 - (I*Pi)/2] + (1/2)*I*Log[1 + (I*Pi)/2]
Out[42]=
0
In[43]:=
equ = TrigToExp[I1 - I2 /. u -> Pi/3]
avoid = Count[#1, _ArcTan | _ArcCot | _ArcSin | _ArcCos | _ArcCsc |
_ArcSec | _Log, Infinity] & ;
FullSimplify[equ, ComplexityFunction -> avoid]
Out[43]=
Pi/2 - (1/2)*I*Log[1 - (3*I)/Pi] + (1/2)*I*Log[1 + (3*I)/Pi] -
(1/2)*I*Log[1 - (I*Pi)/3] + (1/2)*I*Log[1 + (I*Pi)/3]
Out[45]=
0
However this approach is not general; for example
In[84]:=
equ = TrigToExp[I1 - I2 /. u -> Pi/4]
avoid = Count[#1, _ArcTan | _ArcCot | _ArcSin | _ArcCos | _ArcCsc |
_ArcSec | _Log, Infinity] & ;
FullSimplify[equ, ComplexityFunction -> avoid]
Out[84]=
Pi/2 - (1/2)*I*Log[1 - (4*I)/Pi] + (1/2)*I*Log[1 + (4*I)/Pi] -
(1/2)*I*Log[1 - (I*Pi)/4] + (1/2)*I*Log[1 + (I*Pi)/4]
Out[86]=
(-(1/2))*I*(I*Pi + 2*Pi*Floor[(Pi - Arg[(-((-4*I - Pi)/(4*I - Pi)))^(-
I)] - Arg[((-4*I + Pi)/(4*I + Pi))^(-I)])/(2*Pi)] +
I*Log[1/((-((-4*I - Pi)/(4*I - Pi)))^I*((-4*I + Pi)/(4*I +
Pi))^I)])
Also it fails for u unspecified in advance
In[93]:=
equ = TrigToExp[I1 - I2];
avoid = Count[#1, _ArcTan | _ArcCot | _ArcSin | _ArcCos | _ArcCsc |
_ArcSec | _Log, Infinity] & ;
FullSimplify[equ, ComplexityFunction -> avoid]
FullSimplify[%, u > 0]
Out[95]=
(1/2)*(Pi - I*Log[1 - I*u] + I*Log[1 + I*u] - I*Log[(-I + u)/u] +
I*Log[(I + u)/u])
Out[96]=
(-(1/2))*I*(Log[I - u] + Log[1 - I*u] - Log[1 + I*u] - Log[I + u])
Thanks in advance for your response!
Dimitris
| |
| Andrzej Kozlowski 2007-02-25, 4:16 am |
| Sorry, I posted not what I had intended. Let me do it all again. We
define:
I1 = Pi/2 - ArcTan[u];
I2 = ArcTan[1/u];
and want to show that I1==I2 for u>0. We check that the derivative of
the difference is 0:
In[42]:=
FullSimplify[D[I1-I2,u],u>0]
Out[42]=
0
and not, to prove that I1==I2 for u>0 we simply need to evaluate the
difference I1-I2 for just one suitable chosen u>0, e.g.
FullSimplify[(I1-I2)/.u->1]
0
(Last time I pasted and copied the wrong line here.)
Andrzej Kozlowski
On 24 Feb 2007, at 10:54, Andrzej Kozlowski wrote:
> *This message was transferred with a trial version of CommuniGate
> (tm) Pro*
> Note that you can prove equality here as follows:
>
>
> I1 = Pi/2 - ArcTan[u];
> I2 = ArcTan[1/u];
>
>
> FullSimplify[D[I1-I2,u],u>0]
>
> 0
>
> And now all you need is one value of u>0 for which I1 and I2 are
> easy to evaluate:
>
> FullSimplify[D[I1 - I2, u], u > 0]
> 0
>
>
> This method works in surprisingly many cases.
>
> Andrzej Kozlowski
>
>
>
> On 24 Feb 2007, at 08:12, dimitris wrote:
>
>
| |
| dimitris 2007-02-25, 4:16 am |
| Quite elementary but very tricky at the same time!
Thanks a lot Andrzej!
Andrzej Kozlowski <akoz@mimuw.edu.pl> wrote:
Sorry, I posted not what I had intended. Let me do it all again. We
define:
I1 = Pi/2 - ArcTan[u];
I2 = ArcTan[1/u];
and want to show that I1==I2 for u>0. We check that the derivative of
the difference is 0:
In[42]:=
FullSimplify[D[I1-I2,u],u>0]
Out[42]=
0
and not, to prove that I1==I2 for u>0 we simply need to evaluate the
difference I1-I2 for just one suitable chosen u>0, e.g.
FullSimplify[(I1-I2)/.u->1]
0
(Last time I pasted and copied the wrong line here.)
Andrzej Kozlowski
On 24 Feb 2007, at 10:54, Andrzej Kozlowski wrote:
> *This message was transferred with a trial version of CommuniGate
> (tm) Pro*
> Note that you can prove equality here as follows:
>
>
> I1 = Pi/2 - ArcTan[u];
> I2 = ArcTan[1/u];
>
>
> FullSimplify[D[I1-I2,u],u>0]
>
> 0
>
> And now all you need is one value of u>0 for which I1 and I2 are
> easy to evaluate:
>
> FullSimplify[D[I1 - I2, u], u > 0]
> 0
>
>
> This method works in surprisingly many cases.
>
> Andrzej Kozlowski
>
>
>
> On 24 Feb 2007, at 08:12, dimitris wrote:
>
>
| |
| Andrzej Kozlowski 2007-02-25, 4:16 am |
| Note that you can prove equality here as follows:
I1 = Pi/2 - ArcTan[u];
I2 = ArcTan[1/u];
FullSimplify[D[I1-I2,u],u>0]
0
And now all you need is one value of u>0 for which I1 and I2 are easy
to evaluate:
FullSimplify[D[I1 - I2, u], u > 0]
0
This method works in surprisingly many cases.
Andrzej Kozlowski
On 24 Feb 2007, at 08:12, dimitris wrote:
> Hello.
>
> This post has a connection with a recent post of David Cantrell.
>
> (I hope I don't miss anything!)
>
> Consider the functions
>
> In[37]:=
> I1 = Pi/2 - ArcTan[u];
> I2 = ArcTan[1/u];
>
> For u>=0 the functions are equal as the following demonstrates
>
> In[39]:=
> Show[Block[{$DisplayFunction = Identity}, (Plot[{I1, I2}, {u, #1[[1]],
> #1[[2]]}, PlotPoints -> 100, Axes -> False,
> Frame -> {True, True, False, False}, PlotStyle -> {Red, Blue},
> FrameTicks -> {Range[-2*Pi, 2*Pi, Pi], Range[-2, 4, 1]}] & ) /@
> Partition[Range[-2*Pi, 2*Pi, Pi], 2, 1]]]
>
> In[43]:=
> I1 /. u -> 0
> (Limit[I2, u -> 0, Direction -> #1] & ) /@ {1, -1}
>
> Out[43]=
> Pi/2
> Out[44]=
> {-(Pi/2), Pi/2}
>
> However
>
> None of these work
>
> In[81]:=
> FullSimplify[I1 - I2, u > 0]
> FullSimplify[I1 == I2, u > 0]
> FullSimplify[I1 - I2 == 0, u > 0]
>
> Out[81]=
> (1/2)*(Pi - 2*ArcCot[u] - 2*ArcTan[u])
> Out[82]=
> 2*(ArcCot[u] + ArcTan[u]) == Pi
> Out[83]=
> 2*(ArcCot[u] + ArcTan[u]) == Pi
>
> Even for specific u we don't have "simplification" to zero
>
> In[111]:=
> FullSimplify[I1 - I2 /. u -> Pi]
> N[%]
>
> Out[111]=
> (1/2)*(Pi - 2*(ArcCot[Pi] + ArcTan[Pi]))
> Out[112]=
> -2.220446049250313*^-16
>
> Any ideas how to show that I1-I2=0 (or I1=I2) symbolically?
>
> I personally tried (based on relevant material on the Help Browser, M.
> Trott's Guidebook for Symbolics and Dana DeLouis' solution to David's
> original post)
>
> In[40]:=
> equ = TrigToExp[I1 - I2 /. u -> Pi/2]
> avoid = Count[#1, _ArcTan | _ArcCot | _ArcSin | _ArcCos | _ArcCsc |
> _ArcSec | _Log, Infinity] & ;
> FullSimplify[equ, ComplexityFunction -> avoid]
>
> Out[40]=
> Pi/2 - (1/2)*I*Log[1 - (2*I)/Pi] + (1/2)*I*Log[1 + (2*I)/Pi] -
> (1/2)*I*Log[1 - (I*Pi)/2] + (1/2)*I*Log[1 + (I*Pi)/2]
> Out[42]=
> 0
>
> In[43]:=
> equ = TrigToExp[I1 - I2 /. u -> Pi/3]
> avoid = Count[#1, _ArcTan | _ArcCot | _ArcSin | _ArcCos | _ArcCsc |
> _ArcSec | _Log, Infinity] & ;
> FullSimplify[equ, ComplexityFunction -> avoid]
>
> Out[43]=
> Pi/2 - (1/2)*I*Log[1 - (3*I)/Pi] + (1/2)*I*Log[1 + (3*I)/Pi] -
> (1/2)*I*Log[1 - (I*Pi)/3] + (1/2)*I*Log[1 + (I*Pi)/3]
> Out[45]=
> 0
>
> However this approach is not general; for example
>
> In[84]:=
> equ = TrigToExp[I1 - I2 /. u -> Pi/4]
> avoid = Count[#1, _ArcTan | _ArcCot | _ArcSin | _ArcCos | _ArcCsc |
> _ArcSec | _Log, Infinity] & ;
> FullSimplify[equ, ComplexityFunction -> avoid]
>
> Out[84]=
> Pi/2 - (1/2)*I*Log[1 - (4*I)/Pi] + (1/2)*I*Log[1 + (4*I)/Pi] -
> (1/2)*I*Log[1 - (I*Pi)/4] + (1/2)*I*Log[1 + (I*Pi)/4]
> Out[86]=
> (-(1/2))*I*(I*Pi + 2*Pi*Floor[(Pi - Arg[(-((-4*I - Pi)/(4*I - Pi)))^(-
> I)] - Arg[((-4*I + Pi)/(4*I + Pi))^(-I)])/(2*Pi)] +
> I*Log[1/((-((-4*I - Pi)/(4*I - Pi)))^I*((-4*I + Pi)/(4*I +
> Pi))^I)])
>
> Also it fails for u unspecified in advance
>
> In[93]:=
> equ = TrigToExp[I1 - I2];
> avoid = Count[#1, _ArcTan | _ArcCot | _ArcSin | _ArcCos | _ArcCsc |
> _ArcSec | _Log, Infinity] & ;
> FullSimplify[equ, ComplexityFunction -> avoid]
> FullSimplify[%, u > 0]
>
> Out[95]=
> (1/2)*(Pi - I*Log[1 - I*u] + I*Log[1 + I*u] - I*Log[(-I + u)/u] +
> I*Log[(I + u)/u])
> Out[96]=
> (-(1/2))*I*(Log[I - u] + Log[1 - I*u] - Log[1 + I*u] - Log[I + u])
>
> Thanks in advance for your response!
>
> Dimitris
>
>
| |
| Andrzej Kozlowski 2007-02-26, 8:16 am |
|
On 25 Feb 2007, at 16:11, David W. Cantrell wrote:
> [Message also posted to: comp.soft-sys.math.mathematica]
>
> Andrzej Kozlowski <akoz@mimuw.edu.pl> wrote:
>
> But one must be careful with that technique! Note that _everything_
> above
> still seems to work perfectly if the restriction u>0 is simply omitted
> throughout, thereby seeming to show that Pi/2 - ArcTan[u] == ArcTan
> [1/u]
> for _all_ u, which is, of course, false.
>
> David
Yes, indeed. A combination of Mathematica and mathematics can be
very powerful. Alone each has its limitations, but using Mathematica
without paying attention to mathematics can be dangerous.
Andrzej Kozlowski
| |
| David W.Cantrell 2007-02-26, 8:16 am |
| Andrzej Kozlowski <akoz@mimuw.edu.pl> wrote:
> Sorry, I posted not what I had intended. Let me do it all again. We
> define:
>
> I1 = Pi/2 - ArcTan[u];
> I2 = ArcTan[1/u];
>
> and want to show that I1==I2 for u>0. We check that the derivative of
> the difference is 0:
>
> In[42]:=
> FullSimplify[D[I1-I2,u],u>0]
>
> Out[42]=
> 0
>
> and not, to prove that I1==I2 for u>0 we simply need to evaluate the
> difference I1-I2 for just one suitable chosen u>0, e.g.
>
> FullSimplify[(I1-I2)/.u->1]
>
> 0
But one must be careful with that technique! Note that _everything_ above
still seems to work perfectly if the restriction u>0 is simply omitted
throughout, thereby seeming to show that Pi/2 - ArcTan[u] == ArcTan[1/u]
for _all_ u, which is, of course, false.
David
|
|
|
|
|