[SciPy-User] Integration of double integral with integration variable as
Thu Jan 14 07:21:04 CST 2010
Your example is easy!
Since sin(y) is an odd function, integrating over [-x,x] gives zero and that's
it. For a more illustrative example, replace sin with cos (still easy enough
to do it quicker analytically). Using scipy.integrate.quad, you do it like
this (excerpt from an idle session):
>>> def g(x):
The reason I take the zero-th element of the quad output is that the remaining
is an estimate of the error.
Maybe you should also look into scipy.integrate.dblquad.
Hope this helps.
On Thursday 14 January 2010 09:23:28 am Torsten Andre wrote:
> Hey everyone,
> I am new to SciPy, but need to integrate something like this, where the
> boundaries of the inner integral are terms of outer variable's
> integration variable:
> Is this feasible in SciPy? I tried using quad but it only complains that
> x is not defined. Unfortunately I was unable to find anything on the
> list or in the documentation.
> Thanks for your time.
> SciPy-User mailing list
More information about the SciPy-User