Professional Documents
Culture Documents
Department of Mathematics
Assignment-01
Calculus
Limit of a Function
Q1.
(a) Use the graph of the function f to state the value of each limit, if it exists, and verify your results by
finding the limit.
i)
clc
clear all
% find limit
syms x
f(x)=1/(1+exp(1/x))
f(x) =
lhl=limit(f(x),x,0,'left');
rhl=limit(f(x),x,0,'right');
l=limit(f(x),x,0);
if (lhl==rhl==l)
disp('limit exists')
fprintf('lhl=%d,rhl=%d,l=%d',lhl,rhl,l)
else
disp('limit doesn''t exists')
end
% graph
fplot(f(x),'r')
grid on
xlabel('x axis')
ylabel('y axis')
ii)
clc
clear all
syms x
f(x)=(x^2+x)/sqrt(x^3+x^2)
f(x) =
lhl=limit(f(x),x,0,'left');
rhl=limit(f(x),x,0,'right');
l=limit(f(x),x,0);
if (lhl==rhl==l)
disp('limit exists')
fprintf('lhl=%d,rhl=%d,l=%d',lhl,rhl,l)
else
disp('limit doesn''t exists')
end
fplot(f(x),'b')
grid on
xlabel('x axis')
ylabel('y axis')
iii)
clc
clear all
syms x
f(x)=(exp(x^3)-1)/(1-cos(sqrt(x-sin(x))))
f(x) =
lhl=limit(f(x),x,0,'left');
rhl=limit(f(x),x,0,'right');
l=limit(f(x),x,0);
if (lhl==rhl==l)
disp('limit exists')
fprintf('lhl=%d,rhl=%d,l=%d',lhl,rhl,l)
else
disp('limit doesn''t exists')
end
fplot(f(x),'g')
grid on
xlabel('x axis')
ylabel('y axis')
i)
clc
clear all
syms x
f(x)=(sqrt(9*x^2+x)-3*x)
f(x) =
l=limit(f(x),x,inf)
l =
fplot(f(x),'g')
grid on
xlabel('x axis')
ylabel('y axis')
ii)
clc
clear all
syms x a b
f(x)= sqrt(x^2+a*x)-sqrt(x^2+b*x)
f(x) =
l=limit(f(x),x,inf)
l =
iii)
clc
clear all
syms x y
f(x,y)=exp(-1/(x^2+y^2))*((sin(x))^2)/x^2*(1+1/y^2)^(x+4*y^2)
f(x, y) =
l=limit((limit(f,x,1/sqrt(y))),y,inf)
l(x, y) =
Differentiation
Q2.
(a) Find the first and second derivatives of the function and compare the derivatives using graph.
i)
clc
clear all
syms x
f(x)=2*x-5*x^(3/4)
f(x) =
f1(x)=diff(f(x),x,1)
f1(x) =
f2(x)=diff(f(x),x,2)
f2(x) =
figure(10)
fplot(f(x),'r:','LineWidth',2)
hold on; grid on
xlabel('x axis'); ylabel('y axis')
xlim([-5,15]); ylim([-15,15]);
fplot(f1(x),'y')
fplot(f2(x),'b')
legend('f(x)','f''(x)','f"(x)')
ii)
clc
clear all
syms x
f(x)=exp(x)-x^3
f(x) =
f1(x)=diff(f(x),x,1)
f1(x) =
f2(x)=diff(f(x),x,2)
f2(x) =
figure(20)
fplot(f(x),'r:','LineWidth',2)
hold on
grid on
xlabel('x axis'); ylabel('y axis')
xlim([-5,15]); ylim([-15,15]);
fplot(f1(x),'y')
fplot(f2(x),'b')
legend('f(x)','f''(x)','f"(x)')
(b) Find the number c that satisfies the conclusion of the mean value theorem on the given interval.
Graph the function, secant line through the endpoints and the tangent line at (c,f(c)). Are the secant line
and the thagent line parallel?
i)
clc
clear all
close all
syms x h c
f(x)=sqrt(x) % define function
f(x) =
c =
m =
parallel
ii)
clc
clear all
close all
syms x c h
a=1;b=2;
f(x)=x^3+x-4
f(x) =
fplot(f(x),'LineWidth',2)
grid on; hold on; xlabel('x axis'); ylabel('y axis');
k =
secant(x) =
fplot(secant(x),'r','LineWidth',2)
f1(x)=diff(f(x),x,1);
c=solve(k==f1(x),x) % point that satisfies MVT
c =
m =
if m==k % verify
disp('parallel')
else
disp('not parallel')
end
parallel
tangent(x) =
fplot(tangent(x),'b:','LineWidth',2) % plot tangent
(c) Sketch f(x),f'(x) and f''(x) and find interval of increasing or decreasing, local maximum or minimum
and interval of concavity and inflection and also draw them in the same graph.
clc
clear all ; close all
syms x
f(x)=-36*x+3*x^2-2*x^3
f(x) =
f1(x)=diff(f(x),x,1);
f2(x)=diff(f(x),x,2);
fplot(f(x),'r','LineWidth',2)
hold on; grid on; xlabel('x axis');ylabel('y axis');
fplot(f1(x),'b','LineWidth',2)
fplot(f2(x),'g','LineWidth',3)
legend('f(x)','f''(x)','f"(x)')
cp =
f(cp)
ans =
inc =
dec =
f(xmin)
ans
=
f(xmax)
ans
=
ip =
f(ip)
ans =
c_up =
c_down =
plot(cp,f(cp),'ro')
plot(ip,f(ip),'*')
d) Partial derivatives
i)
f(x, y) =
fx(x,y)=diff(f(x,y),x,1)
fx(x, y) =
fy(x,y)=diff(f(x,y),y,1)
fy(x, y) =
ii)
fzyxx=diff(diff(diff(f(x,y,z),z,1),y,1),x,2)
fzyxx =
Integration
3. Sketch the Graph and find the area.
i)
f(x) =
g(x)=x-1 % functions
g(x) =
fplot(f(x),'r',[0,3],'LineWidth',2)
hold on; grid on
fplot(g(x),'g',[0,3],'LineWidth',2)
legend('f(x)','g(x)')
fg(x)=f(x)-g(x) % integrand
fg(x) =
solx =
area=int(fg,solx(1,1),solx(2,1)) % area
area =
ii)
f(x) =
g(x)=1-cos(x) % functions
g(x) =
a=0;b=pi;
fplot(f(x),'r')
hold on; grid on
fplot(g(x),'g')
legend('f(x)','g(x)')
area=abs(int((f(x)-g(x)),a,b))
area =
The End