############################## Mini project: Analysis of a function f(x)=x/(x+1)-cos(40/x) with many characteristic features#Step 1 (manual)#Domain= # Complete the line# lim_(x->infinity)=0 lim_(x->-infinity)=0
#Step 2:Plot the functionf(x)=x/(x+1)-cos(40/x)p=plot(f(x),-4,10,ymin=-10,ymax=10);p.show(figsize=[5,4])
#Step 3. Find the smallest negative and the largest positive x-intercepts for this function. (Note that the large intercept is REALLY large)#the smallest negativep=plot(f(x),-0.5,-0.4);p.show(figsize=[5,4])
find_root(f(x),-0.48,-0.47)
-0.4740729100063728
#THE largest positivep=plot(f(x),800.7,800.9);p.show(figsize=[5,4])
find_root(f(x),100,1000)
800.8324463325995
#Step 4 (read Lecture 4, answer the question on Step 4)# No, we cannot due to the fact that there are numerous solutions.
#Step 5. Find the largest local minimum on the interval (-infinity,-1).deriv_plot=plot(derivative(f(x),x),-1.35,-1);deriv_plot.show(figsize=[5,4],ymin=-25,ymax=55)print"Largest Local Minimum"find_root(derivative(f(x),x),-1.35,-1)