On Fri, Aug 29, 2008 at 11:46 AM, David Joyner <[EMAIL PROTECTED]> wrote: > > On Fri, Aug 29, 2008 at 3:07 AM, Burcin Erocal <[EMAIL PROTECTED]> wrote: >> >> On Thu, 28 Aug 2008 15:28:03 -0400 >> Tim Lahey <[EMAIL PROTECTED]> wrote: >> >>> Hi, >>> >>> Maple has a really useful feature of inert integrals >>> and derivatives. Basically, the integrals and derivatives >>> show up in the equations, but aren't evaluated until >>> a command to evaluate them is explicitly given. So, >>> you can delay the evaluation until after you've processed >>> the expression to the point where it can be evaluated. >>> >>> This feature comes in very handy during complicated >>> derivations because you can see which terms are integrals >>> or derivatives and manipulate them along side >>> non-integrals/derivatives. >>> >>> Is there a way to do this in Sage? >> >> This is not supported in Sage at the moment, but it is definitely >> planned. It should be fairly simple to implement this using the new >> symbolic function interface from ginac, which allows one to specify >> custom simplify/automatic evaluation functions. >> >> I am not familiar with the maple syntax. Can you give some examples of >> how to use these features so I can play with them without having to dig >> through documentation? > > I agree this would be a very useful feature. Basically, something like > > (1) > sage: integral(x,x,0,1) > 1/2 > sage: Integral(x,x,0,1) > \int_0^1 x\, dx > > (not the upper case I), or maybe > > (2) > sage: A = Integral(x,x,0,1) > sage. latex(A) > \int_0^1 x\, dx > sage: A > Integral(x,x,0,1)
SymPy has this for a long time already and so far noone seems to have complained: In [3]: integrate(sin(x), (x, 0, pi)) Out[3]: 2 In [4]: Integral(sin(x), (x, 0, pi)) Out[4]: π ⌠ ⎮ sin(x) dx ⌡ 0 In [5]: print Integral(sin(x), (x, 0, pi)) Integral(sin(x), (x, 0, pi)) In [6]: Integral(sin(x), (x, 0, pi)).doit() Out[6]: 2 Btw, as usual, I would learn from what Mathematica is doing, because the Hold(...) stuff seams really simple to me. So maybe the evaluate keyword should be used in Python. We use the "evaluate" keyword inconsistently in sympy so far. As to lowercase/uppercase, we just follow python conventions, so Integral is a class, while integrate is a function. Ondrej --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---