When autoloading a Maxima script, avoid clobbering global state.
[maxima.git] / tests / rtest13.mac
blobe78c113c3d2ec6d190673c83594c89590a53686c
1 /*************** -*- Mode: MACSYMA; Package: MAXIMA -*-  ******************/
2 /***************************************************************************
3 ***                                                                    *****
4 ***     Copyright (c) 1984 by William Schelter,University of Texas     *****
5 ***     All rights reserved                                            *****
6 ***************************************************************************/
8 kill(all);
9 done;
10 x^2*'diff(y,x,1)+3*x*y = sin(x)/x;
11 x^2*'diff(y,x,1)+3*x*y = sin(x)/x$
12 soln1:ode2(%,y,x);
13 y = (%c-cos(x))/x^3$
14 ic1(soln1,x = %pi,y = 0);
15 y = -((cos(x)+1)/x^3)$
16 'diff(y,x,2)+y*('diff(y,x,1))^3 = 0;
17 'diff(y,x,2)+y*('diff(y,x,1))^3 = 0$
18 soln2:ode2(%,y,x);
19 (y^3+6*%k1*y)/6 = x+%k2$
21 bc2(soln2,x = 0,y = 1,x = 1,y = 3);
22 (y^3-10*y)/6 = x-3/2$
23 exp:k^2*n^2+k^2*m^2*n^2-k^2*l^2*n^2-k^2*l^2*m^2*n^2;
24 -k^2*l^2*m^2*n^2+k^2*m^2*n^2-k^2*l^2*n^2+k^2*n^2$
25 eq1:k^2+l^2 = 1;
26 l^2+k^2 = 1$
27 eq2:n^2-m^2 = 1;
28 n^2-m^2 = 1$
29 scsimp(exp,eq1,eq2);
30 k^4*n^4$
31 exq:(k1*k4-k1*k2-k2*k3)/k3^2;
32 (k1*k4-k2*k3-k1*k2)/k3^2$
33 eq3:k1*k4-k2*k3 = 0;
34 k1*k4-k2*k3 = 0$
35 eq4:k1*k2+k3*k4 = 0;
36 k3*k4+k1*k2 = 0$
37 scsimp(exq,eq3,eq4);
38 k4/k3$
39 exp1:2*x^2+y*x+z;
40 z+x*y+2*x^2$
41 exp2:3*x+5*y-z-1;
42 -z+5*y+3*x-1$
43 exp3:z^2+x-y^2+5;
44 z^2-y^2+x+5$
45 eliminate([exp3,exp2,exp1],[y,z]);
46 [7425*x^8-1170*x^7+1299*x^6+12076*x^5+22887*x^4-5154*x^3-1291*x^2+7688*x+15376]$
47 eqn1:'diff(f(x),x) = 'diff(g(x),x)+sin(x);
48 'diff(f(x),x,1) = 'diff(g(x),x,1)+sin(x)$
49 eqn2:'diff(g(x),x,2) = 'diff(f(x),x)-cos(x);
50 'diff(g(x),x,2) = 'diff(f(x),x,1)-cos(x)$
51 atvalue('diff(g(x),x),x = 0,a);
53 atvalue(f(x),x = 0,1);