On Feb 15, 2010, at 11:27 AM, Thomas Scofield wrote:


Can someone point me to examples/documentation on doing double integrals numerically? That is, say you have to calculate a double integral with integrand f(x,y) for which no closed-form antiderivative (neither in x nor y) exists. Assume my xy-region of integration is rectangular. Is there a numerical_integral() type command for this case?


Not that I know of, but you can nest them. For example, to do \int_3^4 \int_1^x sin(x^2/y) dy dx one can do

sage: numerical_integral(lambda x: numerical_integral(sin(x^2/y), 1, x)[0], 3, 4)
    (-0.78059401567023834, 8.6663344908170892e-15)

Note that the [0] on the inner integral causes it to ignore the error term there.

- Robert

--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to