when I wrote sphere.mac for ch. 6 in july 2008,
I used max. ver. 5.15.0. A small batch file
depends.mac illustrates a difference in
behavior between 5.15 and 5.22.1 which
results in an error in using the chain rule
on a product function. We batch the same
file on both versions of maxima.
---------------------
first the correct results, using ver. 5.15
-----------------------------------------
(%i85) Maxima 5.15.0 http://maxima.sourceforge.net
Using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (aka GCL)
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
2010-10-12
(%i1) batch("depends.mac")$
batching #pc:/work5/depends.mac
(%i2) display2d : false
(%i3) "spherical polar coordinates (r,theta,phi ) = (r,t,p) "
(%i4) assume(r > 0,sin(t) > 0)
(%i5) " define drdz and dtdz replacements "
(%i6) gradef(r,z,cos(t))
(%i7) gradef(t,z,(-sin(t))/r)
(%i8) " p = phi does not depend on z "
(%i9) depends([r,t],[x,y,z])
(%i10) depends(p,[x,y])
(%i11) " let bp(r,t,p) be a field component"
(%i12) " depending on r,t,and p "
(%i13) depends(bp,[r,t,p])
(%i14) " look at some derivatives w.r.t. z "
(%i15) diff(cos(p),z)
(%o15) 0
(%i16) diff(bp,z)
(%o16) 'diff(bp,r,1)*cos(t)-'diff(bp,t,1)*sin(t)/r
(%i17) diff(cos(p)*bp,z)
(%o17) cos(p)*('diff(bp,r,1)*cos(t)-'diff(bp,t,1)*sin(t)/r)
(%i18) diff(bp*cos(p),z)
(%o18) cos(p)*('diff(bp,r,1)*cos(t)-'diff(bp,t,1)*sin(t)/r)
-----------------------------------------------------
next the **incorrect** results produced using the same
batch file with 5.22 :
-----------------------------------------
(%i19) Maxima 5.22.1 http://maxima.sourceforge.net
using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL)
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
2010-10-12
(%i1) batch("depends.mac")$
read and interpret file: #pC:/work5/depends.mac
(%i2) display2d : false
(%i3) "spherical polar coordinates (r,theta,phi ) = (r,t,p) "
(%i4) assume(r > 0,sin(t) > 0)
(%i5) " define drdz and dtdz replacements "
(%i6) gradef(r,z,cos(t))
(%i7) gradef(t,z,(-sin(t))/r)
(%i8) " p = phi does not depend on z "
(%i9) depends([r,t],[x,y,z])
(%i10) depends(p,[x,y])
(%i11) " let bp(r,t,p) be a field component"
(%i12) " depending on r,t,and p "
(%i13) depends(bp,[r,t,p])
(%i14) " look at some derivatives w.r.t. z "
(%i15) diff(cos(p),z)
(%o15) 0
(%i16) diff(bp,z)
(%o16) 'diff(bp,r,1)*cos(t)-'diff(bp,t,1)*sin(t)/r
(%i17) diff(cos(p)*bp,z)
(%o17) 0
(%i18) diff(bp*cos(p),z)
(%o18) 0
----------------------------
we are now getting zero for the derivative of
a product function.
Any suggestions for a cure?
Ted Woollett
http://www.csulb.edu/~woollett