On Saturday, September 15, 2012 12:53:34 AM UTC-4, Renan Birck Pinheiro 
wrote:
>
> The command sum( ((-1)^k*(x^(2*k+1))/factorial(2*k+1)),k,0,oo) should give 
> sin(x) - it does in Mathematica. But in Sage it gives 
>
> 1/2*sqrt(pi)*sqrt(2)*sqrt(x)*bessel_j(1/2, x) 
>
> which can't be evaluated numerically: 
>
> _(x=3).N()                       
>

Nice catch!  Note that Sage has 

bessel_[tab]

giving 

bessel_I  bessel_J  bessel_K  bessel_Y  

and not the lowercase version you have.  Apparently we are not converting 
the Maxima bessel J function to a "Sage-native" version.  I believe 
that http://trac.sagemath.org/sage_trac/ticket/4102 would fix this, once 
completed.  Unfortunately, even typing "bessel_J(1/2,x)" yields an error 
right now.

What you could conceivably do (in addition to achrzesz's great answer) if 
you just needed numeric values is something along the lines of 

sage: def f(x):
....:     return 1/2*sqrt(pi)*sqrt(2)*sqrt(x)*bessel_J(1/2, x)
....: 
sage: f
<function f at 0x117a268c0>
sage: f(3)
0.0325040914386879*sqrt(pi)*sqrt(2)*sqrt(3)
sage: f(3).n()
0.141120008059867

but of course that is a few extra lines of code and might not fit in your 
symbolic framework.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
Visit this group at http://groups.google.com/group/sage-support?hl=en.


Reply via email to