Subject: bug in integrate, is anyone working on this?
From: Richard Fateman
Date: Sat, 02 Jun 2012 15:12:43 -0700
On 6/2/2012 11:07 AM, Stavros Macrakis wrote:
> Rich,
>
> Doesn't it come down to the semantics of sqrt(x^2)?
Depends on the order of simplification and evaluation, sort of.
> 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?
It gives 2-2*cos(1), which is also the integral of abs(sin(x)).
>
> -s
>
> On Sat, Jun 2, 2012 at 1:25 PM, Richard Fateman
> <fateman at eecs.berkeley.edu <mailto: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 <mailto:Maxima at math.utexas.edu>
> http://www.math.utexas.edu/mailman/listinfo/maxima
>
>