Numerical Integration using Gauss Quadrature

546 Views Asked by At

I have the following problem: [1]: https://i.stack.imgur.com/xhFmI.png

It want us to integrate it using 4-point gauss quadrature and the Relevant error should become 0% compared to its Exact value of integration using Excel or spreadsheet

Our prof teach us only how to do it on Single Integral

Somebody here know how to do it on Double Integral?

I also want it on manual solving to understand

2

There are 2 best solutions below

0
On

The four points Gauss rule has degree 7... So, if you compute the iterated integrals using this rule, you must get the exact value of the double integral. Keep in mind that you must adapt the integration points and weights when integrating in intervals other than [-1,1]. \begin{align*} \int_0^2 \int_0^3 f(x,y) dy dx =& \int_0^2 \left(\int_0^3 f(x,y) dy\right)dx\approx \int_0^2\sum_{i=1}^4 \omega_i f(x,y_i) dx \\ \approx &\sum_{j=1}^4 \tilde \omega_j \sum_{i=1}^4 \omega_i f(x_j, y_i) = \sum_{i,j = 1}^4 \tilde \omega_{j} \omega_i f(x_j, y_i) \end{align*}


$$ \int_a^b g(x)\, dx = \frac{b-a}{2}\int_{-1}^1 f\left(\frac{b-a}{2} t + \frac{a+b}{2} \right)\, dt $$

So, if $u_i, \xi_i$ are the points and weights for the four point gauss rule in the interval [-1,1], you have that $$ \int_a^b g(u) du \approx \sum_{i=1}^4 \frac{(b-a)\xi_i}{2} f\left(\frac{b-a}{2} \cdot u_i + \frac{a+b}{2}\right) $$

0
On

$$ \begin{aligned} \int_0^2\int_0^3f(x, y)dxdy &= \left| \begin{aligned} x &= u + 1\text{ }(u \in [-1, 1]) \\ y &= \frac{3}{2}v + \frac{3}{2} \\ dxdy &= \frac{3}{2}dudv \end{aligned} \right| = \\ &= \int_{-1}^1\int_{-1}^1\underbrace{f\left(u + 1, \frac{3}{2}v + \frac{3}{2}\right)}_{g(u, v)}dudv = \\ &= \int_{-1}^1\int_{-1}^1g(u, v)dudv = \\ &= \sum_{j=1}^4{\omega_j\left(\sum_{i=1}^4\omega_ig(t_i, t_j)\right)} = \boldsymbol{\omega}'\mathbf{G}\boldsymbol{\omega}, \end{aligned} $$

where $t_1, t_2, t_3, t_4$ are nodes, and $\omega_1, \omega_2, \omega_3, \omega_4$ are weights. $$ \begin{aligned} \boldsymbol{\omega}&=\pmatrix{\omega_1 \\ \omega_2 \\ \omega_3 \\ \omega_4} \\ \mathbf{G} &= \pmatrix{ g(t_1, t_1) & g(t_1, t_2) & g(t_1, t_3) & g(t_1, t_4) \\ g(t_2, t_1) & g(t_2, t_2) & g(t_2, t_3) & g(t_2, t_4) \\ g(t_3, t_1) & g(t_3, t_3) & g(t_2, t_3) & g(t_3, t_4) \\ g(t_4, t_1) & g(t_4, t_4) & g(t_2, t_3) & g(t_4, t_4) \\ } = \\ &= \pmatrix{ f\left(t_1+1, \frac{3}{2}(t_1+1)\right) & f\left(t_1+1, \frac{3}{2}(t_2+1)\right) & f\left(t_1+1, \frac{3}{2}(t_3+1)\right) & f\left(t_1+1, \frac{3}{2}(t_4+1)\right) \\ f\left(t_2+1, \frac{3}{2}(t_1+1)\right) & f\left(t_2+1, \frac{3}{2}(t_2+1)\right) & f\left(t_2+1, \frac{3}{2}(t_3+1)\right) & f\left(t_2+1, \frac{3}{2}(t_4+1)\right) \\ f\left(t_3+1, \frac{3}{2}(t_1+1)\right) & f\left(t_3+1, \frac{3}{2}(t_2+1)\right) & f\left(t_3+1, \frac{3}{2}(t_3+1)\right) & f\left(t_3+1, \frac{3}{2}(t_4+1)\right) \\ f\left(t_4+1, \frac{3}{2}(t_1+1)\right) & f\left(t_4+1, \frac{3}{2}(t_2+1)\right) & f\left(t_4+1, \frac{3}{2}(t_3+1)\right) & f\left(t_3+1, \frac{3}{2}(t_4+1)\right) \\ } \end{aligned} $$