Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complicated multiple integral #5741

Open
ness01 opened this issue Aug 18, 2011 · 6 comments
Open

Complicated multiple integral #5741

ness01 opened this issue Aug 18, 2011 · 6 comments

Comments

@ness01
Copy link
Contributor

ness01 commented Aug 18, 2011

Compare issue 5178 .

We would like to do integrate(sin(x*y*z), (x, 0, pi), (y, 0, pi), (z, 0, pi)). In gsoc-3, the followin sequence of steps can be used to evalute this: http://pastebin.com/raw.php?i=c5EUFijf Can someone verify the result (equations 12 and 13)?

Details:

equation (2) is the part integrate can do on its own

equation (4) is because of issue 5740 equation (5) is because we need some expansion, otherwise meijerint does not now how to integrate this. Presumably risch should be able to do without. polar=True has the same effect as force=True here.

equation (10) computes the lower limit. We have to get rid of the piecewise because it upsets gruntz (for reasons I have not investigated), we also have to manually remove the hyper since series expansions are not implemented (I actually made a misstake here since hyper(0) == 1, but it does not matter for the limit).

I don't know if the integral can be expressed in terms of simpler functions.

Original issue for #5741: http://code.google.com/p/sympy/issues/detail?id=2642
Original author: https://code.google.com/u/104531927090589914088/
Referenced issues: #5178, #5740
Original owner: https://code.google.com/u/104531927090589914088/

@asmeurer
Copy link
Member

The symbolic output of WolframAlpha is a little different, but the numerical result is the same.  If your symbolic result is correct, it's actually a little nicer because it doesn't have any unnecessary sqrt(-1) terms http://www.wolframalpha.com/input/?_=1313610224120&i=integrate(sin(x*y*z)%2c+(x%2c+0%2c+pi)%2c+(y%2c+0%2c+pi)%2c+(z%2c+0%2c+pi)).&fp=1&incTime=true limit() should automatically just check the relevant part of a piecewise expression.

Original comment: http://code.google.com/p/sympy/issues/detail?id=2642#c1
Original author: https://code.google.com/u/asmeurer@gmail.com/

@asmeurer
Copy link
Member

By "risch" do you mean the full Risch algorithm or the heuristic Risch algorithm?  For heurisch() it may or may not work without expansion, just like meijerint.  For the full algorithm, it implements a very rigorous algorithm to rewrite logarithms that can be written in terms of each other like this (but to be clear, Ci() is not yet supported in the full algorithm in my branch).

Original comment: http://code.google.com/p/sympy/issues/detail?id=2642#c2
Original author: https://code.google.com/u/asmeurer@gmail.com/

@ness01
Copy link
Contributor Author

ness01 commented Aug 18, 2011

I was referring to full risch.

Since Integral.doit() uses linearity for computing indefinite integrals (I think?), the risch code can do the unexpandled log(x**2) terms, and meijerint can do the Ci(x) term :-).

I didn't know how to enter multiple integrals in alpha, thanks.

Original comment: http://code.google.com/p/sympy/issues/detail?id=2642#c3
Original author: https://code.google.com/u/104531927090589914088/

@asmeurer
Copy link
Member

> Since Integral.doit() uses linearity for computing indefinite integrals

This is going to change, because it's a bad idea.  Compare integrate(log(x)*x**x + x**x, x) with integrate(x**x*(log(x) + 1), x) using heurisch().  Also, see comment 3 of issue 5060 .

But perhaps it would be a good idea to try pulling out stuff that risch_integrate() can't do rather than just failing and passing it on to the next method.  There would have to be a disclaimer that a nonelementary integral result only applies to the term itself, not to the whole expression.  I apparently haven't given enough thought to the overall strategy that integrate() will use when risch_integrate() is merged, especially now that we have this meijerg method.

**Labels:** Integration  

Referenced issues: #5060
Original comment: http://code.google.com/p/sympy/issues/detail?id=2642#c4
Original author: https://code.google.com/u/asmeurer@gmail.com/

@asmeurer
Copy link
Member

And by the way, WolframAlpha accepts basically any reasonable syntax that you use.  It also accepts SymPy syntax 90% of the time, so usually I just use that.

Original comment: http://code.google.com/p/sympy/issues/detail?id=2642#c5
Original author: https://code.google.com/u/asmeurer@gmail.com/

@asmeurer
Copy link
Member

**Status:** Valid  

Original comment: http://code.google.com/p/sympy/issues/detail?id=2642#c6
Original author: https://code.google.com/u/asmeurer@gmail.com/

@ness01 ness01 self-assigned this Mar 7, 2014
@ness01 ness01 removed their assignment Feb 15, 2015
@smichr smichr removed the Valid label Nov 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants