Is this a standard convention in Maxima?
- Subject: Is this a standard convention in Maxima?
- From: C Y
- Date: Mon, 27 Jun 2005 16:07:16 -0700 (PDT)
Is it standard for Maxima to redefine the form of things internally
when a "'" is used to not evaluate? Here's what I got caught on - it
would be nice to know about this convention if it is indeed general:
Maxima 5.9.1.1cvs http://maxima.sourceforge.net
Using Lisp CMU Common Lisp 19a
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
This is a development version of Maxima. The function bug_report()
provides bug reporting information.
(%i1) x^2+y^2*z*x*y+2*a*x^2;
3 2 2
(%o1) x y z + 2 a x + x
(%i2) to_lisp();
Type (to-maxima) to restart, ($quit) to quit Maxima.
MAXIMA> $%i1
((MPLUS) ((MEXPT) $X 2) ((MTIMES) ((MEXPT) $Y 2) $Z $X $Y)
((MTIMES) 2 $A ((MEXPT) $X 2)))
MAXIMA> $%o1
((MPLUS SIMP) ((MEXPT SIMP) $X 2)
((MTIMES SIMP) 2 $A ((MEXPT SIMP) $X 2))
((MTIMES SIMP) $X ((MEXPT SIMP) $Y 3) $Z))
MAXIMA> (meval $%i1)
((MPLUS SIMP) ((MEXPT SIMP) $X 2)
((MTIMES SIMP) 2 $A ((MEXPT SIMP) $X 2))
((MTIMES SIMP) $X ((MEXPT SIMP) $Y 3) $Z))
MAXIMA> (to-maxima)
Returning to Maxima
(%o2) true
(%i3) integrate(1/(1+x^4),x);
2 x +
sqrt(2)
2 2
atan(-------------)
log(x + sqrt(2) x + 1) log(x - sqrt(2) x + 1)
sqrt(2)
(%o3) ----------------------- - ----------------------- +
-------------------
4 sqrt(2) 4 sqrt(2) 2
sqrt(2)
2 x -
sqrt(2)
atan(-------------)
sqrt(2)
+
-------------------
2
sqrt(2)
(%i4) to_lisp();
Type (to-maxima) to restart, ($quit) to quit Maxima.
MAXIMA> $%i3
(($INTEGRATE) ((MQUOTIENT) 1 ((MPLUS) 1 ((MEXPT) $X 4))) $X)
MAXIMA> (to-maxima)
Returning to Maxima
(%o4) true
(%i5) ?print('integrate(1/(1+x^4),x));
((%INTEGRATE SIMP) ((MEXPT SIMP) ((MPLUS SIMP) 1 ((MEXPT SIMP) $X 4))
-1) $X) /
[ 1
(%o5) I ------ dx
] 4
/ x + 1
(%i6) to_lisp();
Type (to-maxima) to restart, ($quit) to quit Maxima.
MAXIMA> $%i3
(($INTEGRATE) ((MQUOTIENT) 1 ((MPLUS) 1 ((MEXPT) $X 4))) $X)
MAXIMA> $%i5
((PRINT) ((%INTEGRATE) ((MQUOTIENT) 1 ((MPLUS) 1 ((MEXPT) $X 4))) $X))
MAXIMA> (meval $%i3)
((MPLUS SIMP)
((MTIMES SIMP) ((RAT SIMP) 1 2) ((MEXPT SIMP) 2 ((RAT SIMP) -1
2))
((%ATAN SIMP)
((MTIMES SIMP) ((MEXPT SIMP) 2 ((RAT SIMP) -1 2))
((MPLUS SIMP)
((MTIMES SIMP RATSIMP) -1 ((MEXPT SIMP) 2 ((RAT SIMP) 1
2)))
((MTIMES SIMP RATSIMP) 2 $X)))))
((MTIMES SIMP) ((RAT SIMP) 1 2) ((MEXPT SIMP) 2 ((RAT SIMP) -1
2))
((%ATAN SIMP)
((MTIMES SIMP) ((MEXPT SIMP) 2 ((RAT SIMP) -1 2))
((MPLUS SIMP) ((MEXPT SIMP) 2 ((RAT SIMP) 1 2))
((MTIMES SIMP RATSIMP) 2 $X)))))
((MTIMES SIMP) ((RAT SIMP) -1 4) ((MEXPT SIMP) 2 ((RAT SIMP)
-1 2))
((%LOG SIMP)
((MPLUS SIMP) 1
((MTIMES SIMP RATSIMP) -1 ((MEXPT SIMP) 2 ((RAT SIMP) 1 2))
$X)
((MEXPT SIMP RATSIMP) $X 2))))
((MTIMES SIMP) ((RAT SIMP) 1 4) ((MEXPT SIMP) 2 ((RAT SIMP) -1
2))
((%LOG SIMP)
((MPLUS SIMP) 1
((MTIMES SIMP RATSIMP) ((MEXPT SIMP) 2 ((RAT SIMP) 1 2))
$X)
((MEXPT SIMP RATSIMP) $X 2)))))
MAXIMA> (setq $a1 (meval $%i5))
Warning: Declaring $A1 special.
((%INTEGRATE SIMP) ((MEXPT SIMP) ((MPLUS SIMP) 1 ((MEXPT SIMP) $X 4))
-1) $X) ((%INTEGRATE SIMP) ((MEXPT SIMP) ((MPLUS SIMP) 1 ((MEXPT SIMP)
$X 4)) -1) $X)
MAXIMA> (meval $a1)
((%INTEGRATE SIMP)
((MEXPT SIMP) ((MPLUS SIMP) 1 ((MEXPT SIMP) $X 4)) -1) $X)
____________________________________________________
Yahoo! Sports
Rekindle the Rivalries. Sign up for Fantasy Football
http://football.fantasysports.yahoo.com