> If anything, we've probably been too cavalier with our use of Maxima's
> fine-grained simplification and other routines at times; it seems
> dangerous to go the other way.
>
> At the same time, we have
>
> sage: integrate(x^n,x,algorithm='sympy')
> x^(n + 1)/(n + 1)
OK, this is a lot more usable, thanks.
I understand the fundamental problem here in that the answer given by
sympy is "wrong" for certain values in the exponent, but at the end of
the day I just want to use sage to take the hardship out of
calculating particular integrals--in fact at times simply to confirm
results obtained by hand.
What I actually wanted in the above was the integral from 0 to a,
which sympy does give (albiet with a slight problem)
sage: var('r a m')
sage: integrate((1/r^(2*m+2)*(2*(r/a)^2-(r/a)^4)).expand(),r,
0,a,algorithm='sympy')
a^(-2*m - 1)/(2*m - 3) - 2*a^(-2*m - 1)/(2*m - 1) + 2*0^(-2*m + 1)/
((2*m
- 1)*a^2) - 0^(-2*m + 3)/((2*m - 3)*a^4)
Notice the 0's. You can get rid of these with a simple expand
sage: var('n')
sage: integrate(x^n,x,algorithm='sympy')
sage: var('r a m')
sage: integrate((1/r^(2*m+2)*(2*(r/a)^2-(r/a)^4)).expand(),r,
0,a,algorithm='sympy').expand()
a^(-2*m)/((2*m - 3)*a) - 2*a^(-2*m)/((2*m - 1)*a)
Which is exactly what I wanted. One liner, no assumptions. It's worth
mentioning that I am aware of the potential pitfalls in the exponents
here, but in my particular problem, m>=0 so they do not arise.
By the way, sympy seems to be a lot faster than maxima. Is there any
reason why it cannot be used as the default symbolic integrator in
practice?
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org