conditional integration



Today, I updated abs_integrate. For an integrand with one or more parameters, the function 
conditional_integrate *tries* to find an antiderivative that is valid for all values of the 
parameters. Examples:

?(%i1) load("abs_integrate.mac")$
?(%i2) push('conditional_integrate, extra_integration_methods)$

?(%i10) 'integrate(cos(m * x),x);
?(%o10) %if(m#0,sin(m*x)/m,x)

?(%i11) 'integrate(x^n,x);
?(%o11) %if(n+1#0,x^(n+1)/(n+1),log(x))

?(%i12) 'integrate(cos(m * x) * cos(n * x),x);
?(%o12) %if((n-m#0) %and (n+m#0),((n-m)*sin((n+m)*x)+(n+m)*sin((n-m)*x))/(2*n^2-2*m^2),%if((n-m#0) %and (n+m=0),%if(n#0, (sin(2*n*x)+2*n*x)/(4*n),x),%if((n-m=0) %and (n+m#0),%if(n#0,(sin(2*n*x)+2*n*x)/(4*n),x),x)))

I see %if could use some work :(

?(%i13) sublis([m=n],%);
?(%o13) %if(n#0,%if(n#0,(sin(2*n*x)+2*n*x)/(4*n),x),x)

Asksign can still be called, but conditional_integrate goes ahead and tries to return an
antiderivative that covers all cases even when asksign gets called.

Algorithmically conditional_integrate (i) calls integrate, (ii) looks for poles
in the antiderivative that aren't in the integrand, (iii) when possible, tries again
for each new pole.

Maybe conditional_integrate is as careful as an average calculus student... Let me know what
you all think (you'll need to get the new abs_integrate from CVS, not Maxima 5.22).

--Barton