1

Use Simpsons Double Integral with $n=m=4$ to approxiate the double integer compare results to exact answer.

$$\int^{2.5}_{2.1}\int^{1.4}_{1.2} xy^2 \, \,dy dx$$


From the algorithm of Composite Simpsons Rule

the solution manual the answer is $.3115733$ . I may have not implemented the algorithm correctly does anyone know at which step I made a mistake?

EDIT

According to Simpsons Double Integral:

$$S_{mn}= \frac{2.5-2.1 \cdot1.4-1.2}{9 \cdot 4\cdot 4} \cdot\sum_{i,j=0,0}^{4,4} W_{1,1} f(x_0,y_0) $$

$$S_{4,4}= 5.56_E-4\cdot\sum_{i,j=0,0}^{4,4} [\int^{1.4}_{1.2} (2.1)y^2\,dy+16\int^{1.4}_{1.2} (2.2)y^2dy+4\int^{1.4}_{1.2} (2.3)y^2\,dy+4\int^{1.4}_{1.2} (2.4)y^2\,dy]$$

Perhaps like this?

Jon
  • 1,916

1 Answers1

4

I think you have not used the condition that $\color{blue}{n=m=4}$.

Simpson's Rule for double integrals: $$\int_a^b\int_c^df(x,y) dx dy$$ is given by $$S_{mn}=\frac{(b-a)(d-c)}{9mn} \sum_{i,j=0,0}^{m,n} W_{i,j} f(x_i,y_j) $$ where: $$W= \begin{bmatrix} 1&4&2&4& \ldots &4&1\\ 4&16&8&16&\ldots&16&4\\ 2&8&4&8&\ldots&8&2\\ \ldots&\ldots&\ldots&\ldots&\ldots&\ldots&\ldots&\\ 1&4&2&4&\ldots&4&1\\ \end{bmatrix}$$

Credit: Another post on stack exchange

Remark:

Also notice that $$\int_{2.1}^{2.5} \int_{1.2}^{1.4} xy^2\,\, dy dx=\left( \int_{1.2}^{1.4} y^2\, dy\right)\left(\int_{2.1}^{2.5} x\, dx \right) $$

Edit:

I have implemented the Simpson rule computation for this question in Python.

Edit $2$:

Let the $0$-index vector $v=[1,4,2,4,1]$. Notice that we have $W_{i,j}=v_iv_j$.

By Simpson's rule, \begin{align}\int_{2.1}^{2.5} \int_{1.2}^{1.4} xy^2\,\, dx dy &\approx \frac{(2.5-2.1)(1.4-1.2)}{9mn}\sum_{i=0}^m \sum_{j=0}^n W_{i,j}f(x_i,y_j) \\ &=\frac{0.08}{144} \sum_{i=0}^4 \sum_{j=0}^4 v_iv_j x_iy_j^2 \\ &=\frac{1}{1800} \left(\sum_{i=0}^4 v_ix_i \right) \left(\sum_{j=0}^4v_jy_j^2 \right) \end{align}

We have

\begin{align} \sum_{i=0}^4 v_i x_i = (1)(2.1)+(4)(2.2)+(2)(2.3)+(4)(2.4)+(1)(2.5)= 27.6 \end{align}

and

\begin{align} \sum_{j=0}^4 v_j y_j^2 = (1)(1.2^2)+(4)(1.25^2)+(2)(1.3^2)+(4)(1.35^2)+(1)(1.4^2)= 20.32 \end{align}

Hence

$$\int_{2.1}^{2.5} \int_{1.2}^{1.4} xy^2\,\, dx dy \approx \frac{(27.6)(20.32)}{1800} \approx 0.3115733$$

Siong Thye Goh
  • 153,832