0lim sin x xx e e x -→-代码:>> clear>> syms x>> f=(exp(x)-exp(-x))/sin(x)f =-(exp(-x) - exp(x))/sin(x)>> limit(f,x,0)ans =2 2.nn mm a x a x ax --→lim代码:>> clear>> syms x a m n>> f=(x^m-a^m)/(x^n-a^n)f =(a^m - x^m)/(a^n - x^n)>> limit(f,x,a)ans =(a^(m - n)*m)/nnx x x 21lim ⎪⎭⎫⎝⎛+∞→代码:>> clear>> syms x>> f=exp(1/(x-1));>> limit(f,x,-1,'left');ans =exp(-1/2) 4.111lim -+→x x e代码:>> clear>> syms x>> f=exp(1/(x-1));>> limit(f,x,-1,'right');ans =exp(-1/2)计算下列导数选了 1 2 题1))1ln(2x x e e y ++=代码:>> y=log(exp(x)+(1+exp(2*x))^(1/2));>> diff(f)ans =(exp(x) + exp(2*x)/(exp(2*x) + 1)^(1/2))/(exp(x) + (exp(2*x) + 1)^(1/2))2)xe y 1sin 2-=代码: >> y=exp(-(sin(1/x))^2);>> diff(y)ans =(2*cos(1/x)*sin(1/x)*exp(-sin(1/x)^2))/x^24、求曲线在t=0相应点处的切线方程和法线方程。
⎩⎨⎧==-t tey e x 2切线:1)求斜率k:>> syms x y t>> x=2*exp(t);>> y=exp(-t);>> k=diff(y)/diff(x);>> subs(k,t,0)ans = -1/2求切点将t带入x y得到点(2,1)clearsyms x y tz=2*exp(t);y=exp(-t);k=diff(y)/diff(z);subs(k,t,0)答案-1/2代入点x-2=-1/2*(y-1)得到y=2*x+5法线斜率由切线斜率得k=2; 带入点斜式:x-2=2*(y-1)结果y=1/2*x二、应用型实验解:>>syms l g T T1 l0;%l0为L0不是10>> T=2*pi*sqrt(l/g);%写出函数>>T1=2*pi*((l+l0)/g)^(1/2);%写出T1函数(加长后的)>>T1=subs(T1,[l,g],[20,980])%带入数值T1=2*pi*(1/49+l0/980)^(1/2)>>T=subs(T,[l,g],[20,980])%带入数值T =(2*pi)/7>>l0=solve('(2*pi)/7+0.05-2*pi*(1/49 +l0/980)^(1/2)=0',l0) l0=2.2902284282674665857737488584312答案为2.2902284282674665857737488584312带入验算T1-(T+0.05)=3.5696e-18误差挺小的了验算过程:>>F=T1-(T+0.05);>>subs(F,'l0',2.2902284282674665857737488584312); >>double(ans)%将表达式转换为数值ans=3.5696e-181)解:对x(t)求导就行了>> syms x u t b>> x=u*t+u*(1/b-t)*log(1-b*t)x =t*u - u*log(1 - b*t)*(t - 1/b)>> v=diff(x,t)v =u - u*log(1 - b*t) - (b*u*(t - 1/b))/(b*t - 1)2)对v(t)求导就可以了>>a=diff(v,t)a =(b^2*u*(t - 1/b))/(b*t - 1)^2 - (2*b*u)/(b*t - 1)3)将u=3*10^3 b=7.5*10^-3 带入v(t,u,b);>>v=subs(v,[u,b],[3*10^3,7.5*10^-3]);v=3000 - (45*(t - 400/3))/(2*((3*t)/400 - 1)) - 3000*log(1 -(3*t)/400)>>subs(v,'t',0)% 将t=0带入ans=0>>double(subs(v,’t’,120))%将t=120带入6.9078e+034)、将u=3*10^3 b=7.5*10^-3 带入a(t,u,b);然后依次带入t=0 t=120>>subs(a,'t',0)ans =45/2(m/s)>>subs(a,’t’,120)ans=225(m/s)求不定积分: 1.;12⎰-+x x xdx代码:>>syms x y>>y=x/sqrt(1+x-x^2);>>int(y)ans =- (log(x*i + (- x^2 + x + 1)^(1/2) - i/2)*i)/2 - (- x^2 + x +1)^(1/2)2.;)1ln(2dx x ⎰+ 代码:>> f=log(1+x^2);>> f1=int(f)f1 =2*atan(x) - 2*x + x*log(x^2 + 1)3. ⎰+;sin 1cos sin 4dx x x x代码:>>f=(sin(x)*cos(x))/(1+(sin(x))^4);>> f1=int(f)f1 =atan(2*tan(x)^2 + 1)/2.cos bxdx e ax ⎰代码:>> syms a b x>> f=exp(a*x)*cos(b*x);f1=int(f,x)f1 =(exp(a*x)*(a*cos(b*x) + b*sin(b*x)))/(a^2 + b^2)计算定积分:1.;)sin(ln 1dx x e⎰>> syms x >> f=sin(log(x))f =sin(log(x))>> f1=double(int(f,1,exp))f1= 0.90932.;12ln 0dx e x ⎰->>f=sqrt(exp(x)-1);>>f1=double(int(f,0,log(2))) f1= 0.4292 3.⎰-ex x dx 12;)(ln 1代码:>> f=1/x*sqrt(1-(log(x))^2)f =(1 - log(x)^2)^(1/2)/x>> f1=int(f,1,exp(1))f1 =asin(log(3060513257434037/1125899906842624))/2 + (log(3060513257434037/1125899906842624)*(1 - log(3060513257434037/1125899906842624)^2)^(1/2))/2 >> double(f1)ans =0.7854 + 0.0000i4..0222dx ex x ⎰∞-代码:>> f=x^2*exp(-2*x^2)f =x^2*exp(-2*x^2)>> f1=double(int(f,0,+Inf))f1 =0.1567求下列极限1.;arctan 20lim x dtt xx ⎰+∞→代码>>syms t x f>> f=atan(t)f =atan(t)>> f=int(f,0,x)f =x*atan(x) - log(x^2 + 1)/2>> f=f/x^2f =-(log(x^2 + 1)/2 - x*atan(x))/x^2>> limit(f,x,+Inf)ans =02.;2sin 020lim π-⎰→x dt t xx代码>> f=sin(t)^2f = sin(t)^2>> f=int(f,t,0,x)f =x/2 - sin(2*x)/4>> f=f/(x-pi/2)f =-(x/2 - sin(2*x)/4)/(pi/2 - x)>> limit(f,'x',0)ans=0代码>> syms t x f>> f=(3*t+1)/(t^2-t+1);>> y=int(f,'t',0,x);>> y1=diff(y);>> solve(y)ans =-1/31)代码:>>x=[220 200 140 120 100 120 140 200 220];% >>y=[50 45 40 38 34 38 40 45 50];%>>S=0;>>for i=1:9S=S+sqrt(x(i)^2+y(i)^2);end;>>SS=1.5098e+03 (米)2)不会。