"Susanne Pfeifer" <[hidden email]> wrote in message
> I would like to solve a double integral of the form
. . .
> but I would like to use Gauss Quadrature to do it.
> I have written the following code (using R's statmod package) which
> works fine for one integral but it doesn't work for a double one:
Maybe there's some way to use sapply as your code suggests, but I'm not sure
where you defined the $value that is being returned in your inner call:
gauss_legendre(function(x) x*y, 0, 1, nodes, weights)$value
I converted some old IDL code to do this 2D integral but without trying to
use your sapply: