Problem evaluating iterated integral in SymPy

Viewed 114

I'm teaching a course in Multivariate Calculus and decided to convert my notes from Sage to Jupyter using SymPy. I have rewritten nearly all my notes as Jupyter Notebooks and am very impressed how I can use multiple cells like Mathematica and I can use MarkDown cells with LaTeX as well as all the great features of matplotlib, NumPy and SymPy.

I'm nearly done converting my sagelets to Python scripts on Colab and found a discrepancy.

This Sage code resolves as pi:

integral(integral(integral(1, z, x^2+y^2, 2-x^2-y^2),
                  y, -sqrt(1-x^2), sqrt(1-x^2)),
         x, -1, 1)

but this this SymPy code resolves as -pi/2:

Integral(1,
         (z, x**2+y**2, 2-x**2-y**2),
         (y, -sqrt(1-x**2), sqrt(1-x**2)),
         (x, -1, 1)
        ).doit()

See #3 in this Jupyter Notebook:

https://colab.research.google.com/drive/1OlT9nfPG8TzoR_WpDavx-SAa07HLg3hV?usp=sharing

Shouldn't these be equal? What am I missing? Any help would be greatly appreciated as I've done A LOT of work on this course using SymPy and would like to use it in class this summer session!

Please help,

A. Jorge Garcia

Applied Math & CS

Nassau Community College

http://shadowfaxrant.blogspot.com

PS: Here's the SageCell version,

https://sagecell.sagemath.org/?z=eJzFk8FuwjAMhu9IvIMFB9qRTk1A07TrtE07cNuuSBkEGlGS4qRA-_RLQ1uQuDCGtlMsx_ns_5fTn-AbsJg-3scPoxg-J89sDB8os1TAu7JiiTw13U6fhvCy5WnOrQCu5v4OMxT2CWRdFpwHlJQkJiwkhTtGIdm7Yxx2OybRu6B3U2jPYbccg0FBykHT4seUdrYK52SzX0xIo-KArZvQo_DbYnsXyz1_e5A5unqe_ZQNiykjLHJR5KIKHJkN2oBWqZCcxFXviJ4a8deNL7XqOvrBzHEIr9JpsYmANTcG9MLHuZIWZvmXcNJ8YiHRWNAzy5WFXSIUYKJBGshQZxqt1IqnYLUvNpuco2hYc2ncq5ljoF77jEa5lKo19j-HaL_i6pKPuLoLareHZWWs39NmPf2yOmO_Adu6eJ4=&lang=sage

0 Answers
Related