```python
from math import e, pi
```


```python
from sympy import *
```


```python
x = Symbol('x')
y = Symbol('y')

f = e**(x**2 + y**2)
f
```




$\displaystyle 2.71828182845905^{x^{2} + y^{2}}$




```python
def double_integral(a,b,c,d,n,m):

    h = (b-a)/n
    k = (d-c)/m

    print(f'h = {h}')
    print(f'k = {k}')

    sumPairK = 0
    sumPairH = 0
    sumNotPairK = 0
    sumNotPairH = 0

    for i in range(1,(m//2)+1):
        sumNotPairK += f.subs(y,c + (2*i - 1)*k)

    for i in range(1,(m//2)):
        sumPairK += f.subs(y,c + 2*i*k)

    g = (k/3)*(f.subs(y,c) + 4*sumNotPairK + 2*sumPairK + f.subs(y,d))

    for i in range(1,(n//2)+1):
        sumNotPairH += g.subs(x, a + (2*i - 1)*h)

    for i in range(1,(n//2)):
        sumPairH += g.subs(x,a + 2*i*h)

    I = (h/3)*(g.subs(x,a) + 4*sumNotPairH + 2*sumPairH + g.subs(x,b))

    print(f'Respuesta: {I.evalf()}')
```


```python
double_integral(0,1,0,x,6,6)
```

    h = 0.16666666666666666
    k = x/6
    Respuesta: 1.07103908086675


512f90ff996319bcfe06f17159873844272922c6
ipynb
Jupyter Notebook
integrationDouble.ipynb
HeyChobe/numerical-analysis
cb0fc1719f52564eac6b4896a0afb30b16ac87d7
MIT
2021-07-19T23:49:27.000Z
2021-07-19T23:49:27.000Z
integrationDouble.ipynb
HeyChobe/numerical-analysis
cb0fc1719f52564eac6b4896a0afb30b16ac87d7
MIT
integrationDouble.ipynb
HeyChobe/numerical-analysis
cb0fc1719f52564eac6b4896a0afb30b16ac87d7
MIT
2021-07-20T03:17:54.000Z
2021-07-20T03:17:54.000Z
Qwen/Qwen-72B
1. YES
2. YES