MATLAB: Using simpson 1/3 rule for double integration I want to give first only y limit then after getting this integration I want to give x limit f(x,y)=sin​(x)(A1sinh​(y)+B1sinh​(b-y))+ C1sin(x)*s​inh(b-y)+D​1sin(x)*si​nh(y)+E1si​nh(Lx)* sin(y)+sinh(x)*s

numerical integration

is there a method in simpson 1/3 rule for double integration that first i give only y limit after getting this integration i give x limit and function has both x and y variable in multiplication so i cant use simpson 1/3 rule for single integration i am using a simpson 1/3 rule for double integration the code but in this code i have to give x and y limit both at a same time the code is
syms x y;
f = inline(f(x,y));
c = inline('1');
d = inline('2');
a =0;
b = x;
m = 4;
n = 4;
hx = (b-a)/n;
An = 0;
Ae = 0;
Ao = 0;
for i = 0:n
x = a + i*hx;
ya = c(x);
yb = d(x);
hy = (d(x) - c(x))/m;
Bn = f(x,ya) + f(x,yb);
Be = 0;
Bo = 0;
for j = 1:m-1
y = ya + j*hy;
z = f(x,y);
if rem(j,2)==0
Be = Be + z;
else
Bo = Bo + z;
end
end
A1 = (Bn + 4*Bo + 2*Be)*hy/3;
if i == 0 | i == n
An = An + A1;
else
if rem(i,2)==0
Ae = Ae + A1;
else
Ao = Ao + A1;
end
end
end
Dint = (An + 4*Ao + 2*Ae)*hx/3;
end

Best Answer

Write down the Simpson-rule approximation for
integral_{y=c}^{y=d) exp(f(x,y)) dy .
This will be a finite sum including the variable x. Call it sum(x).
Thus under the first integral you have an expression of the form 1/sum(x) to integrate over [a:b].
Now apply Simpson's rule again in x-direction.
Best wishes
Torsten.