Near the top of integrator, Maxima does atan2(y,x) --> atan(y/x). For definite integrals, this substitution causes bugs;
for example, each of the following have a sign error:
(%i24) integrate(atan2(1,x),x,-1,1);
(%o24) -(2*log(2)+%pi)/4+log(2)/2-(3*%pi)/4
(%i25) integrate(x^2 * atan2(1,x),x,-1,1);
(%o25) -%pi/3
A workaround for the first bug is the put an integrate defprop on atan2. I've tried this and it works (but the atan2(y,x) --> atan(y/x)
substitution needs to be moved after the call to diffdiv). This workaround doesn't fix integrate(x^2 * atan2(1,x),x,-1,1).
I'm not sure of Maxima's policy on trusting that an antiderivative is continuous on the same set as the integrand.
Putting a integrate defprop on atan2 is OK, and delaying the tan2(y,x) --> atan(y/x) substitution till after the call to diffdiv is
likely harmless. These changes fix the integrate(atan2(1,x),x,-1,1) bug, but it isn't a general fix-- integrate(x^2 * atan2(1,x),x,-1,1) is
still wrong.
--Barton