DA2.pdf - ASSIGNMENT-2A Write a program to find the area...

This preview shows page 1 - 4 out of 4 pages.

ASSIGNMENT-2A: Write a program to find the area bounded by the curves y=2- x 2 and y = -x from x=-1 to 2. Coding: clear all clc syms x f=input( 'Enter the upper curve f(x): ' ); g=input( 'Enter the lower curve g(x): ' ); a=input( 'Enter the lower limit of integration: ' ); b=input( 'Enter the upper limit of integration: ' ); disp( 'Area bounded by the curves f(x) and g(x) is: ' ) Area=int(f-g,x,a,b) ezplot(f) hold on ; ezplot(g) xlabel( 'x-axis' ); ylabel( 'y-axis' ); legend( 'f(x)' , 'g(x)' ); title( 'AREA BOUNDED BY TWO CURVES' ) grid on ; OutPut: Enter the upper curve f(x): 2-x^2 Enter the lower curve g(x): -x
Enter the lower limit of integration: -1 Enter the upper limit of integration: 2 Area bounded by the curves f(x) and g(x) is: Area =9/2 ASSIGNMENT-2B: Write a program to find the volume of the solid generated by revolving the curve x 2 + y 2 = 4 about the x-axis CODING: clc clear all -6 -4 -2 0 2 4 6 -6 -4 -2 0 2 4 6 x-axis AREA BOUNDED BY TWO CURVES y-axis f(x) g(x)
syms x f=input(

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture