Robert Dodier wrote:
> On Feb 2, 9:16 pm, kcrisman <kcris...@gmail.com> wrote:
> 
>> sage: integrate(sin(x),[x],[var('y')]) # double integral, x first
>> sage: integrate(sin(x),[x,0,pi],[y]) # one definite, one indefinite
>> sage: integrate(sin(x),(x,),(x,)) # double integral, using tuples
>> instead of lists if you like parentheses
>> sage: integrate(sin(x),(x,),(var('y'),),(var('z'),)) # or more
>> integrals
> 
> Since the Sage project does not have the burden of history
> (relatively speaking) I think you guys should go nuts and try
> to do it "right".
> 
> I'll leave it to you to decide what's right but to me it means
> trying to directly represent general integrals, so the syntax is:
> integrate(F, R) or integrate(F, R, mu) where F is a function,
> R is a region, and mu is an optional measure.

Wow, you've really opened up possibilities here.  This is a very 
intriguing idea.

We can define a function so that it knows what the variables and 
constants are, i.e.,

sage: var('y')
sage: f(x) = sin(x)*y

So integrating this function should be okay with the below

sage: integrate(f, [0, pi])

In fact, the following general form

sage: integrate(expression, (x, a, b), (y, c, d))

could be a shortcut for

sage: integrate((x,y) |--> expression, set( (x,y) s.t. a<=x<=b and c<=y<=d))

and we would still have the familiar syntax while supporting much more 
powerful statements. (Note that I use Sage functions instead of Python 
lambda functions, so they can be sped up using fast_float easily).

Robert, please keep contributing to the conversation.  You've obviously 
thought a lot more about this than we have.  I'd like to hear you 
elaborate on this if you have time.

Jason


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to