On Feb 4, 4:31 am, P Purkayastha <ppu...@gmail.com> wrote: > On Saturday, February 4, 2012 6:10:07 AM UTC+8, Andrey Novoseltsev wrote: > > > Hello, > > > It is a known bug? Or maybe not considered a bug at all? Quick search > > does not show anything related... > > > sage: f(x) = x > > sage: f > > x |--> x > > sage: integral(f, x) > > x |--> 1/2*x^2 > > sage: integral(f, x, 0, 1) > > x |--> 1/2 > > > The last line shows 1/2 as a function of x, but it is not a function > > anymore, it is a number. It gets worse with multivariate functions: > > > sage: f(x, y) = x + y > > sage: f > > (x, y) |--> x + y > > sage: integral(f, x, 0, 1) > > (x, y) |--> y + 1/2 > > sage: _(3) > > y + 1/2 > > > I think that here integral definitely should return a function of y > > only and if I evaluate it at 3 I get 3.5. > > > Best regards, > > Andrey > > I believe this is more or less consistent behavior throughout Sage. For > example: > > sage: derivative(x, x) > 1 > sage: type(derivative(x, x)) > <type 'sage.symbolic.expression.Expression'>
Derivative of a function depending on x is another function depending on x. If it happens to be a constant or some expression with parameters not depending on x explicitly - it is a coincidence. Same for indefinite integrals. But in definite integrals the variable of integration is a dummy one and does not exist out of the integral! -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org