Hi Everyone,
This is my final project for my numerical methods class and I'm having some trouble with it. It would be great if you can help me :)
I'm trying to use Simpsons 1/3 rule to find the 2d integral of (x^2)+(y^2)dydx with the limits of x from 0,824 to 0.824 and the y limits are g(x)=x^2 to p(x)=cos(x) with 20 intervals in each direction!
This is what I got so far: ( I wasn't too sure if I should start integrating the inner integral (dy) first or the outer (dx))
hx = (0.824+0.824)/20; % steps in x direction
I=G(0.824)+G(0.824);
for i = a+h:2*h:b
I = I + 4*G(i);
end
for j = (a+2*h):2*h:(b2*h)
I = I + 2*G(j);
end
I = h*I/3;
for i=a+h:2*h:b
hy=(p(x(i))g(x(i)))/4;
for j=
II=Fund(x(i),y(j))+Fund(x(i),y(j)) % problem
end
end
for j=g(x(i))+h:2*h:p(x(i))
II=II + 4*Fund((xi),y(j))
end
for
II=I+2*Fund(x(i),y(j)
end
Thanks much in advance!
