integrate(1/(sin(x)^2+1),x,a,b)?



Bug 1741705
<http://sourceforge.net/tracker/index.php?func=detail&aid=1741705&group_id=4933&atid=104933>;

says the integral from 0 to 8 is wrong.  I have a fix for this that
depends on floor(x/%pi) working correctly when x is a number, or
expression possibly including %pi.  I believe floor is working
correctly, and the changes I've made are also working correctly.

However, what should maxima do for the integral from 0 to z, say?
Currently, it returns 

sqrt(2)/2*atan(sqrt(2)*sin(z)/cos(z)) + %pi/sqrt(2)

This isn't quite right, unless you carefully select the correct branch
for atan.  This is, howveer, the correct answer if z < 2*%pi.

What should maxima do here?  What do Macsyma, Maple, and/or
Mathematica return for this integral?

Ray