Intrinsic limitations |
Completely automating mathematics is a vain goal. There will always be problems in which one has to worry about round-off errors, choices of branch cuts, and so forth.
Whenever floating-point numbers are involved in a calculation, Maple has the potential to return nonsense due to round-off errors.
Consider, for example, integrating the product of x5 and
exp(x/100) for x between -1 and 1. (This
example was suggested by G. Donald Allen.) Since the
exponential exp(x/100) is nearly constant on the
integration interval, while x5 is odd, the answer must be
nearly equal to 0. With the default setting of
Digits
, however, Maple gives the following.
evalf(int(x^5*exp(x/100), x=-1..1)); 100000.
This answer is certainly not close to zero! If you double the function, you would expect the integral to double also, but Maple gives a different answer.
evalf(int(2*x^5*exp(x/100), x=-1..1)); 0
If you change the int
to the inert form Int
, or if
you increase the value of Digits
to 25, then Maple obtains the correct results of about 0.002857 and
0.005714.
Usually you can overcome problems with round-off errors simply
by setting Digits
to a larger value. However, some
numerical errors are ineradicable. For example, try the Maple command
trunc( ( 5.0/6 - 5/6.0 ) * 10^Digits );
which ought to return 0, but actually returns 1,
whatever the setting of Digits
.
Exercise: Is pi an algebraic number?
A student executed the following commands and concluded that pi satisfies a polynomial equation with integral coefficients.restart: p:=x->3-16*x+10*x^2+12*x^3+2*x^4-x^5+2*x^6 +22*x^7-12*x^8+9*x^9-10*x^10-7*x^11+3*x^12: evalf(p(Pi)); 0
What went wrong?
Square roots and other fractional powers are always problematical: which of the two possible square roots should Maple take?
On 22 October 2001, Preben Alsholm posted to the newsgroup comp.soft-sys.math.maple the following example in which Maple integrates a function over an interval where the function is positive and arrives at the absurd answer of negative infinity! Presumably Maple gets confused because of the square root in the integrand.
> int(1/(x+1)*sqrt(x^4+1), x=0..1); -infinity
Maple will, however, give the correct answer this way:
> evalf(Int(1/(x+1)*sqrt(x^4+1), x=0..1)); .7424540402
Exercise
On 28 May 1998, John McKay started a thread in the newsgroup sci.math.symbolic about simplifying the expression -(-1)2/9 - (-1)8/9 + (-1)5/9. Here is what Maple 7 does:
evalf(-(-1)^(2/9)-(-1)^(8/9)+(-1)^(5/9)); -9 -9 -.2 10 + .1 10 I
while Maple 6 reports the answer "0.+0.*I
".
Whether or not 0 is the "correct" answer generated
considerable discussion in the newsgroup. How does Maple get
its answer? In what sense is this answer the right one? What do
you think of the value -3 as an answer?
Intrinsic limitations |