2D trapezoidal Rule

682 Views Asked by At

I need to integrate over a function such that: $$ \int_{\Omega}^{} f(x,y)dxdy = \int_{-1}^{1}\int_{-1}^{1}f(x(r,s),y(r,s))J(r,s)drds$$

Where $J(r,s)=x_{s} y_{s}-x_s y_r$ ,the Jacobian. How do I generalize this to estimate the integral using 2D trapezoidal rule?

Most general form so I can program this estimate using 2D trapezoidal rule.

1

There are 1 best solutions below

0
On

Just apply the 1D rule to the iterated integrals... In general,

\begin{align*} \int_a^b \int_c^d f(x,y) dy dx \approx & \int_a^b \sum_{i=1}^n w_i f(x, y_i) dx \approx \sum_{j=1}^m \tilde w_j \sum_{i=1}^n w_i f(x_j, y_i)\\ = & \sum_{j=1}^m \sum_{i=1}^n w_i \tilde w_j f(x_j,y_i) \end{align*}

Choosing appropriate coefficients $w_i, \tilde w_j$, you can use arbitrary quadrature rules to each iterated integral.