Opened 12 years ago

Closed 9 years ago

#10955 closed task (fixed)

Get Maxima to easily accept flag values

Reported by: Karl-Dieter Crisman Owned by: Burcin Erocal
Priority: trivial Milestone: sage-6.3
Component: calculus Keywords: maxima, calculus, flag, radexpand
Cc: Robert Marik, Burcin Erocal, Nils Bruin, Jason Grout, David Joyner Merged in:
Authors: Peter Bruin Reviewers: Nils Bruin, Karl-Dieter Crisman
Report Upstream: N/A Work issues:
Branch: b94b48a (Commits, GitHub, GitLab) Commit: b94b48a873b29617f5562f18ffd1a61d67b1a7a6
Dependencies: Stopgaps:

Status badges

Description

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!

Change History (5)

comment:1 Changed 9 years ago by Nils Bruin

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.

comment:2 Changed 9 years ago by Peter Bruin

Authors: Peter Bruin
Branch: u/pbruin/10955-maxima_radexpand
Commit: b94b48a873b29617f5562f18ffd1a61d67b1a7a6
Milestone: sage-6.3
Priority: minortrivial
Status: newneeds_review
Type: defecttask

Works for me too; here is a doctest.

comment:3 Changed 9 years ago by Karl-Dieter Crisman

Reviewers: Nils Bruin, Karl-Dieter Crisman, Michael Orlitzky
Status: needs_reviewpositive_review

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.

comment:4 Changed 9 years ago by Karl-Dieter Crisman

Reviewers: Nils Bruin, Karl-Dieter Crisman, Michael OrlitzkyNils Bruin, Karl-Dieter Crisman

comment:5 Changed 9 years ago by Volker Braun

Branch: u/pbruin/10955-maxima_radexpandb94b48a873b29617f5562f18ffd1a61d67b1a7a6
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.