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



On 6/27/07, Raymond Toy <raymond.toy at ericsson.com> wrote:

> 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?

In general, I'd like to see something like

  if P1(z) then <stuff> elseif P2(z) then <other stuff> elseif ...
else 'integrate(...)

where P1, P2, ... are some predicate functions
(ideally including "z in R" and other set-membership tests).

For the problem at hand, it might be possible to obviate the
need for a conditional expression by expressing the result
in terms of floor, mod, signum, etc. But when Maxima doesn't
know a result like that, I'd like to see a conditional expression.

FWIW
Robert