On Monday, January 18, 2016 at 6:35:59 PM UTC-8, saad khalid wrote: > > Hello everyone: > > I'm trying to compare some functionality in Sage with that of Mathematica. > For my assignment, I have to take this series: > > sum((-1)^n*((x)^(2*n+1))/factorial(2*n+1),n,0,oo) > > > And put it into a mathematical software to see what function it is > equivalent to. In this case, this series is supposed to be equivalent to > the sine function. Indeed, when I put the following code in Mathematica, it > says that it is the Sine function: > Sum((-1)^n*((x)^(2*n+1))/((2*n+1)!),{n,0,Infinity}) > > I was hoping that there would be something similar to this in Sage. I'm > trying to symbolically use the sum function with the following code: > > x = var("x") > n = var("n") > k = var("k") > show(sum(((-1)^n)*((x)^(2*n+1))/factorial(2*n+1),n,0,oo)) > > What it outputs is not the sine function. Instead, it says that it is > equivalent to: > > 1/2*sqrt(2)*sqrt(pi)*sqrt(x)*bessel_J(1/2, x) > > > I don't know why exactly it says this but I was wondering if there was any > way for Sage to do what Mathematica is doing here, in recognizing the > popular series and outputting that when I try to symbolically evaluate this > sum. > > As Dima mentions, the relevant functionality is coming from Maxima in this case. Maxima does have a flag you can set to let it try to expand bessel functions into elementary functions, see http://maxima.sourceforge.net/docs/manual/maxima_15.html#SEC80 It's not directly exposed in sage, but with some obscure code you can activate it:
sage: maxima_calculus("besselexpand:true") true sage: sum(((-1)^n)*((x)^(2*n+1))/factorial(2*n+1),n,0,oo) sin(x) -- 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.