In: Mechanical Engineering
Compute the double integral
Note that the region of integration lies to the right of the line y = x. Use this fact and a MATLAB relational operator to eliminate values for which y > x.
Consider the double integral
A = ∫10∫3yx2(x + y)dxdy
To evaluate the integral, use symbolic conversion of the variables (command is ‘int’) and then convert to real number using ‘double’ command.
Matlab\r\ncode: for Required problem is provided below.
Save this program as ‘Required problem’.
% Compute the double integral
clc; clear;
syms x y
fun = @(x,y)x.^2.*(x+y);
A = int(fun,x,[y,3]);
B = int(A,y,0,1);
C = double(B);
disp(\'Double integration of the above function:\');
disp(C);
The output of the code ‘Required problem’ in the command window is shown below:
Double integration of the above function:
24.6333.
Double integration of the above function:
24.6333.