Calculus Lab 2
Calculus Lab 2
i) Critical Points:
Initialization:
syms x real
f= input('Enter the function f(x):');
fx= diff(f,x)
c = solve(fx)
cmin = min(double(c));
cmax = max(double(c));
ezplot(f,[cmin-2,cmax+2])
hold on
for i = 1:1:size(c)
T1 = subs(fxx, x ,c(i) );
if (double(T1)==0)
if (double(T1) < 0)
else
end
end
end
h=ezplot(fx,[cmin-2,cmax+2])
set(h,'color','r')
hold on
pause
e=ezplot(fxx,[cmin-4,cmax+4])
set(e,'color','g')
hold off
Practice Problems:
1. An open-top box is to be made by cutting small congruent squares from
the comers of a 12-in.-by-12-in. sheet of tin and bending up the sides.
How large should the squares cut from the corners be to make the box
hold as much as possible?
.
2. A rectangle is to be inscribed in a semicircle of radius 2. What is the
largest area the rectangle can have, and what are its dimensions?
syms x
z=int(f,a,b)