Fix for Larry Bates's integration bug



Thank you very much for the explanation and the hint!

Richard Fateman <fateman@cs.berkeley.edu> writes:

> One possibility is there is a bug in the GCD routine, in
> which case using one of the others may help.  If you look
> at the setting of GCD, and it is SPMOD,  you might try
> doing the same calculation after doing
> 
> GCD:SUBRES;
> 
> If this works, then the error is in the GCD routine.

Actually, in this case, it seems to be the other way round,
i.e. SUBRES is the default setting but doesn't work here, while SPMOD
does.

Maxima 5.9.0pre-cvs (with enhancements by W. Schelter).
Licensed under the GNU Public License (see file COPYING)
(C1) gcd;
(D1) 				    SUBRES
(C2) gcd:spmod;
(D2) 				     SPMOD
(C3) exp:sin(a)/(1-cos(a)^2*sin(t)^2);
				    SIN(a)
(D3) 			      -------------------
				     2	     2
			      1 - COS (a) SIN (t)
(C4) assume(cos(a)>0,sin(a)>0);
(D4) 			   [COS(a) > 0, SIN(a) > 0]
(C5) integrate(exp,t,0,2*%pi);
Is  COS(a) - 1  positive, negative, or zero?

neg;
		  2	     2
Is  2 SQRT(1 - COS (a)) - COS (a) + 2  positive, negative, or zero?

pos;
		  2	     2
Is  2 SQRT(1 - COS (a)) + COS (a) - 2  positive, negative, or zero?

neg;
			 2	    2
Is  SQRT(- 2 SQRT(1 - COS (a)) - COS (a) + 2) - COS(a)

						   positive, negative, or zero?

neg;
		       2	  2
Is  SQRT(2 SQRT(1 - COS (a)) - COS (a) + 2) - COS(a)

						   positive, negative, or zero?

pos;
			      2		       2
	   (4 %PI SQRT(1 - COS (a)) + 2 %PI COS (a) - 4 %PI) SIN(a)
(D5) 	   --------------------------------------------------------
		     2		        2	  2
	      - 2 COS (a) + SQRT(1 - COS (a)) (COS (a) - 2) + 2
(C6) subst(1-sin(a)^2,cos(a)^2,%);
				    2
	      SIN(a) (2 %PI (1 - SIN (a)) + 4 %PI SIN(a) - 4 %PI)
(D6) 	      ---------------------------------------------------
			    2			 2
		- 2 (1 - SIN (a)) + SIN(a) (- SIN (a) - 1) + 2
(C7) ratsimp(%);
(D7) 				     2 %PI
(C8) 

This works also for, e.g., 3/2 instead of a.

Here is what the info documentation says about the various algorithms
(contrary to what it states, the default setting is SUBRES, not
SPMOD).

 - Function: GCD (p1, p2, var1, ...)
     computes the greatest common divisor of p1 and p2.  The flag
     GCD[SPMOD] determines which algorithm is employed.  Setting GCD to
     EZ, EEZ, SUBRES, RED, or SPMOD selects the EZGCD, New EEZ GCD,
     subresultant PRS, reduced, or modular algorithm, respectively.  If
     GCD:FALSE then GCD(p1,p2,var) will always return 1 for all var.
     Many functions (e.g.  RATSIMP, FACTOR, etc.) cause gcd's to be
     taken implicitly.  For homogeneous polynomials it is recommended
     that GCD:SUBRES be used.  To take the gcd when an algebraic is
     present, e.g. GCD(X^2-2*SQRT(2)*X+2,X-SQRT(2)); , ALGEBRAIC must be
     TRUE and GCD must not be EZ.  SUBRES is a new algorithm, and people
     who have been using the RED setting should probably change it to
     SUBRES.  The GCD flag, default: [SPMOD], if FALSE will also
     prevent the greatest common divisor from being taken when
     expressions are converted to CRE form.  This will sometimes speed
     the calculation if gcds are not required.

-- 
wjenkner@inode.at