2.7 KB · commit a9602da
Formulae for the evaluation of a double integral can be obtained by repeatedly applying the trapezoidal and Simpson's rules derived in Sections 6.4.1 and 6.4.2. We consider, as an example, the double integral defined by
I=∫yjyj+1∫xixi+1f(x,y)dxdy,(6.93)
where
xi+1=xi+handyj+1=yj+k.
By the repeated 'application of trapezoidal rule' to Eq. (6.93), we get
I=2h∫yjyj+1[f(xi,y)+f(xi+1,y)]dy=4hk[f(xi,yj)+f(xi+1,yj)+f(xi,yj+1)+f(xi+1,yj+1)]=4hk[fi,j+fi+1,j+fi,j+1+fi+1,j+1],(6.94)where fi,j=f(xi,yj), etc.
Similarly, applying Simpson's rule to the integral
I=∫yj−1yj+1∫xi−1xi+1f(x,y)dxdy,(6.95)
we obtain
I=3h∫yj−1yj+1[f(xi−1,y)+4f(xi,y)+f(xi+1,y)]dy=9hk[f(xi−1,yj−1)+4f(xi−1,yj)+f(xi−1,yj+1)+4{f(xi,yj−1)+4f(xi,yj)+f(xi,yj+1)}+f(xi+1,yj−1)+4f(xi+1,yj)+f(xi+1,yj+1)]=9hk[fi−1,j−1+fi−1,j+1+fi+1,j−1+fi+1,j+1+4(fi−1,j+fi,j−1+fi,j+1+fi+1,j)+16fi,j].(6.96)A numerical example is given here.