[sage-support] Re: Error with simple integral, "CEXPT only defined for non-negative integral exponents."

2017-11-07 Thread Emmanuel Charpentier
Hmmm... Compare :

sage: with assuming(b!=-1): integrate(a*x^b,x)
a*x^(b + 1)/(b + 1)
sage: integrate(a*x^b,x,algorithm="fricas")
a*x*e^(b*log(x))/(b + 1)
sage: integrate(a*x^b,x,algorithm="giac")
a*x^(b + 1)/(b + 1)
import sympy
sage: sympy.integrate(a*x^b,[x])
a*Piecewise((log(x), Eq(b, -1)), (x**(b + 1)/(b + 1), True))sage: 
mathematica.Integrate(a*x^b,x).sage()
a*x^(b + 1)/(b + 1)
sage: maple.integrate(a*x^b,x).sage()
a*x^(b + 1)/(b + 1)

[ "with assuming() : coming attraction : that's Trac#24119, IIRC (closed, 
fixed) : temporary assumptions ]


   - Maxima is the only system warning explicitly that b==-1 is a special 
   case, but not solving it.
   - Sympy does, but uses a syntax that can't (yet) be translated in Sage 
   (Ralf Stefan is on it...).
   - Both giac and fricas solve the general case, but do not give any form 
   of explicit warning.
   - However, fricas does **not** (over-)simplify a*x*e^(b*log(x)) into 
   a*x^(b+1), which should warn the reader that interpretation is fishy if 
   x<0...
   - "The competition" is not better at this, at least when used from 
   Sage... (Further checks from their native interfaces show no enhancement).
   
Rough conclusion : no CAS will save your skin if you use it "naively". 
Sympy seems to be marginally more useful than Maxima in this specific case, 
but our interface to it has to be perfected (work in progress...).

--
Emmanuel Charpentier

Le mardi 7 novembre 2017 18:06:05 UTC+1, saad khalid a écrit :
>
> Hello everyone:
>
> I am currently trying to do this integral in Cocalc:
>
> integral(525.87*(x)^(-2.35),x,.1,1)
>
> It gives me the following error:
> "CEXPT only defined for non-negative integral exponents."
>
> What seems to be the issue here? Plugging the same integral into 
> WolframAlpha works fine. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Error with simple integral, "CEXPT only defined for non-negative integral exponents."

2017-11-07 Thread William Stein
On Tue, Nov 7, 2017 at 9:06 AM, saad khalid  wrote:
> Hello everyone:
>
> I am currently trying to do this integral in Cocalc:
>
> integral(525.87*(x)^(-2.35),x,.1,1)
>
> It gives me the following error:
> "CEXPT only defined for non-negative integral exponents."
>
> What seems to be the issue here?

Maxima integration, which we still use by default, is very buggy. Use
sympy instead -- this works:

integral(525.87*(x)^(-2.35),x,.1,1, algorithm='sympy')

See

https://cocalc.com/projects/4a5f0542-5873-4eed-a85c-a18c706e8bcd/files/support/2017-11-07-091923-integral.ipynb



>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-support+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-support@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/d/optout.



-- 
William (http://wstein.org)

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.