8一元函数微分学实验1一元函数的图形(基础实验)实验目的通过图形加深对函数及其性质的认识与理解,掌握运用函数的图形来观察和分析函数的有关特性与变化趋势的方法,建立数形结合的思想;掌握用Matlab作平面曲线图性的方法与技巧.初等函数的图形2作出函数xytan和xycot的图形观察其周期性和变化趋势.解:程序代码:x=linspace(0,2*pi,600);t=sin(x)./(cos(x)+eps);plot(x,t);title('tan(x)');axis([0,2*pi,-50,50]);图象:0123456-50-40-30-20-1001020304050tan(x)程序代码:x=linspace(0,2*pi,100);ct=cos(x)./(sin(x)+eps);plot(x,ct);title('cot(x)');axis([0,2*pi,-50,50]);图象:0123456-50-40-30-20-1001020304050cot(x)94在区间]1,1[画出函数xy1sin的图形.解:程序代码:x=linspace(-1,1,10000);y=sin(1./x);plot(x,y);axis([-1,1,-2,2])图象:-1-0.8-0.6-0.4-0.200.20.40.60.81-2-1.5-1-0.500.511.52二维参数方程作图6画出参数方程tttytttx3cossin)(5coscos)(的图形:解:程序代码:t=linspace(0,2*pi,100);plot(cos(t).*cos(5*t),sin(t).*cos(3*t));图象:-1-0.8-0.6-0.4-0.200.20.40.60.81-1-0.8-0.6-0.4-0.200.20.40.60.8110极坐标方程作图8作出极坐标方程为10/ter的对数螺线的图形.解:程序代码:t=0:0.01:2*pi;r=exp(t/10);polar(log(t+eps),log(r+eps));图象:0.20.40.60.83021060240902701203001503301800分段函数作图10作出符号函数xysgn的图形.解:1,0()0,01,0xfxxx程序代码:x=linspace(-100,100,10000);y=sign(x);plot(x,y);axis([-100100-22]);-10-8-6-4-20246810-2-1.5-1-0.500.511.5211函数性质的研究12研究函数)3(log3)(35xexxfx在区间]2,2[上图形的特征.解:程序代码:x=linspace(-2,2,10000);y=x.^5+3*exp(x)+log(3-x)/log(3);plot(x,y);图象:-2-1.5-1-0.500.511.52-40-30-20-100102030405060实验2极限与连续(基础实验)实验目的通过计算与作图,从直观上揭示极限的本质,加深对极限概念的理解.掌握用Matlab画散点图,以及计算极限的方法.深入理解函数连续的概念,熟悉几种间断点的图形特征,理解闭区间上连续函数的几个重要性质.作散点图14分别画出坐标为)10,,2,1(),4,(),,(3222iiiiii的散点图,并画出折线图.解:散点图程序代码:i=1:10;plot(i,i.^2,'.')123456789100102030405060708090100或:x=1:10;y=x.^2;12fori=1:10;plot(x(i),y(i),'r')holdonend123456789100102030405060708090100折线图程序代码:i=1:10;plot(i,i.^2,'-x')123456789100102030405060708090100程序代码:i=1:10;plot(i.^2,4*(i.^2)+i.^3,'.')0102030405060708090100020040060080010001200140013i=1:10;plot(i.^2,4*(i.^2)+i.^3,'-x')01020304050607080901000200400600800100012001400数列极限的概念16通过动画观察当n时数列21nan的变化趋势.解:程序代码:n=1:100;an=(n.^2);n=1:100;an=1./(n.^2);n=1:100;an=1./(n.^2);fori=1:100plot(n(1:i),an(1:i)),axis([0,100,0,1])pause(0.1)end图象:010203040506070809010000.10.20.30.40.50.60.70.80.91函数的极限18在区间]4,4[上作出函数xxxxxf339)(的图形,并研究)(limxfx和).(lim1xfx14解:作出函数xxxxxf339)(在区间]4,4[上的图形x=-4:0.01:4;y=(x.^3-9*x)./(x.^3-x+eps);plot(x,y)从图上看,()fx在x→1与x→∞时极限为0两个重要极限20计算极限xxxxxsin11sinlim)1(0xxex2lim)2(30sintanlim)3(xxxxxxx0lim)4(xxxlncotlnlim)5(0xxxlnlim)6(20xxxxxxsincossinlim)7(20125523lim)8(323xxxxxxxxeexxxsin2lim)9(0xxxxcos110sinlim)10(解:(1)limit(x*sin(1/x)+1/x*sin(x))ans=1(2)limit(x^2/exp(x),inf)ans=0(3)limit((tan(x)-sin(8))/x^3)ans=NaN(4)limit(x^x,x,0,'right')ans=1(5)limit(log(cot(x))/log(x),x,0,'right')ans=-1(6)limit(x^2*log(x),x,0,'right')ans=0-4-3-2-101234-4-3-2-101234x101615(7)limit((sin(x)-x.*cos(x))./(x.^2.*sin(x)),x,0)ans=1/3(8)limit((3*x.^3-2*x.^2+5)/(5*x.^3+2*+1),x,inf)ans=3/5(9)limit((exp(x)-exp(-x)-2*x)./(x-sin(x)))ans=2(10)limit((sin(x)/x).^(1/(1-cos(x))))ans=exp(-1/3)实验3导数(基础实验)实验目的深入理解导数与微分的概念,导数的几何意义.掌握用Matlab求导数与高阶导数的方法.深入理解和掌握求隐函数的导数,以及求由参数方程定义的函数的导数的方法.导数概念与导数的几何意义22作函数71232)(23xxxxf的图形和在1x处的切线.解:作函数71232)(23xxxxf的图形程序代码:symsx;y=2*x^3+3*x^2-12*x+7;diff(y)ans=6*x^2+6*x-12symsx;y=2*x^3+3*x^2-12*x+7;f=diff(y)f=6*x^2+6*x-12x=-1;f1=6*x^2+6*x-12f1=-12f2=2*x^3+3*x^2-12*x+7f2=20x=linspace(-10,10,1000);y1=2*x.^3+3*x.^2-12*x+7;y2=-12*(x+1)+20;plot(x,y1,'r',x,y2,'g')-10-8-6-4-20246810-2000-1500-1000-5000500100015002000250016求函数的导数与微分24求函数bxaxxfcossin)(的一阶导数.并求.1baf解:求函数bxaxxfcossin)(的一阶导数程序代码:symsabxy;y=sin(a*x)*cos(b*x);D1=diff(y,x,1)答案:D1=cos(a*x)*a*cos(b*x)-sin(a*x)*sin(b*x)*b求.1baf程序代码:x=1/(a+b);cos(a*x)*a*cos(b*x)-sin(a*x)*sin(b*x)*b答案:ans=cos(a/(a+b))*a*cos(b/(a+b))-sin(a/(a+b))*sin(b/(a+b))*b拉格朗日中值定理26对函数),2)(1()(xxxxf观察罗尔定理的几何意义.(1)画出)(xfy与)(xf的图形,并求出1x与.2x解:程序代码:symsx;f=x*(x-1)*(x-2);f1=diff(f)f1=(x-1)*(x-2)+x*(x-2)+x*(x-1)solve(f1)ans=1+1/3*3^(1/2)1-1/3*3^(1/2)x=linspace(-10,10,1000);y1=x.*(x-1).*(x-2);y2=(x-1).*(x-2)+x.*(x-2)+x.*(x-1);plot(x,y1,x,y2)-10-8-6-4-20246810-1500-1000-5000500100017(2)画出)(xfy及其在点))(,(11xfx与))(,(22xfx处的切线.程序代码:symsx;f=x*(x-1)*(x-2);f1=diff(f)f1=(x-1)*(x-2)+x*(x-2)+x*(x-1)solve(f1)ans=1+1/3*3^(1/2)1-1/3*3^(1/2)x=linspace(-3,3,1000);y1=x.*(x-1).*(x-2);y2=(x-1).*(x-2)+x.*(x-2)+x.*(x-1);plot(x,y1,x,y2)holdonx=1+1/3*3^(1/2);yx1=x*(x-1)*(x-2)yx1=-0.3849x=1-1/3*3^(1/2);yx2=x*(x-1)*(x-2)yx2=0.3849x=linspace(-3,3,1000);yx1=-0.3849*x.^0;yx2=0.3849*x.^0;plot(x,yx1,x,yx2)-3-2-10123-60-40-20020406028求下列函数的导数:(1)31xey;解:程序代码:symsxy;y=exp((x+1)^3);D1=diff(y,1)答案:D1=3*(x+1)^2*exp((x+1)^3)18(2))]42ln[tan(xy;解:程序代码:symsx;y=log(tan(x/2+pi/4));D1=diff(y,1)答案:D1=(1/2+1/2*tan(1/2*x+1/4*pi)^2)/tan(1/2*x+1/4*pi)(3)xxysinlncot212;解:程序代码:symsx;y=1/2*(cot(x))^2+log(sin(x));D1=diff(y,1)答案:D1=cot(x)*(-1-cot(x)^2)+cos(x)/sin(x)(4)xy2arctan21.解:程序代码:symsx;y=sqrt(2)*atan(sqrt(2)/x);D1=diff(y,1)答案:D1=-2/x^2/(1+2/x^2)一元函数积分学与空间图形的画法实验4一元函数积分学(基础实验)实验目的掌握用Matlab计算不定积分与定积分的方法.通过作图和观察,深入理解定积分的概念和思想方