sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.36k stars 462 forks source link

exponential integral of arccos #24008

Open c22b6800-ec0b-4cbf-94c4-0a74aecc2093 opened 6 years ago

c22b6800-ec0b-4cbf-94c4-0a74aecc2093 commented 6 years ago

Maxima interface returns a wrong result of this definite integral:

sage: integrate(exp(arccos(x)),x,0,1, algorithm='maxima')                         
-1/2*e^(-1/2*pi) + 1/2

while it should be:

sage: integrate(exp(arccos(x)),x,0,1, algorithm='sympy')
1/2*e^(1/2*pi) + 1/2

This was reported in ask.sage: an integral with arccos wrong

Upstream: Reported upstream. No feedback yet.

Component: calculus

Keywords: integration, maxima

Issue created by migration from https://trac.sagemath.org/ticket/24008

c22b6800-ec0b-4cbf-94c4-0a74aecc2093 commented 6 years ago

Description changed:

--- 
+++ 
@@ -1,7 +1,7 @@
 Maxima interface returns a wrong result of this definite integral:

-sage: integrate(exp(t)sin(t),t,0,pi/2,algorithm='maxima')
+sage: integrate(exp(arccos(x)),x,0,1, algorithm='maxima')
-1/2
e^(-1/2*pi) + 1/2

rwst commented 6 years ago
comment:2

This is a Maxima problem because

(%i10) integrate(exp(acos(x)),x,0,1);
                                       - %pi/2
                                 1   %e
(%o10)                           - - ---------
                                 2       2
c22b6800-ec0b-4cbf-94c4-0a74aecc2093 commented 6 years ago
comment:3

Ok, thank you!

i've sent an upstream report

c22b6800-ec0b-4cbf-94c4-0a74aecc2093 commented 6 years ago

Changed upstream from Not yet reported upstream; Will do shortly. to Reported upstream. No feedback yet.

fchapoton commented 3 years ago
comment:4

There is something strange going on:

maxima: f:exp(acos(x));                                                         
%e^acos(x)
maxima: integrate(f,x,0,1);                                                     
1/2-%e^-(%pi/2)/2
maxima: integrate(1/f,x,0,1);                                                   
1/2-%e^-(%pi/2)/2

How would one try to debug that ?

fchapoton commented 3 years ago
comment:5

The problem is also there (after change of variable) in

(%i8) integrate(exp(acos(cos(y)))*sin(y),y,0,%pi/2);
                                       - %pi/2
                                 1   %e
(%o8)                            - - ---------
                                 2       2
(%i9) integrate(exp(y)*sin(y),y,0,%pi/2);
                                    %pi/2
                                  %e        1
(%o9)                             ------- + -
                                     2      2

(%i12) integrate(exp(-y)*sin(y),y,0,%pi/2);
                                       - %pi/2
                                 1   %e
(%o12)                           - - ---------
                                 2       2
fchapoton commented 3 years ago
comment:6

so this depends on the allowed trig simplifications:

(%i50) triginverses:all;
(%o50)                                all
(%i51) integrate(exp(acos(cos(y)))*sin(y),y,0,%pi/2);
                                    %pi/2
                                  %e        1
(%o51)                            ------- + -
                                     2      2
(%i52) triginverses:true;   
(%o52)                               true
(%i53) integrate(exp(acos(cos(y)))*sin(y),y,0,%pi/2);
                                       - %pi/2
                                 1   %e
(%o53)                           - - ---------
                                 2       2