4.19 Numerically integrate f(x,y) in 2D
Problem: Integrate
\[ \int _{7}^{10}\int _{11}^{14}\left ( x^{2}+4y\right ) dxdy \]
The exact answer is 1719
| Mathematica
f[x_,y_] := x^2+4 y
r = Integrate[f[x,y],{x,11,14},{y,7,10}]
|
Out[69]= 1719
|
| Matlab
clear all;
format long
f=@(x,y) x.^2+4*y;
integral2(f,11,14,7,10)
|
ans =
1.719000000000004e+03
|