From: fateman@peoplesparc.Berkeley.EDU (Richard Fateman) Newsgroups: sci.math.symbolic Subject: Kahan's questions for Mma or similar systems Keywords: mathematica bugs Date: 15 Mar 91 17:08:54 GMT Several people have asked for a posting of the questions distributed by Prof. W. Kahan at Wolfram's Berkeley talk. Since Kahan printed his sheet "off net" on a printer with some typesetting capability, and some reworking has been done after the talk, I'll try to be brief, update, and paraphrase the data, rather than just reproduce it. Firstly, Kahan points out that the questions he posed cannot be called pathological because at least one other commercial computer algebra program, DERIVE, gets them (all) right. In several of the cases below, Mma version 2.0 will probably get a different (not always better) answer. Having only tried a beta-test version, it would be speculative to say what 2.0 would do in all cases. Here are Kahan's questions: Integrate[Sqrt[2-2 Cos[2 x]]/2, {x,Pi/4,3Pi/4}] DERIVE got sqrt(2), MMa 0. Try integrating from 0 to 2Pi and see if you get 4. Integrate[(1- x Cost[t])/(1+x^2-2xCos[t]), {x,-Pi,Pi}] DERIVE got Pi-Pi sign(x^2-1), Mma got 0. Integrate [y/(y^2+t^2),{t,-Infinity,Infinity},{y,x,z}]. DERIVE got (|z|-|x|)Pi regardless of the order. Mma's varies, but is not right either way. V[x_]:= Integrate [-r^2 Sin[t]/Sqrt[x^2+r^2-2 x r Cos[t]],{r,0,1},{t,0,Pi}] DERIVE got V(x)= -2/(3x) for x>=1, x^2/3-1 for 0<=x<=1. Mma got V(x)=-1. V[letter]=-1 where letter follows q in the alphabet is -1. Otherwise it returns -2/(3q). Mma did not simplify the product of 3-Sqrt[7] + I Sqrt[6Sqrt[7]-15] with its conjugate, to 1. DERIVE refused to simplify (1/y)^x - y^(-x) to 0 unless it knew that x was an integer or y>0. Mma 1.2 had no such scruples, even though x=I, y=-1 evaluates to about -23.0975. (Mma 2.0 should be different). Let f[x_]:= Limit[Sin[6 y]/Sin[y],y->x]. DERIVE found 5 correct zeros (there are more, at n Pi/6 where n is an integer n mod 6 !=0) Mma 1.2 found only one, at x=0, and it is wrong. Plotting f[x] over 0 to 3Pi gives a spurious spike at 2Pi, and flat stretches near x=0 and 3Pi. DERIVE correctly found the limit below to be Log[2]/((b-a)(b-c)). Mma finds 0. Limit[ Log[x-a]/(a-b)/(a-c) +Log[2(x-b)]/(b-c)/(b-a) + Log[x-c]/(c-a)/(c-b), x-> Infinity]. DERIVE found 0 for the limit below. Mma left it unevaluated. Limit[1/(Exp[x]-Exp[x-1/x^2]),x->Infinity] DERIVE simplifies Sqrt[4+2 Sqrt[3]] to 1+Sqrt[3]. Mma does not. ``Do not misconstrue the foregoing as a sales pitch for DERIVE. I chose to compare it with Mma only because DERIVE is so small (< 300kBytes) and so inexpensive that one might expect it to be outclassed by Mma in all respects. Correctness is not one of them. More important, DERIVE makes provision to a limited extent for information about a variables's type and range, and that contributes a lot to DERIVE's reliability. Mma handles type and range information as an afterthought, requiring cumbersome patterns and redefinitions that are so complicated as may well explain why Mma is so prone to error. W. Kahan''