Path: utzoo!attcan!uunet!cs.utexas.edu!yale!cmcl2!acf4!csd2!mitsolid From: mitsolid@csd2.NYU.EDU (Thanasis Mitsolides) Newsgroups: comp.binaries.ibm.pc.d Subject: Re: man(1) for MSDOS? Message-ID: <24460002@csd2.NYU.EDU> Date: 7 Feb 90 19:29:00 GMT References: <1990Feb1.175125.922@usenet.ins.cwru.edu> Organization: New York University Lines: 82 /* csd2:comp.binaries.ibm.pc.d / marshall@alpha.ces.cwru.edu ( ) / 9:51 am Feb 5, 1990 */ > > Amazing how easy it is to produce so much confusion. You ain't seen nothin' yet! Thanasis Relay-Version: version nyu B notes v1.6 9/18/89; site acf4.NYU.EDU From: mainieri@acf2.NYU.EDU (Ronnie Mainieri) Date: 7 Feb 90 11:09 EST Date-Received: 7 Feb 90 11:09 EST Subject: Re: MACSYMA flunks high school math (and REDUCE too) Message-ID: <12040002@acf2.NYU.EDU> Path: acf4!acf2!mainieri Newsgroups: sci.math.symbolic Posting-Version: version nyu B notes v1.6 9/18/89; site acf2.NYU.EDU Organization: New York University References: <167@sc2a.unige.ch> /* acf2:sci.math.symbolic / pfennige@sc2a.unige.ch / 6:04 am Feb 6, 1990 */ In article <2754@umbc3.UMBC.EDU>, rouben@math9.math.umbc.edu (Rouben Rostamian) writes: > There is a quite a serious bug in MACSYMA [UNIX MACSYMA Release 309.2.] [...] > Problem: Integrate the function > 1 > f(x) = sqrt ( x + --- - 2 ) > x > over the interval (0,1). > > Note that f(x) is a well-defined, real-valued, non-negative function on the > half-axis x>0. The integral is easy to compute (by high school methods) and > the correct answer is 4/3. MACSYMA gives the erroneous answer -4/3: A > negative integral for a positive integrand! > > Does anyone else get this too? > Yes, REDUCE 3.3 (Vax/VMS) finds the same negative answer as your version of MACSYMA. In REDUCE the problem comes from a bug with the square root, indeed implicitely SQRT(x^2) simplifies into x. There is a flag ('PRECISE') supposed to prevent such a simplification, i.e. SQRT(x^2) -> ABS(x), but it fails when x is a polynomial. Below is a sample session of REDUCE: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% REDUCE 3.3, 15-Jul-87 ... 1: on precise; % The flag is set on 2: sqrt(x^2); ABS(X) % The answer is correct for real numbers 3: sqrt((1-x)^2); X - 1 % Here is the bug 4: load "algint"; % Module for integrants containing square roots 5: f:=sqrt(x+1/x-2); % The function to integrate X - 1 F := --------- % It simplifies badly SQRT(X) 6: int(f,x); 2*SQRT(X)*(X - 3) ------------------- % The answer is negative for x<3 3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% I would be curious to know how many current algebra systems simplifies correctly radicals of expressions belonging to real numbers. At least I could experiment that mu-Math on an Apple II did not simplify such things as ((x-1)^2)^(1/2) when the appropriate flag is set. Daniel Pfenniger, Geneva Observatory /* ---------- */