12
FOR A FROM -3 STEP 7 THRU 26 DO LDISPLAY(A);
12
for a from -3 step 7 thru 26 do ldisplay(a);
16
FOR I WHILE I <= 10 DO S:S+I;
16
for i while i <= 10 do s:s+i;
25
(TERM:DIFF(TERM,X)/P,SERIES:SERIES+SUBST(X = 0,TERM)*X^P);
28
X^7/90-X^6/240-X^5/15-X^4/8+X^2/2+X+1$
25
(term:diff(term,x)/p,series:series+subst(x = 0,term)*x^p);
28
x^7/90-x^6/240-x^5/15-x^4/8+x^2/2+x+1$
31
FOR I THRU 5 DO (FOR J FROM I STEP -1 THRU 1 DO POLY:POLY+I*X^J);
34
5*X^5+9*X^4+12*X^3+14*X^2+15*X$
31
for i thru 5 do (for j from i step -1 thru 1 do poly:poly+i*x^j);
34
5*x^5+9*x^4+12*x^3+14*x^2+15*x$
38
(GUESS:SUBST(GUESS,X,0.5*(X+10/X)),
39
IF ABS(GUESS^2-10) < 5.0E-5 THEN RETURN(GUESS));
38
(guess:subst(guess,x,0.5*(x+10/x)),
39
if abs(guess^2-10) < 5.0e-5 then return(guess));
40
40
-3.162280701754386;
42
FOR COUNT FROM 2 NEXT 3*COUNT THRU 20 DO LDISPLAY(COUNT);
42
for count from 2 next 3*count thru 20 do ldisplay(count);
46
THRU 10 WHILE X # 0 DO X:0.5*(X+5/X);
46
thru 10 while x # 0 do x:0.5*(x+5/x);
52
NEWTON(F,GUESS):=BLOCK([NUMER,Y],LOCAL(F,DF,X,GUESS),NUMER:TRUE,
53
DEFINE(DF(X),DIFF(F(X),X)),
54
DO (Y:DF(GUESS),IF Y = 0 THEN ERROR("derivative at",GUESS,"is zero"),
55
GUESS:GUESS-F(GUESS)/Y,
56
IF ABS(F(GUESS)) < 5.0E-6 THEN RETURN(GUESS)));
57
NEWTON(F,GUESS):=BLOCK([NUMER,Y],LOCAL(F,DF,X,GUESS),NUMER:TRUE,
58
DEFINE(DF(X),DIFF(F(X),X)),
59
DO (Y:DF(GUESS),IF Y = 0 THEN ERROR("derivative at",GUESS,"is zero"),
60
GUESS:GUESS-F(GUESS)/Y,
61
IF ABS(F(GUESS)) < 5.0E-6 THEN RETURN(GUESS)))$
52
newton(f,guess):=block([numer,y],local(f,df,x,guess),numer:true,
53
define(df(x),diff(f(x),x)),
54
do (y:df(guess),if y = 0 then error("derivative at",guess,"is zero"),
55
guess:guess-f(guess)/y,
56
if abs(f(guess)) < 5.0e-6 then return(guess)));
57
newton(f,guess):=block([numer,y],local(f,df,x,guess),numer:true,
58
define(df(x),diff(f(x),x)),
59
do (y:df(guess),if y = 0 then error("derivative at",guess,"is zero"),
60
guess:guess-f(guess)/y,
61
if abs(f(guess)) < 5.0e-6 then return(guess)))$
66
FOR F IN [LOG,RHO,ATAN] DO LDISP(F(1.0));
68
EV(CONCAT(E,LINENUM-1),NUMER);
70
KILL(FUNCTIONS,VALUES,ARRAYS);
75
X*'DIFF(F(X),X,1)+F(X)$
66
for f in [log,rho,atan] do ldisp(f(1.0));
68
ev(concat(e,linenum-1),numer);
70
kill(functions,values,arrays);
75
x*'diff(f(x),x,1)+f(x)$
104
'INTEGRATE(F(X),X,A,B);
105
'INTEGRATE(X^2,X,A,B)$
106
FOR I THRU 5 DO S:S+I^2;
104
'integrate(f(x),x,a,b);
105
'integrate(x^2,x,a,b)$
106
for i thru 5 do s:s+i^2;
114
EXP:'SUM(G(I),I,0,N);
130
DECLARE(INTEGRATE,NOUN);
136
F(Y):=DIFF(Y*LOG(Y),Y,2);
137
F(Y):=DIFF(Y*LOG(Y),Y,2)$
114
exp:'sum(g(i),i,0,n);
130
declare(integrate,noun);
136
f(y):=diff(y*log(y),y,2);
137
f(y):=diff(y*log(y),y,2)$
152
EV(%E^X*SIN(X)^2,EXPONENTIALIZE);
153
-%E^X*(%E^(%I*X)-%E^-(%I*X))^2/4;
155
-(%E^((2*%I+1)*X)/(2*%I+1)+%E^((1-2*%I)*X)/(1-2*%I)-2*%E^X)/4;
157
-(%E^X*(%I*SIN(2*X)+COS(2*X))/(2*%I+1)
158
+%E^X*(COS(2*X)-%I*SIN(2*X))/(1-2*%I)-2*%E^X)
152
ev(%e^x*sin(x)^2,exponentialize);
153
-%e^x*(%e^(%i*x)-%e^-(%i*x))^2/4;
155
-(%e^((2*%i+1)*x)/(2*%i+1)+%e^((1-2*%i)*x)/(1-2*%i)-2*%e^x)/4;
157
-(%e^x*(%i*sin(2*x)+cos(2*x))/(2*%i+1)
158
+%e^x*(cos(2*x)-%i*sin(2*x))/(1-2*%i)-2*%e^x)
161
-%E^X*SIN(2*X)/5-%E^X*COS(2*X)/10+%E^X/2;
162
EV(ANS,X:1,NUMER)-EV(ANS,X:0,NUMER);
161
-%e^x*sin(2*x)/5-%e^x*cos(2*x)/10+%e^x/2;
162
ev(ans,x:1,numer)-ev(ans,x:0,numer);
163
163
0.5779160182042402;
164
block([FPPREC:35],EV(ANS,X:1,BFLOAT)-EV(ANS,X:0,BFLOAT));
165
5.7791601820424019599988308251707781339427227258443B-1;
166
INTEGRATE(%E^X*SIN(X)^2,X);
167
-(2*%E^X*SIN(2*X)+%E^X*COS(2*X)-5*%E^X)/10;
164
block([fpprec:35],ev(ans,x:1,bfloat)-ev(ans,x:0,bfloat));
165
5.7791601820424019599988308251707781339427227258443b-1;
166
integrate(%e^x*sin(x)^2,x);
167
-(2*%e^x*sin(2*x)+%e^x*cos(2*x)-5*%e^x)/10;
169
-(2*%E^X*SIN(2*X)+%E^X*COS(2*X)-5*%E^X)/10;
169
-(2*%e^x*sin(2*x)+%e^x*cos(2*x)-5*%e^x)/10;
177
SIN(%PI/12)+TAN(%PI/6);
178
SIN(%PI/12)+1/SQRT(3)$
177
sin(%pi/12)+tan(%pi/6);
178
sin(%pi/12)+1/sqrt(3)$
180
180
0.8361693142921465;
181
181
/* tops 20 : 0.83616931$ */
189
189
3.679093980405881;
190
190
/* tops 20: 3.67909265$ */
191
DIFF(ATANH(SQRT(X)),X);
191
diff(atanh(sqrt(x)),x);
196
4.794255386042030002732879B-1$
196
4.794255386042030002732879b-1$
198
EXP:COS(X)^2-SIN(X)^2;
198
exp:cos(x)^2-sin(x)^2;
205
(SIN(2*X)/2+X)/2-(X-SIN(2*X)/2)/2$
205
(sin(2*x)/2+x)/2-(x-sin(2*x)/2)/2$
214
214
%-exp,trigreduce,ratsimp;
217
SECH(X)^2*SINH(X)*TANH(X)/COTH(X)^2+COSH(X)^2*SECH(X)^2*TANH(X)/COTH(X)^2
218
+SECH(X)^2*TANH(X)/COTH(X)^2;
219
SECH(X)^2*SINH(X)*TANH(X)/COTH(X)^2+COSH(X)^2*SECH(X)^2*TANH(X)/COTH(X)^2
220
+SECH(X)^2*TANH(X)/COTH(X)^2$
222
(SINH(X)^5+SINH(X)^4+2*SINH(X)^3)/COSH(X)^5$
217
sech(x)^2*sinh(x)*tanh(x)/coth(x)^2+cosh(x)^2*sech(x)^2*tanh(x)/coth(x)^2
218
+sech(x)^2*tanh(x)/coth(x)^2;
219
sech(x)^2*sinh(x)*tanh(x)/coth(x)^2+cosh(x)^2*sech(x)^2*tanh(x)/coth(x)^2
220
+sech(x)^2*tanh(x)/coth(x)^2$
222
(sinh(x)^5+sinh(x)^4+2*sinh(x)^3)/cosh(x)^5$
223
/* These are from the trgsmp.dem file.
224
* I (rtoy) hand-verified these results (using maxima, of course)
226
(1-sin(x)^2)*cos(x)/cos(x)^2+tan(x)*sec(x)^2;
227
(1-sin(x)^2)*cos(x)/cos(x)^2+tan(x)*sec(x)^2$
229
(sin(x)+cos(x)^4)/cos(x)^3$
231
tan(x)^2+sec(x)^2/(1-tan(x)*sec(x));
232
tan(x)^2+sec(x)^2/(1-tan(x)*sec(x))$
234
(sin(x)^4+sin(x)^3-1)/(cos(x)^2*sin(x)-cos(x)^4)$
236
(sin(x)^4-6*cos(x)^2*sin(x)^2+4*(cos(x)^2-sin(x)^2)+8*sin(x)+cos(x)^4+3)/(8*cos(x)^3);
237
(sin(x)^4-6*cos(x)^2*sin(x)^2+4*(cos(x)^2-sin(x)^2)+8*sin(x)+cos(x)^4+3)/(8*cos(x)^3)$
239
(sin(x)+cos(x)^4)/cos(x)^3$
242
sech(x)^2*sinh(x)*tanh(x)/coth(x)^2+cosh(x)^2*sech(x)^2*tanh(x)/coth(x)^2+sech(x)^2*tanh(x)/coth(x)^2;
243
sech(x)^2*sinh(x)*tanh(x)/coth(x)^2+cosh(x)^2*sech(x)^2*tanh(x)/coth(x)^2+sech(x)^2*tanh(x)/coth(x)^2$
245
(sinh(x)^5+sinh(x)^4+2*sinh(x)^3)/cosh(x)^5$
247
-sech(x)^5*(sinh(x)^5+2*(sinh(x)^4+6*cosh(x)^2*sinh(x)^2+cosh(x)^4)-13*(sinh(x)^3+3*cosh(x)^2*sinh(x))+10*cosh(x)^2*sinh(x)^3-8*(sinh(x)^2+cosh(x)^2)+5*cosh(x)^4*sinh(x)+34*sinh(x)+6)/16;
248
-sech(x)^5*(sinh(x)^5+2*(sinh(x)^4+6*cosh(x)^2*sinh(x)^2+cosh(x)^4)-13*(sinh(x)^3+3*cosh(x)^2*sinh(x))+10*cosh(x)^2*sinh(x)^3-8*(sinh(x)^2+cosh(x)^2)+5*cosh(x)^4*sinh(x)+34*sinh(x)+6)/16$
250
-(sinh(x)^5+sinh(x)^4-2*sinh(x)^3)/cosh(x)^5$
252
cos(x)*(sec(x)^2*tan(x)+1)-sec(x)^2*sin(x)-cos(x);
253
cos(x)*(sec(x)^2*tan(x)+1)-sec(x)^2*sin(x)-cos(x)$
257
v*cos(x)*sec(x)^2*tan(x)+(-v*sec(x)^2-2*'diff(v,x))*sin(x)+'diff(v,x)*cos(x)*sec(x)+'diff(v,x,2)*cos(x);
258
v*cos(x)*sec(x)^2*tan(x)+(-v*sec(x)^2-2*'diff(v,x))*sin(x)+'diff(v,x)*cos(x)*sec(x)+'diff(v,x,2)*cos(x)$
260
-2*'diff(v,x,1)*sin(x)+'diff(v,x,2)*cos(x)+'diff(v,x,1)$