On Aug 18, 2009, at 6:55 PM, Golam Mortuza Hossain wrote:

>
> Hi,
>
> On Tue, Aug 18, 2009 at 9:27 PM, William Stein<[email protected]>  
> 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'

Probably var(repr(var)) is the wrong thing to do here... I have a  
feeling I've seen this code before.

- Robert



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

Reply via email to