On Dec 4, 2008, at 3:57 PM, Vijay wrote:


Hi: I am trying to evaluate a double integral (since I cannot put
LaTeX, the 'S' below
stands for the integral sign:)

    1      sqrt(x)
   S      S         4xy - y^3 dy dx
    0      x^3

This is what I put into sage:

sage: var('x,y')
(x, y)
sage: f=4*x*y-y^3
sage: print f
                                              3
                                 4 x y - y

sage: print integrate(integrate(f,y,x^3,x^0.5),y,0,1)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call
last)

/home/vkg/sage-3.1.1/<ipython console> in <module>()

/home/vkg/sage-3.1.1/local/lib/python2.5/site-packages/sage/calculus/
functional.
py in integral(f, *args, **kwds)
   252     """
   253     try:
--> 254         return f.integral(*args, **kwds)
   255     except ValueError, err:
   256         raise err

/home/vkg/sage-3.1.1/local/lib/python2.5/site-packages/sage/calculus/
calculus.py
in integral(self, v, a, b)
  2523                     raise ValueError, "Integral is divergent."
  2524                 else:
-> 2525                     raise TypeError, error
  2526
  2527

TypeError: Computation failed since Maxima requested additional
constraints (use
assume):
Is  x  positive or negative?

Am I doing something wrong here?


This may be a bug in Maxima, because it looks like it can do the indefinite integral. However, any integral that requires feedback from the user during the integration, won't work from Sage. This has caused me problems with my integral test suite.

Also, in integrate(integrate(f,y,x^3,x^0.5),y,0,1)

you're integrating with respect to y twice. You can always try to carry out the indefinite integral and then evaluate at the end points. That appears to
work so I find it interesting that Maxima can't integrate the definite
integral.

Cheers,

Tim.

---
Tim Lahey
PhD Candidate, Systems Design Engineering
University of Waterloo
http://www.linkedin.com/in/timlahey

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to