# [Maxima] bug in integrate, is anyone working on this?

Stavros Macrakis macrakis at alum.mit.edu
Sat Jun 2 13:07:35 CDT 2012

```Rich,

Doesn't it come down to the semantics of sqrt(x^2)?  If "sqrt" means
"positive square root", then this is abs(x) (Maxima's normal behavior).
But if you treat sqrt as multivalued, then you need some way to decide
whether sqrt(x^2) for negative x is x=-abs(x) or -x = abs(x).  One
reasonable way to do this is as the analytic continuation of sqrt(x^2) for
positive x, which would make sqrt(x^2) -> +/- x.

So the current Maxima results are arguably correct (with the arbitrary
choice of +x rather than -x over the whole range). Mathematica's result is
clever because it includes that pesky sqrt in the result.  Cf.
Mathematica's integrate(sqrt(x^2),x) => x*sqrt(x^2)/2.

What does Mathematica do for definite integrals?

-s

On Sat, Jun 2, 2012 at 1:25 PM, Richard Fateman
<fateman at eecs.berkeley.edu>wrote:

> sin(x)^2/sqrt(1-cos(x)^2);
>
> integrate(%,x,-1,1)  returns 0, but the integrand is
> always non-negative.
>
> integrate(%,x)  returns cos(x)  which is not
> right either.
>
> Mathematica gives  -cot(x)*sqrt(sin(x)^2)   :)
>
> This kind of integration problem is not new.
>
>
> RJF
>
> ______________________________**_________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/**mailman/listinfo/maxima<http://www.math.utexas.edu/mailman/listinfo/maxima>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.math.utexas.edu/pipermail/maxima/attachments/20120602/442f8225/attachment-0001.html>
```