On Tue, Aug 18, 2009 at 3:51 AM, Golam Mortuza
Hossain<[email protected]> wrote:
>
> Hi,
>
> While testing new integral SFunction class for Sage,
> I encountered this weird bug.
>
> ----------
> 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.


>
> It appears to be a Maxima bug
> ----------
> (%i10) integrate(f(x), x^2);
>                                     2
> (%o10)                              x  f(x)
> ----------
>
> However, even "integral" of calculus.py seems to do crazy thing as well.
> In line 566, it does
>
> elif not is_SymbolicVariable(v):
>        v = var(repr(v))
>
> Above imply
>
> --------
> sage: v = var(repr(x^2))
> sage: v
> x^2
> sage: v.diff(x)
> 0
> -------
>
> The next commented out line in calculus.py seems to be the right
> thing do here!!
>
> Cheers,
> Golam
>
> >
>



-- 
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org

--~--~---------~--~----~------------~-------~--~----~
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