#18599: Maxima integral wrong
-------------------------------------------------+-------------------------
       Reporter:  kcrisman                       |        Owner:
           Type:  defect                         |       Status:  new
       Priority:  major                          |    Milestone:  sage-6.8
      Component:  calculus                       |   Resolution:
       Keywords:                                 |    Merged in:
        Authors:                                 |    Reviewers:
Report Upstream:  Reported upstream. No          |  Work issues:
  feedback yet.                                  |       Commit:
         Branch:                                 |     Stopgaps:
   Dependencies:                                 |
-------------------------------------------------+-------------------------
Description changed by rws:

Old description:

> See [https://groups.google.com/forum/#!topic/sage-devel/GX-hYs0grdE this
> sage-devel discussion].
>
> {{{
> sage: from sage.symbolic.integration.external import maxima_integrator
> sage: maxima_integrator(sqrt(cot(x)^2),x)
> -1/2*log(tan(x)^2 + 1) + log(tan(x))
> sage: maxima_integrator(cot(x),x)
> log(sin(x))
> sage: maxima_integrator(sqrt(cot(x)^2),x,pi/4,3*pi/4)
> 0
> sage: maxima_integrator(cot(x),x, pi/4,3*pi/4)
> 0
> sage: f(x) = maxima_integrator(sqrt(cot(x)^2),x)
> sage: f(pi/4)
> -1/2*log(2)
> sage: f(3*pi/4)
> I*pi - 1/2*log(2)
> }}}
>
> But that is wrong, as this function is nonnegative and usually positive.
> The problem is in Maxima.
>
> {{{
> (%i1) domain:complex;
> (%o1)                               complex
> (%i2) sqrt(cot(x)^2);
>                                          2
> (%o2)                            sqrt(cot (x))
> (%i3) integrate(sqrt(cot(x)^2),x,%pi/4,%pi/4*3);
> (%o3)                                  0
> (%i4) integrate(sqrt(cot(x)^2),x);
>                                              2
>                                       log(tan (x) + 1)
> (%o4)                   log(tan(x)) - ----------------
>                                              2
> }}}
>
> Reported upstream [https://sourceforge.net/p/maxima/bugs/2971/ at bug
> 2971].

New description:

 See
  * https://groups.google.com/forum/#!topic/sage-devel/GX-hYs0grdE
  * https://groups.google.com/forum/#!topic/sage-devel/PSWsQPl1TBA

 {{{
 sage: from sage.symbolic.integration.external import maxima_integrator
 sage: maxima_integrator(sqrt(cot(x)^2),x)
 -1/2*log(tan(x)^2 + 1) + log(tan(x))
 sage: maxima_integrator(cot(x),x)
 log(sin(x))
 sage: maxima_integrator(sqrt(cot(x)^2),x,pi/4,3*pi/4)
 0
 sage: maxima_integrator(cot(x),x, pi/4,3*pi/4)
 0
 sage: f(x) = maxima_integrator(sqrt(cot(x)^2),x)
 sage: f(pi/4)
 -1/2*log(2)
 sage: f(3*pi/4)
 I*pi - 1/2*log(2)
 }}}

 But that is wrong, as this function is nonnegative and usually positive.
 The problem is in Maxima.

 {{{
 (%i1) domain:complex;
 (%o1)                               complex
 (%i2) sqrt(cot(x)^2);
                                          2
 (%o2)                            sqrt(cot (x))
 (%i3) integrate(sqrt(cot(x)^2),x,%pi/4,%pi/4*3);
 (%o3)                                  0
 (%i4) integrate(sqrt(cot(x)^2),x);
                                              2
                                       log(tan (x) + 1)
 (%o4)                   log(tan(x)) - ----------------
                                              2
 }}}

 Reported upstream [https://sourceforge.net/p/maxima/bugs/2971/ at bug
 2971].

--

--
Ticket URL: <http://trac.sagemath.org/ticket/18599#comment:2>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to