aboutsummaryrefslogtreecommitdiff
path: root/src/input/huang.input.pamphlet
blob: ddaf6a7826ead2f7ccf63d614c3a3436d76970b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
\documentclass{article}
\usepackage{axiom}
\begin{document}
\title{\$SPAD/src/input huang.input}
\author{The Axiom Team}
\maketitle
\begin{abstract}
\end{abstract}
\eject
\tableofcontents
\eject
\section{License}
<<license>>=
--Copyright The Numerical Algorithms Group Limited 1996.
@
<<*>>=
<<license>>

-- this is here strictly for documentation purposes, nothing is executed
--
--	Here are some problems that Maple and Mathematica cannot
--solve, but SymbMath can do.
--	The following examples came from news on the sci.math.symbolic
--newsgroup in 1991, and were run in Maple V, Mathematica 2.0, or
--SymbMath 2.1.
--
--************************ Example 1 ******************************
--	Maple:
--> int(exp(-a * x^2), x=0..infinity);
--
--                             infinity
--                                /
--                               |               2
--                               |      exp(- a x ) dx
--                               |
--                              /
--                              0
--
--# unevaluated.
--# Declare 'a' non-negative:
--
--> signum(a) := 1;
--
--                                 signum(a) := 1
--
--# The same integral is now evaluated fully:
--
--> int(exp(-a * x^2), x=0..infinity);
--
--                                         1/2
--                                       Pi
--                                   1/2 -----
--                                         1/2
--                                        a
--
--	SymbMath :
--	Input:
--inte(exp(-a*x^2), x from 0 to inf)
--assume(sqrt(a) > 0)
--inte(exp(-a*x^2), x from 0 to inf)
--	Output:
--1/2*a^(-0.5)*sqrt(pi)*erf(inf*sgn(sqrt(a)))
--assumed
--1/2*a^(-0.5)*sqrt(pi)
--
--************************** Example 2 *********************************
--	Maple:
--# Despite the fact that 'n' is declared non-negative...
--> signum(n) := 1;
--                                 signum(n) := 1
--
--# ...this simple proper definite integral (that any freshman calculus
--# student can evaluate!) is left unevaluated:
--> int(x^n, x=0..1);
--
--                                     1
--                                     /
--                                    |   n
--                                    |  x  dx
--                                    |
--                                   /
--                                   0
--
--
--	SymbMath :
--	Input:
--assume(n > -1)
--inte(x^n, x from 0 to 1)
--	Output:
--assumed
--1/(1 + n)
--
--************************** Example 3 *****************************
--	Maple:
--> int(x^n, x=eps..1);
--
--                                          (n + 1)
--                                 1     eps
--                               ----- - ----------
--                               n + 1      n + 1
--
--# ...but the one-sided limit...
--
--> limit(", eps=0, right);
--
--                                               (n + 1)
--                                      1     eps
--                          limit     ----- - ----------
--                          eps -> 0+ n + 1      n + 1
--
--# ...remains unevaluated...
--
--> simplify(");
--
--                                               (n + 1)
--                                      - 1 + eps
--                          limit     - ----------------
--                          eps -> 0+         n + 1
--
--
--# ...no matter what we do!
--
--> eval(");
--
--                                               (n + 1)
--                                      - 1 + eps
--                          limit     - ----------------
--                          eps -> 0+         n + 1
--
--	SymbMath:
--	Input:
--assume(n > -1)
--inte(x^n, x from eps to 1)
--subs(eps=0 to last)
--	Output:
--assumed
--1/(1 + n) - eps^(1 + n)/(1 + n)
--1/(1 + n)
--
--
--*************************** Example 4 ***************************
--	Maple:
--> 0^n;
--            0
--
--# Maple flags the error only when 'n' is replaced by the constant 0:
--
--> 0^0;
--Error, 0^0 is undefined
--
--	SymbMath:
--	Input:
--assume(n > 0)
--0^n
--0^-n
--0^0
--	Output:
--assumed
--0
--discont
--undefined
--
--**************************** Example 5 ******************************
--	Maple:
--> int(x^k, x);
--
--                                     (k + 1)
--                                    x
--                                    --------
--                                      k + 1
--
--	SymbMath:
--	Input:
--inte(x^k*d(x))
--subs(k=-1 to last)
--	Output:
--constant + x^(1 + k)/(1 + k)
--discont
--
--**************************** Example 6 *****************************
--	Maple:
--# The following limit is left unevaluated:
--> limit(x^k/exp(x), x=infinity);
--
--                                               k
--                                              x
--                              limit         ------
--                              x -> infinity exp(x)
--
--
--# We might ask if Maple knows this result for specific (constant) values
--# of the symbolic parameter 'k'.  The answer is a QUALIFIED "yes".
--# Maple knows the result for 'k' equal to 10^8...
--
--> limit(x^(10^8)/exp(x), x=infinity);
--
--                                       0
--
--
--# ...and Maple knows the result for 'k' equal to 10^9...
--
--> limit(x^(10^9)/exp(x), x=infinity);
--
--                                       0
--
--# ...BUT, Maple seems to FORGET the result when 'k' equals 10^10...
--
--> limit(x^(10^10)/exp(x), x=infinity);
--
--                                          10000000000
--                                         x
--                           limit         ------------
--                           x -> infinity    exp(x)
--
--	SymbMath:
--	Input:
--lim(x=inf, x^k/exp(x))
--lim(x=inf, x^(10^10)/exp(x))
--lim(x=inf, x^(10^10000)/exp(x))
--	Output:
--0
--0
--0
--
--****************************** Example 7 ****************************
--	Maple:
--> int(x^m * exp (-b * x), x=0..infinity);
--
--                            infinity
--                               /
--                              |       m
--                              |      x  exp(- b x) dx
--                              |
--                             /
--                             0
--
--
--# As expected, the integral remains unevaluated.  Now declare the signs
--# of the symbolic parameters:
--
--> signum(b) := 1;
--
--                                 signum(b) := 1
--
--> signum(m) := 1;
--
--                                 signum(m) := 1
--
--
--# Upon attempting to compute the integral a second time...
--
--> int(x^m * exp (-b * x), x=0..infinity);
--
--                            infinity
--                               /
--                              |       m
--                              |      x  exp(- b x) dx
--                              |
--                             /
--                             0
--
--# ...THE INTEGRAL CONTINUES TO REMAIN UNEVALUATED, despite the fact that
--# the signs of the parameters 'b' and 'm' were declared PRIOR to the second
--# attempt at computation.
--
--	SymbMath:
--	Input:
--inte(x^n*exp(-a*x), x from 0 to inf)
--	Output:
--inte(x^n*exp(-a*x), x, 0, inf)
--
--
--************************ Example 8 *********************************
--	Mathematica:
--In[1]:= Integrate[1/x,{x,-1,1}]
--Out[1]= -Log[-1]
--
--	Maple:
--has the same problem.
--
--	SymbMath:
--	Input:
--inte(1/x, x from -1 to 1)
--inte(1/x, x from -1 to 2)
--	Output:
--0
--ln(2)
--
--
--*************************** Example 9 *******************************
--	Maple:
--has a problem for int(tan(x), x=0..pi).
--
--	SymbMath:
--	Input:
--inte(tan(x), x from 0 to pi)
--	Output:
--0
--
--**************************** Example 10 ****************************
--	Mathematica:
--cannot evaluate integral of sgn(x).
--
--	Maple:
--# cannot evaluate inegral of signum(x) by int(). Help with a procedure:
--# Load the procedure into Maple:
--
--> read `pvint.txt`;
--
--pvint := proc(f,x,a,b,s)
--         local i1,i2,eps;
--             signum(eps) := 1;
--             i1 := int(f,x = a .. s-eps);
--             i2 := int(f,x = s+eps .. b);
--             simplify(i1+i2);
--             limit(",eps = 0,right)
--         end
--
--
--> pvint(signum(x), x, -1, 1, 0);
--
--                          - eps                   1
--                            /                     /
--                           |                     |
--               limit       |    signum(x) dx +   |  signum(x) dx
--               eps -> 0+   |                     |
--                          /                     /
--                          -1                   eps
--
--# Maple refuses to evaluate this P.V. integral:
--
--> simplify(");
--
--                          - eps                   1
--                            /                     /
--                           |                     |
--               limit       |    signum(x) dx +   |  signum(x) dx
--               eps -> 0+   |                     |
--                          /                     /
--                          -1                   eps
--
--> eval(");
--
--                          - eps                   1
--                            /                     /
--                           |                     |
--               limit       |    signum(x) dx +   |  signum(x) dx
--               eps -> 0+   |                     |
--                          /                     /
--                          -1                   eps
--
--	SymbMath:
--	Input:
--inte(sgn(x), x from -1 to 1)
--inte(sgn(x), x from -1 to 2)
--	Output:
--0
--1
--
--************************* Example 11 ********************************
--Implicit diff. gives 1+y'[x](1+1/y[x])==0; y'[x]==-y[x]/(y[x]+1).
--
--	Mathematica:
-- given this eq. as input to DSolve says that built-in
-- procedure can't solve it.
--
--	 MACSYMA:
--(c1) depends(y,x)$
--
--(c2) ode2(diff(y,x) = -y/(y+1),y,x);
--
--(d2)                   - log(y) - y = x + %c
--
--(c3) method;
--
--(d3)                         separable
--
--
--	SymbMath:
--solve the differential equation by integration inte() or by dsolve().
--	Input:
--d(y)/d(x)*(1+1/y) === -1
--inte(last*d(x))
--Expand=On
--dsolve(d(y)/d(x) === -y/(y+1), y)
--	Output:
--(1 + 1/y)*d(y)/d(x) === -1
--y + ln(y*sgn(y)) === constant - x
--Expand = On
---y - ln(y*sgn(y)) === constant + x
--
--
--************************* Example 12 ********************************
--	Mathematica:
--                 y'[x] = y[x]^(1/2)
--                  y[0] = 0
--
--DSolve could not handle it. (It rarely solves anything!!), and the
--RungeKutta package only gave me the solution
--
--                    y[x]=0
--
--Obviously, there is another solution viz.
--
--                   y[x] = (x/2)^2
--
--	SymbMath:
--	Input:
--dsolve(d(y)/d(x) === sqrt(y), y)
--(last/2)^2
--	Output:
--2*sqrt(y) === constant + x
--y === 1/4*(constant + x)^2
--
--************************* Example 13 ********************************
--	Maple:	
--> sqrt(x*x);
--      x
--
--	Mathematica:
-- Sqrt[a^2] evaluates to Sqrt[a^2].
--
--	SymbMath:
--	Input:
--sqrt(x^2)
--assume(a > 0)
--sqrt(a^2)
--assume(b <0 )
--sqrt(b^2)
--	Output:
--x*sgn(x)
--assumed
--a
--assumed
---b
--
--********************** Example 14 **********************************
--	Maple and Mathematica cannot find the integrals of abs(x).
--
--	SymbMath:
--	Input:
--inte(abs(x), x from -1 to 1)
--inte(abs(x)^5*d(x))
--	Output:
--1
--constant + 1/6*abs(x)^6*sgn(x)
--
-----------------------------------------------------------------------
--
--	The following problems are taken from Swokowski's Calculus
--book.  They cause Mathematica to fail because of a singularity in
--the interior of the interval of integration:
--
--        Section 10.4 Problems 3, 12, 15, 16, 23, 29.
--
--The comments "INTEGRAL IS DIVERGENT" and "Principal Value" come from
--Macsyma.  Mma gives no indication that anything is amiss.
--
--************************ Problem3 *********************************
--	Mathematica:
--In[4]:= Integrate[1/x^2,{x,-3,1}]
--
--          4
--Out[4]= -(-)                            (* INTEGRAL IS DIVERGENT *)
--          3
--
--	SymbMath:
--	Input:
--inte(1/x^2, x from -3 to 1)
--	Output:
--inf
--
--************************** Problem12 ***************************
--	Mathemtica:
--In[6]:= Integrate[x^(-4/3),{x,-1,1}]
--
--Out[6]= -6                              (* INTEGRAL IS DIVERGENT *)
--
--	SymbMath:
--	Input:
--inte(x^(-4/3), x from -1 to 1)
--        Output:
--inf
--
--**************************** Problem15  ************************
--	Mathematica:
--In[7]:= Integrate[1/x,{x,-1,2}]
--
--Out[7]= -Log[-1] + Log[2]
--
--	Maple:
--has the same problem.
--	
--	Macsyma:
--	(c7) integrate(1/x,x,-1,2);
--	Principal Value
--	(d7)                                log(2)
--
--	SymbMath:
--	Input:
--inte(1/x, x from -1 to 2)
--	Output:
--ln(2)
--
--
--********************** Problem16 ************************************
--	Mathematica:
--In[8]:= Integrate[1/(x^2-x-2),{x,0,4}]
--
--        -Log[-2]   Log[2]   Log[5]
--Out[8]= -------- + ------ - ------
--           3         3        3
--
--	Macsyma:
--	(c8) integrate(1/(x^2-x-2),x,0,4);
--	Principal Value
--	                                     log(5)
--	(d8)                               - ------
--	                                       3
--
--
--	SymbMath:
--	Input:
--inte(1/(x^2-x-2), x from 0 to 4)
--	Output:
---1/3*ln(2) + 1/3*ln(2/5)
--
--***************************** Problem23 **********************
--	Mathematica:
--In[10]:= Integrate[(1/x^2)Cos[1/x],{x,-1,2}]
--
--                       1
--Out[10]= Sin[-1] - Sin[-]              (* INTEGRAL IS DIVERGENT *)
--		       2
--
--	SymbMath:
--	Input:
--y=1/x^2*cos(1/x)
--inte(y, x from -1 to 0-zero) + inte(y, x from 0+zero to 2)
--	Output:
--y = x^(-2)*cos(1/x)
--sin(-1) - sin(1/2) + 2*sin(inf)
--
--************************** Problem29 ********************************
--	Mathematica:
--In[12]:= Integrate[1/(x-4)^2,{x,0,Infinity}]
--
--           1
--Out[12]= -(-)                          (* INTEGRAL IS DIVERGENT *)
--           4
--
--	SymbMath:
--	Input:
--y=1/(x-4)^2
--inte(y, x from 0 to 4-zero) + inte(y, x from 4+zero to inf)
--	Output:
--y = (-4 + x)^(-2)
--inf
@
\eject
\begin{thebibliography}{99}
\bibitem{1} nothing
\end{thebibliography}
\end{document}