Re: Differentiation problem/bug?
- To: mathgroup at smc.vnet.net
- Subject: [mg69783] Re: Differentiation problem/bug?
- From: Paul Abbott <paul at physics.uwa.edu.au>
- Date: Sat, 23 Sep 2006 04:44:06 -0400 (EDT)
- Organization: The University of Western Australia
- References: <eevrea$gfd$1@smc.vnet.net>
In article <eevrea$gfd$1 at smc.vnet.net>, Arturas Acus <acus at itpa.lt>
wrote:
> the only way I can explain the rezults of simple differentiation command
> D[] bellow is the dissapointing bug, which was absent in 5.0, but exist
> in:
> $Version
> 5.2 for Linux (June 20, 2005)
>
> In[1]: inp = 1/4 + 3/(8*E^((2*I)*F)) + (3*E^((2*I)*F))/8 -
> E^((-2*I)*F - I*\[Theta])/4 + E^((2*I)*F - I*\[Theta])/4 -
> E^((-2*I)*F + I*\[Theta])/4 + E^((2*I)*F + I*\[Theta])/4 +
> E^((-2*I)*F - (2*I)*\[Theta])/16 + E^((2*I)*F - (2*I)*\[Theta])/16+
> E^((-2*I)*F + (2*I)*\[Theta])/16 + E^((2*I)*F + (2*I)*\[Theta])/16-
> 1/(8*E^((2*I)*\[Theta])) - E^((2*I)*\[Theta])/8
>
> In[2]: D[inp, r, NonConstants -> {F}]
> Out[2]: 0
>
> how it was found:
>
> In[3]: D[#, r, NonConstants -> {F}] & /@ Expand[inp]
> Out[3]: (((-3*I)/4)*D[F, r, NonConstants -> {F}])/E^((2*I)*F) +
> ((3*I)/4)*E^((2*I)*F)*D[F, r, NonConstants -> {F}]
>
> check:
>
> In[4]: D[Evaluate[inp /. {F -> F[r]}], r] // FullSimplify
> Out[4]: ((-I/8)*((-1 + E^(I*\[Theta]))^4 - E^((4*I)*F[r])*(1 + E^(I*
> \[Theta]))^4)*Derivative[1][F][r])/E^((2*I)*(\[Theta] + F[r]))
>
>
> I believe I can trust the Out[4] rezult. Most dissapointing is that now
> I cannot trust my previous calculations, because somwhere I changed from
> version 5.0 to 5.2, and 5.0 gives correct rezult. Please check this
> behaviour for other versions/OS and be carefull using NonConstants
> option.
I never use NonConstants. Also, it is a good idea to avoid using
variables involving capital letters. For calculations where there is
implicit dependence with respect to a variable I use Dt instead.
inp = 1/4 + 3/8/E^(2 I f) + (3/8) E^(2 I f) - (1/4) E^(-2 I f - I t) +
(1/4) E^(2 I f - I t) - (1/4) E^(I t - 2 I f) + (1/4) E^(2 I f + I t) +
(1/16) E^(-2 I f - 2 I t) + (1/16) E^(2 I f - 2 I t) +
(1/16) E^(2 I t - 2 I f) + (1/16) E^(2 I f + 2 I t) -
1/8/E^(2 I t) - (1/8) E^(2 I t)
Dt[t, r] ^= 0;
Dt[inp, r] // FullSimplify
Cheers,
Paul
_______________________________________________________________________
Paul Abbott Phone: 61 8 6488 2734
School of Physics, M013 Fax: +61 8 6488 1014
The University of Western Australia (CRICOS Provider No 00126G)
AUSTRALIA http://physics.uwa.edu.au/~paul
- Follow-Ups:
- Re: Re: Differentiation problem/bug?
- From: Arturas Acus <acus@itpa.lt>
- Re: Re: Differentiation problem/bug?