Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Another incorrect Maxima integral #13718

Open
kcrisman opened this issue Nov 16, 2012 · 7 comments
Open

Another incorrect Maxima integral #13718

kcrisman opened this issue Nov 16, 2012 · 7 comments

Comments

@kcrisman
Copy link
Member

This is already reported upstream at this bug tracker ticket.

The original report from a summer PREP user:

integral((2/3)*x^(5/2)*(x+1)^.5, x,0,1)

I got the answer -0.888888889*sqrt(2)

integral((2/3)*x^(5/2)*(x+1)^(1/2), x,0,1)

And the answer is


-5/192*I*pi + 61/288*sqrt(2) + 5/192*log(-sqrt(2) + 1) -
5/192*log(sqrt(2) + 1)

Upstream: Reported upstream. No feedback yet.

Component: calculus

Keywords: integral

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

@kcrisman
Copy link
Member Author

comment:1

#11493 may be related.

@jdemeyer jdemeyer modified the milestones: sage-5.11, sage-5.12 Aug 13, 2013
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.2, sage-6.3 May 6, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.3, sage-6.4 Aug 10, 2014
@mforets
Copy link
Mannequin

mforets mannequin commented Apr 9, 2017

comment:6

This prompts me to see what happens with alternative integration interfaces.

Try with SymPy:

sage: sage: integral((2/3)*x^(5/2)*(x+1)^.5, x,0,1, algorithm='sympy')   
# no output at all after ~10mins

Try with giac:

sage: giac('integrate((2/3)*x^(5/2)*sqrt(x+1), x,0,1)')   # correct and almost instantaneous
1/288*(sqrt(2)*61+15*ln(sqrt(2)-1))
sage: (1/288*(sqrt(2)*61+15*ln(sqrt(2)-1))).n()
0.253633414928700
sage: (-5/192*I*pi + 61/288*sqrt(2) + 5/192*log(-sqrt(2) + 1) -
....: 5/192*log(sqrt(2) + 1)).n()    # compare with formula given by OP
0.253633414928700

@mforets
Copy link
Mannequin

mforets mannequin commented Apr 28, 2017

comment:7

fixed at Sage v8.0.beta3:

sage: integrate((2/3)*x^(5/2)*sqrt(x+1), x,0,1, algorithm='maxima')
-5/192*I*pi + 61/288*sqrt(2) - 5/192*log(sqrt(2) + 1) + 5/192*log(-sqrt(2) + 1)
sage: _.n()
0.253633414928700

@mforets
Copy link
Mannequin

mforets mannequin commented Apr 28, 2017

comment:8

not really.. the problem is with the 0.5:


sage: integral((2/3)*x^(5/2)*(x+1)^.5, x,0,1, algorithm='maxima') # wrong
-0.8888888888888888*sqrt(2)
sage: integral((2/3)*x^(5/2)*(x+1)^.5, x,0,1, algorithm='giac') # ok
0.253633414929
sage: integral((2/3)*x^(5/2)*(x+1)^.5, x,0,1, algorithm='sympy') # timeout

@rwst
Copy link

rwst commented Apr 28, 2017

comment:9

That is user error. No one can expect to get correct integrals from expressions containing floating point numbers. It is not supported and maybe Sage should throw an exception in these cases anyway. If you agree, Karl-Dieter, I'll open a ticket for just this.

@rwst
Copy link

rwst commented Apr 28, 2017

comment:10

Together with #22894 and ex._convert(QQ) one could even provide a default option that automatically converts 0.5 to 1/2 before integration.

@fchapoton
Copy link
Contributor

Changed keywords from none to integral

@mkoeppe mkoeppe removed this from the sage-6.4 milestone Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants