rtoy / maxima

A Clone of Maxima's repo
Other
0 stars 0 forks source link

wrong exponential integral of arccos #2291

Open rtoy opened 2 weeks ago

rtoy commented 2 weeks ago

Imported from SourceForge on 2024-07-05 22:48:42 Created by mforets on 2017-10-11 08:37:44 Original: https://sourceforge.net/p/maxima/bugs/3340


Hello! Maxima gets the following definite integral wrong:

(%i10) integrate(exp(acos(x)),x,0,1);
                                       - %pi/2
                                 1   %e
(%o10)                           - - ---------
                                 2       2

The correct answer is 1/2*e^(1/2*pi) + 1/2.

Downstream report: https://trac.sagemath.org/ticket/24008

rtoy commented 2 weeks ago

Imported from SourceForge on 2024-07-05 22:48:43 Created by mforets on 2017-10-11 08:40:25 Original: https://sourceforge.net/p/maxima/bugs/3340/#bd3e


huh, sorry for the code misalignment... what you see is Not what you get :)

i don't find a button to edit the ticket's description.

rtoy commented 2 weeks ago

Imported from SourceForge on 2024-07-05 22:48:47 Created by robert_dodier on 2017-11-23 23:25:05 Original: https://sourceforge.net/p/maxima/bugs/3340/#badd


Diff:


--- old
+++ new
@@ -1,14 +1,14 @@
 Hello!
 Maxima gets the following definite integral wrong:

-~~~
+~~~~
 (%i10) integrate(exp(acos(x)),x,0,1);
                                        - %pi/2
                                  1   %e
 (%o10)         - - ---------
                                  2       2
-~~~
+~~~~

-The correct answer is 1/2*e^(1/2*pi) + 1/2.
+The correct answer is `1/2*e^(1/2*pi) + 1/2`.

 Downstream report: https://trac.sagemath.org/ticket/24008
rtoy commented 2 weeks ago

Imported from SourceForge on 2024-07-05 22:48:50 Created by robert_dodier on 2017-11-23 23:27:48 Original: https://sourceforge.net/p/maxima/bugs/3340/#4779


Diff:


--- old
+++ new
@@ -5,8 +5,9 @@
 (%i10) integrate(exp(acos(x)),x,0,1);
                                        - %pi/2
                                  1   %e
-(%o10)         - - ---------
+(%o10)                           - - ---------
                                  2       2
+

The correct answer is 1/2*e^(1/2*pi) + 1/2.

rtoy commented 2 weeks ago

Imported from SourceForge on 2024-07-05 22:48:54 Created by robert_dodier on 2017-11-23 23:27:49 Original: https://sourceforge.net/p/maxima/bugs/3340/#92c8


Hmm, tried to fix formatting, didn't succeed ... try again.

rtoy commented 2 weeks ago

Imported from SourceForge on 2024-07-05 22:48:57 Created by vanzandt on 2017-11-24 02:45:20 Original: https://sourceforge.net/p/maxima/bugs/3340/#774d


Maxima is returning the answer for a different integral. E.g. in MATLAB:

(1-exp(-pi/2))/2

ans =

0.3961

quad(@(x) exp(-acos(x)),0,1)

ans =

0.3961

Another way to look at it is that Maxima has chosen a different branch. Ordinarily, one would say that 0 < acos(x) < pi/2 if 0 < x < 1. That's the branch that MATLAB uses:

acos(.9)

ans =

0.4510

cos(.4510)

ans =

0.9000

However, cos(x) is of course an even function:

cos(-.4510)

ans =

0.9000

...which means one could claim that acos(.9) = -.4510

That's essentially what Maxima has done.

I've no clue as to how one could persuade it to use a different branch.

On Wed, Oct 11, 2017 at 4:37 AM, Marcelo Forets via Maxima-bugs < maxima-bugs@lists.sourceforge.net> wrote:


Status: open Group: None Created: Wed Oct 11, 2017 08:37 AM UTC by Marcelo Forets Last Updated: Wed Oct 11, 2017 08:37 AM UTC Owner: nobody

Hello! Maxima gets the following definite integral wrong:

(%i10) integrate(exp(acos(x)),x,0,1);

  • %pi/2 1 %e (%o10) - - --------- 2 2

The correct answer is 1/2e^(1/2pi) + 1/2.

Downstream report: https://trac.sagemath.org/ticket/24008

Sent from sourceforge.net because maxima-bugs@lists.sourceforge.net is subscribed to https://sourceforge.net/p/maxima/bugs/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/maxima/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.



Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot


Maxima-bugs mailing list Maxima-bugs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/maxima-bugs

Attachments: