From: Raymond T. <rt...@us...> - 2006-03-16 17:36:40
|
Update of /cvsroot/maxima/maxima/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21111/tests Modified Files: rtestint.mac Log Message: o Change the test integrate(log(x)^k1,x,0,1) to integrate((-log(x))^k1,x,0,1) because the former integrand is complex for 0 <= x <= 1. o The integral integrate(x^(1/3)/sqrt(-log(x)),x,0,1) had the wrong sign for the result because radexpand is true. Correct the sign, and set radexpand:false for this test. o Add comments about these to the tests. Index: rtestint.mac =================================================================== RCS file: /cvsroot/maxima/maxima/tests/rtestint.mac,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- rtestint.mac 15 Mar 2006 18:14:12 -0000 1.10 +++ rtestint.mac 16 Mar 2006 17:36:35 -0000 1.11 @@ -606,19 +606,49 @@ /* * Maxima asks if k is an integer, but it doesn't matter, * and I don't know how to tell maxima that k isn't an integer. + * */ -(assume(k1>0),declare(k1,integer),0); +(assume(k1>0),declare(k1,noninteger),0); 0; +/* + * This is not such a good integral to use. log(x) is negative over the integration + * limits, so integrand is complex. Let's change the integrand to be + * (-log(x))^k1 instead, which is real-valued. + * + * In this case, it's easy to see that the substitution y=-log(x) + * gives as a gamma function. + */ +/* integrate(log(x)^k1,x,0,1); (-1)^k1*gamma(k1+1); +*/ +integrate((-log(x))^k1,x,0,1); +gamma(k1+1); + /* p. 120 */ integrate(sqrt(log(x))/x^2,x,1,inf); sqrt(%pi)/2; /* p. 120 */ +/* + * Wang says -sqrt(%pi)/sqrt(4/3) = -sqrt(3)*sqrt(%pi)/2. + * + * This is wrong. Clearly, the integrand is positive, so the integral + * must be positive. + * + * The issue is that radexpand is true so the Risch integrator is + * doing something not quite right and getting the sign wrong. If we + * set radexpand to false, we get the correct answer. + */ +radexpand:false; +false; + integrate(x^(1/3)/sqrt(-log(x)),x,0,1); --sqrt(3)*sqrt(%pi)/2; +sqrt(3)*sqrt(%pi)/2; + +radexpand:true; +true; /* p. 121 */ /* |