exp2.pdf - Department of Mathematics School of Advanced...

• 16

This preview shows page 1 - 6 out of 16 pages.

Department of Mathematics School of Advanced Sciences MAT 1011 Calculus for Engineers (MATLAB) EXPERIMENT 2 DA on MATLAB Programming PROGRAMS ON APPLICATION OF INTEGRATION, LAPLACE TRANSFORM AND INVERSE LAPLACE TRASFORM AAYUSH GUPTA 20BMA0045
EXPERIMENT 2A: Example 1: The area bounded by the curves y = 2 x^2 and the line y - x, from x = -1to 2. Matlab Code: clear clc syms x f(x)=2-x^2; g(x)=-x; I=[-1,2]; a=I(1); b=I(2); A=int(f(x)-g(x),a,b); disp( 'Area bounded by the curves f(x) and g(x) is :' ); disp(A); fplot(f(x),[a,b]); grid on ; hold on ; fplot(g(x),[a,b]); hold off ; xlabel( 'x-axis' ); ylabel( 'y-axis' ); legend( 'y=f(x)' , 'y=g(x)' ); OUTPUT: Area bounded by the curves f(x) and g(x) is : 9/2
Example 2: The volume of the solid generated by the revolving the curve y x^(1/2) about the line y=1 from x=1 to x=4. Matlab Code: clear all clc syms x f(x)=sqrt(x); yr=1; I=[1,4]; a=I(1); b=I(2); vol=pi*int((f(x)-yr)^2,a,b); disp( 'Volume of solid of revolution is :' ); disp(vol); fx=matlabFunction(f); xv=linspace(a,b,101); [X,Y,Z]=cylinder(fx(xv)-yr); Z=a+Z.*(b-a); surf(Z,Y+yr,X) hold on ; plot([a b],[yr yr], '-r' , 'LineWidth' ,2); view(22,11); xlabel( 'X-axis' ); ylabel( 'Y-axis' ); zlabel( 'Z-axis' ); Output: Volume of solid of revolution is : (7*pi)/6
Q.1: Find the area of the region bounded by the curve y = x^2 2*x and the line y x. Matlab Code: x ; ;
3 Area between the curves f and g is
Q.2: To find the area of the region bounded by the curves y^2=x , y = x-2 in the first quadrant.
• • • 