integration of atan2



I think it's OK to append atan2 to the list of inverse trig functions that rischint handles by conversion to
log form (see function rischform). That allows the atan2 to atan conversion at the top of the function integrator
to be deleted.

The function trigin1 (defined in risch.lisp) has a sketchy call to realpart; optionally it calls rectform,
but I think this needs to be done with generate-atan2 set to true (this option variable was new to me).

The sketchy thing about the call to realpart is that it assumes if the integrand is free of %i and $li, the
integrand is realvalued on the real axis. The offending code is

     ;(setq result (sratsimp (if (and (freeof '$%i *exp) (freeof '$li yyy))  ;; <--current code
      ;                           ($realpart yyy)
      ;                           ($rectform yyy))))
       (setq result (sratsimp (let ((generate-atan2 t)) ($rectform yyy))))  ;; <----proposed code

The rectform call could be skipped, I suppose.

Examples: (not sure all of these are correct)

(%i10) integrate(atan2(1,x),x,-1,1), expand;
(%o10) %pi

(%i11) integrate(x^42 * atan2(1,x),x,-1,1);
(%o11) %pi/43

(%i12) integrate(x^42 * atan2(x,x^2),x,-1,1);
(%o12) 0

(%i13) integrate(x^41 * atan2(x,x^2),x,-1,1);
(%o13) (6845630929362225*%pi+21831981985010836)/1150065996132853800
 -(34228154646811125*%pi-21831981985010836)/1150065996132853800

If nothing else, I've verified the First Waffle Rule (the first waffle is never quite right).

--Barton