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

Get Maxima to easily accept flag values #10955

Closed
kcrisman opened this issue Mar 17, 2011 · 9 comments
Closed

Get Maxima to easily accept flag values #10955

kcrisman opened this issue Mar 17, 2011 · 9 comments

Comments

@kcrisman
Copy link
Member

Maxima relatively recently decided that 1/sqrt(x) is not sqrt(1/x), for good reasons (1/sqrt(-1)=-i but sqrt(1/-1)=i in usual discussion). So for the following integral, they note that it depends on how you input it:

sage: integrate(sqrt(1/x^2+x),x)
integrate(sqrt(x + 1/x^2), x)
sage: integrate(1/sqrt(x^2+x),x)
log(2*x + 2*sqrt(x^2 + x) + 1)

Fine. Then they suggest using the flag radexpand:all to make the first one behave. But I can't figure out how to get it to evaluate.

sage: sage.calculus.calculus.maxima('radexpand:all')
all
sage: integrate(sqrt(1/x^2+x),x)
integrate(sqrt(x + 1/x^2), x)

Trying maxima.eval only changes that I get 'all' instead of all. We should make this work, since this is the calculus instance of Sage!

CC: @robert-marik @burcin @nbruin @jasongrout @wdjoyner

Component: calculus

Keywords: maxima, flag, radexpand

Author: Peter Bruin

Branch/Commit: b94b48a

Reviewer: Nils Bruin, Karl-Dieter Crisman

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

@nbruin
Copy link
Contributor

nbruin commented Nov 1, 2013

comment:1

Works for me on some flavour of 5.13.beta0

sage: integrate(sqrt(1/x^2+x),x)
integrate(sqrt(x + 1/x^2), x)
sage: sage.calculus.calculus.maxima('radexpand:all')
all
sage: integrate(sqrt(1/x^2+x),x)
2/3*sqrt(x^3 + 1) - 1/3*log(sqrt(x^3 + 1) + 1) + 1/3*log(sqrt(x^3 + 1) - 1)

I didn't check if the answer makes sense, but at least setting the flag has effect.

@pjbruin
Copy link
Contributor

pjbruin commented May 21, 2014

Author: Peter Bruin

@pjbruin
Copy link
Contributor

pjbruin commented May 21, 2014

Branch: u/pbruin/10955-maxima_radexpand

@pjbruin
Copy link
Contributor

pjbruin commented May 21, 2014

comment:2

Works for me too; here is a doctest.

@pjbruin
Copy link
Contributor

pjbruin commented May 21, 2014

Commit: b94b48a

@pjbruin pjbruin added this to the sage-6.3 milestone May 21, 2014
@kcrisman
Copy link
Member Author

Reviewer: Nils Bruin, Karl-Dieter Crisman, Michael Orlitzky

@kcrisman
Copy link
Member Author

comment:3

As far as I can tell this is fine. I have no idea why this didn't work before. Passes tests, does right thing.


Wow, I am just now noticing that the suggestion made earlier was pretty bogus.

sage: integrate(1/sqrt(x^2+x),x)
log(2*x + 2*sqrt(x^2 + x) + 1)

Totally not the same thing as sqrt(1/x^2+x)! Should have been

sage: integrate(1/sqrt(x^2+x),x)
log(2*x + 2*sqrt(x^2 + x) + 1)
sage: integrate(sqrt(1/(x^2+x)),x)
log(sqrt(x + 1)/sqrt(x) + 1) - log(sqrt(x + 1)/sqrt(x) - 1)

which also happens to be affected by radexpand:all.

@kcrisman
Copy link
Member Author

Changed reviewer from Nils Bruin, Karl-Dieter Crisman, Michael Orlitzky to Nils Bruin, Karl-Dieter Crisman

@vbraun
Copy link
Member

vbraun commented May 29, 2014

Changed branch from u/pbruin/10955-maxima_radexpand to b94b48a

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

5 participants