You are on page 1of 10

REG NO: 20MID0116

NAME: KOVVURU VENKATA MRUNALINI REDDY


SLOT: D2
FACULTY: DR. SHIBESH KUMAR JAS PACIF

Question1
Input
Clear
clc
syms x
f(x)=x^2-2*x; % Upper curve
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:
-3/2
Question2
Input
clear
clc
syms y
f(y)=y^3;
g(y)=y^2;
I=[-1,2];
a=I(1); b=I(2);
A=int(f(y)-g(y),a,b);
disp('Area bounded by the curves f(x) and g(x) is:' );
disp(A);
fplot(f(y),[a,b]);grid on;hold on;
fplot(g(y),[a,b]);hold off
xlabel('x-axis');ylabel('y-axis');
legend('x=f(y)','y=g(y)');

Output
Area bounded by the curves f(y) and g(y) is:
3/4
Question3
Input
clc
syms x
f=input('Enter the function f(x)');
c=input('Enter the axis of rotation y = c (enter only c value): ');
iL=input('Enter the integration limits: ');
a=iL(1);b=iL(2);
vol=pi*int((f-c)^2,a,b);
disp(['Volume of solid of revolution is: ',char(vol)]);
x1=linspace(a,b,20); y1=subs(f,x,x1);
x2=x1; y2=c*ones(length(x1));
plot(x1,y1);hold on;
plot(x2,y2);hold off;
xlabel('x-axis');ylabel('y-axis')
legend('The curve y=f(x)','The axis of revolution y=c');
grid on;
Output
Enter the function f(x)
4/((x^2)+4)
Enter the axis of rotation y = c (enter only c value):
0
Enter the integration limits:
[0,2]
Volume of solid of revolution is: pi*(pi/4 + 1/2)
Question4(1)
Input
clear all
clc
syms t7
f=input('enter the function of t:');
F=laplace(f);
disp(['L{',char(f),'}=',char(F)]);
ouput
enter the function of t:
1+2*((t^(1/2))+3*((t^(1/2))^-1))
L{6/t^(1/2) + 2*t^(1/2) + 1}=1/s + (6*pi^(1/2))/s^(1/2) + pi^(1/2)/s^(3/2)
Question4(2)
Input
clear all
clc
syms t
f=input('enter the function of t: ');
F=laplace(f);
disp(['L{',char(f),'}=',char(F)]);
Ouptut
enter the function of t:
sin(t)*(heaviside(t)-heaviside(t-pi))
L{sin(t)*(heaviside(t) - heaviside(t - pi))}=(exp(s*pi) + 1)/(exp(s*pi) +
s^2*exp(s*pi))
Question4(3)
Input
clear all
clc
syms t
f=input('enter the function of t:');
F=laplace(f);
disp(['L{',char(f),'}=',char(F)]);
Output
enter the function of t:
(sin(t))^3
L{sin(t)^3}=6/((s^2 + 1)*(s^2 + 9))
Question4(4)
input
clear all
clc
syms t
f=input('enter the function of t:');
F=laplace(f);
disp(['L{',char(f),'}=',char(F)]);
enter the function of t:
Ouput
(sin(2*t))*(sin(3*t))
L{sin(2*t)*sin(3*t)}=s/(2*(s^2 + 1)) - s/(2*(s^2 + 25))
Question4(5)
Input
clear all
clc
syms t
f=input('enter the function of t: ');
F=laplace(f);
disp(['L{',char(f),'}=',char(F)]);
Output
enter the function of t:
exp(-t) *sin(t) *sin(t)
L{exp(-t)*sin(t)^2}=1/(2*(s + 1)) - (s + 1)/(2*((s + 1)^2 + 4))
Question(4(6))
Input
clear all
clc
syms t
f=input('enter the function of t: ');
F=laplace(f);
disp(['L{',char(f),'}=',char(F)]);
Output
enter the function of t:
((cos(2*t))-(cos(3*t)))*(t^(-1))
L{(cos(2*t) - cos(3*t))/t}=log(9/s^2 + 1)/2 - log(4/s^2 + 1)/2
Question5(1)
Input
syms s a
f=ilaplace(6/((s*s)+(s*2)+8))
Output
f=
(6*7^(1/2)*exp(-t)*sin(7^(1/2)*t))/7

Question5(2)
Input
syms s a
f=ilaplace(4*s+5)*((s-1)^-2)*((s+2)^-1)
Output
f=
(5*dirac(t) + 4*dirac(1, t))/((s - 1)^2*(s + 2))

Question5(3)
Input
syms s a
f=ilaplace(s^2+2*s-4)*((s^2+2*s+5)^-1)*((s^2+2*s+2)^-1)
Output
f=
(2*dirac(1, t) - 4*dirac(t) + dirac(2, t))/((s^2 + 2*s + 2)*(s^2 + 2*s + 5))

You might also like