Hi, On Tue, Aug 18, 2009 at 9:27 PM, William Stein<wst...@gmail.com> wrote: > >> ---------- >> sage: f(x) = function('f',x) >> >> sage: f(x).integral(x) >> integrate(f(x), x) >> >> sage: f(x).integral(x^2) >> x^2*f(x) >> ----------- > > Indeed, what does that mean? If forced to, I would interpret this as > > int f(x) d(x^2) = int f(x) 2 x dx > = 2x integrate(f(x),x) > > So I think the Sage/Maxima answer of x^2*f(x) is bizarre. > > Matheamatica just considers this input to be invalid: > > sage: mathematica.eval('Integrate[f[x],x^2]') > > 2 > Integrate::ilim: Invalid integration variable or limit(s) in x . > > 2 > Integrate[f[x], x ] > > Unless you can give a explanation of what you want integrating wrt x^2 > to mean, I think we should also raise an error in Sage.
I tried that input out of curiosity during testing. I was expecting a TypeError but instead I got an answer !! I agree, we should raise an error. Ironically, in "calculus.py" the raise error line (556) has been commented out for some reason. ----------- elif not is_SymbolicVariable(v): v = var(repr(v)) #raise TypeError, 'must integrate with respect to a variable' --------- Cheers, Golam --~--~---------~--~----~------------~-------~--~----~ 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 URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---