```python
from math import e, pi

```


```python
from sympy import *
```


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

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




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




```python
def triple_integral(a,b,c,d,q,r,n,m,p):

    h = (b-a)/n
    k = (d-c)/m
    l = (r-q)/p

    print(f'h3 = {l}')
    print(f'h2 = {k}')
    print(f'h1 = {h}')

    sumPairK = 0
    sumPairH = 0
    sumPairL = 0
    sumNotPairK = 0
    sumNotPairH = 0
    sumNotPairL = 0

    for i in range(1,(p//2)+1):
        sumNotPairL += f.subs(z,q + (2*i - 1)*l)

    for i in range(1,(p//2)):
        sumPairL += f.subs(z,q + 2*i*l)

    #dz
    g = (l/3)*(f.subs(z,q) + 4*sumNotPairL + 2*sumPairL + f.subs(z,r))

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

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

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

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

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

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

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


```python
triple_integral(0,1,0,1,-x*y,x*y,6,6,6)
```

    h3 = x*y/3
    h2 = 0.16666666666666666
    h1 = 0.16666666666666666
    Respuesta: 1.47759679468811



```python

```

f5b860d7803fcce1c34970a82a367b3069f2345c
ipynb
Jupyter Notebook
integrationTriple.ipynb
HeyChobe/numerical-analysis
cb0fc1719f52564eac6b4896a0afb30b16ac87d7
MIT
2021-07-19T23:49:27.000Z
2021-07-19T23:49:27.000Z
integrationTriple.ipynb
HeyChobe/numerical-analysis
cb0fc1719f52564eac6b4896a0afb30b16ac87d7
MIT
integrationTriple.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