贵州师范学院2012级数本一班李刚数学实验课后练习答案习题2.11. syms x y;>> x=-5:0.01:5;>> y=x.^1/2;>> plot(x,y)2. f plot('exp(-x.^2)',[-5,5])3. ezplot('x.^3+y.^3-3*x*y',[-5,5])4 . ezplot('y.^2-x.^3/(1-x)',[-5,5])5.t=0:0.1:2*pi;x=t-sin(t);y=2*(1-cos(t));plot(x,y)6. t=0:0.1:2*pi; x=cos(t).^3; >> y=sin(t).^3;>> plot(t,y)>>7: t=0:0.1:2*pi; x=cos(t); y=2*sin(t); z=3*t; plot3(x,y,z)8: x =0:0.1:2*pi; r=x; polar(x,r)9: x =0:0.1:2*pi; r=exp(x); polar(x,r)10: x=0:0.1:2*pi; r=sqrt(cos(2*x)); polar(x,r)11: x=0:0.1:2*pi; r=sqrt(sin(2*x)); polar(x,r)12: x =0:0.1:2*pi; r=1+cos(x); polar(x,r)练习2.2 1:(1)(2):syms n; limit('sqrt(n+2)-2*(sqrt(n+1))+sqrt(n)',n,inf)Ans= 0 (3):: (4):(5):(6):2:3:fplot('x.^2*sin(x.^2-x-2)',[-2,2])练习2.3 1:(2):2:练习2.4 1:(1)(2):(3)(4):2:(1):syms x;int(x^(-x),x,0,1)ans =int(x^(-x),x = 0 .. 1)vpa(ans,10)ans =1.291285997(2):syms x;int(exp(2*x)*cos(x)^3,x,0,2*pi)ans =-22/65+22/65*exp(4*pi)(3):syms x; int(exp(x^2/2)/sqrt(2*pi),x,0,1)ans =-1125899906842624/5644425081792261*i*erf(1/2*i*2^(1/2))*pi^(1/2)*2^(1/2) >> vpa(ans,10)ans =.4767191345(4):syms x;int(x*log(x^4)*asin(1/x^2),x,1,3)ans =int(x*log(x^4)*asin(1/x^2),x = 1 .. 3)>> vpa(ans,10)ans =2.459772128(5):syms x ;int(exp(x^2/2)/sqrt(2*pi),x,-inf,inf)ans =Inf(6):syms x ;int(sin(x)/x,x,0,inf)ans =1/2*pi(7):syms x ;int(tan(x)/sqrt(x),x,0,1)Warning: Explicit integral could not be found. > In sym.int at 58ans =int(tan(x)/x^(1/2),x = 0 .. 1)>> vpa(ans,10)ans =.7968288892(8):syms x ;int(exp(-x^2/2)/(1+x^4),x,-inf,inf)ans =1/4*pi^(3/2)*2^(1/2)*(AngerJ(1/2,1/2)-2/pi^(1/2)*sin(1/2)+2/pi^(1/2)*cos(1/2)-WeberE(1/2,1/2 ))>> vpa(ans,10)ans =1.696392536(9):syms x ;int(sin(x)/sqrt(1-x^2),x,0,1)ans =1/2*pi*StruveH(0,1)>> vpa(ans,10)ans =.8932437410练习2.5(1):syms n;symsum(1/n^2^n,n,1,inf)ans =sum(1/((n^2)^n),n = 1 .. Inf)(2):s yms n ;symsum(sin(1/n),n,1,inf)ans =sum(sin(1/n),n = 1 .. Inf)(3):syms n ;symsum(log(n)/n^3,n,1,inf) ans =-zeta(1,3)(4):syms n ;symsum(1/(log(n))^n,n,3,inf) ans =sum(1/(log(n)^n),n = 3 .. Inf)(5):syms n;symsum(1/(n*log(n)),n,2,inf) ans =sum(1/n/log(n),n = 2 .. Inf)(6):yms n;symsum((-1)^n*n/(n^2+1),n,1,inf)ans =-1/4*Psi(1-1/2*i)+1/4*Psi(1/2-1/2*i)-1/4*Psi(1+1/2*i)+1/4*Psi(1/2+1/2*i)第三章练习3.11:(1):a=-30:1:30;b=-30:1:30;[x,y]=meshgrid(a,b);z=10*sin(sqrt(x.^2+y.^2))./(sqrt(1+x.^2+y.^2)); meshc(x,y,z)(2):a=-30:1:30;b=-30:1:30;[x,y]=meshgrid(a,b);z=4*x.^2/9+y.^2;meshc(x,y,z)(3):(4):a=-30:1:30;b=-30:1:30;[x,y]=meshgrid(a,b); z=x.^2/3-y.^2/3; meshc(x,y,z)(5):a=-30:1:30;>> b=-30:1:30;>> [x,y]=meshgrid(a,b); >> z=x*y;>> meshc(x,y,z)(6):(7):a=-30:1:30;>> b=-30:1:30;>> [x,y]=meshgrid(a,b); >> z=sqrt(x.^2+y.^2); >> meshc(x,y,z)(8):(9):a=-30:1:30;>> b=-30:1:30;>> [x,y]=meshgrid(a,b);>> z=atan(x./y);>> meshc(x,y,z)练习3.21;a=-1:0.1:1;>> b=0:0.1:2;>> [x,y]=meshgrid(a,b);>> z=x.*exp(-x.^2-y.^2);>> [px,py]=gradient(z,0.1,0.1);>> contour(a,b,z)>> hold on>> quiver(a,b,px,py)2:a=-2:0.1:1;>> b=-7:0.1:1;>> [x,y]=meshgrid(a,b);>> z=y.^3/9+3*x.^2.*y+9*x.^2+y.^2+x.*y+9; >> plot3(x,y,z)>> grid on3:[x,y]=meshgrid(-2*pi:0.2:2*pi); z=x.^2+2*y.^2;plot3(x,y,z)hold onezplot('x^2+y^2-1',[-2*pi,2*pi]) ; grid on4:t=0:0.03:2*pi;>> s=[0:0.03:2*pi]';>> x=(0*s+1)*cos(t);y=(0*s+1)*sin(t);z=s*(0*t+1); >> mesh(x,y,z)>> hold on>> [x,y]=meshgrid(-1:0.1:1);>> z=1-x+y;>> mesh(x,y,z)5:syms x y z dx dyz=75-x^2-y^2+x*y;zx=diff(z,x),zy=diff(z,y)zx =-2*x+yzy =-2*y+x练习3.31:ezplot('x^2+y^2-2*x',[-2,2]);>> grid onsyms x y ;s=int(int(x+y+1,y,-sqrt(1-(x-1)^2),sqrt(1-(x-1)^2)),x,0,2)s =2*pi2:syms r t ;>> s=int(int(sqrt(1+r^2*sin(t)),r,0,1),t,0,2*pi)s =int(1/2*((1+sin(t))^(1/2)*sin(t)^(1/2)+log(sin(t)^(1/2)+(1+sin(t))^(1/2)))/sin(t)^(1/2),t = 0 .. 2*pi) 3:syms x y z ;>> s=int(int(int(1/(1+x+y+z)^3,z,0,1-x-y),y,0,1-x),x,0,1)s =-5/16+1/2*log(2)4:s=vpa(int(int(x*exp(-x^2-y^2),y,0,2),x,-1,10))s =0.16224980455070416645061789474030练习3.41:(1):y=dsolve('Dy=x+y','y(0)=1','x')得:y =-1-x+2*exp(x)(2):y=dsolve('Dy=2*x+y^2','y(0)=0')y =tan(t*x^(1/2)*2^(1/2))*x^(1/2)*2^(1/2)练习4.11:(1):p=[5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -6 8 0 0 0 -5 0 0]; >> x=roots(p)x =0.97680.9388 + 0.2682i0.9388 - 0.2682i0.8554 + 0.5363i0.8554 - 0.5363i0.6615 + 0.8064i0.6615 - 0.8064i0.3516 + 0.9878i0.3516 - 0.9878i-0.0345 + 1.0150i-0.0345 - 1.0150i-0.4609 + 0.9458i-0.4609 - 0.9458i-0.1150 + 0.8340i-0.1150 - 0.8340i-0.7821 + 0.7376i-0.7821 - 0.7376i-0.9859 + 0.4106i-0.9859 - 0.4106i-1.0416-0.7927(2): p=[8 36 54 23];x=roots(p)x =-1.8969 + 0.6874i-1.8969 - 0.6874i-0.70632:p1=[1 0 -3 -2 -1];p2=[1 -2 5];[q2,r2]=deconv(p1,p2)q2 =1 2 -4r2 =0 0 0 -20 19 3:syms x;f=x^4+3*x^3-x^2-4*x-3;g=3*x^3+10*x^2+2*x-3;p1=factor(f),p2=factor(g)p1 =(x+3)*(x^3-x-1)p2 =(x+3)*(3*x^2+x-1)4:syms x ;f=x^12-1;p=factor(f)p =(-1+x)*(1+x^2+x)*(1+x)*(1-x+x^2)*(1+x^2)*(x^4-x^2+1)5: (1):p=[1 0 1];q=[1 0 0 0 1];[a,b,r]=residue(p,q)a =-0.0000 - 0.3536i-0.0000 + 0.3536i0.0000 - 0.3536i0.0000 + 0.3536ib =0.7071 + 0.7071i0.7071 - 0.7071i-0.7071 + 0.7071i-0.7071 - 0.7071ir =[](2):p=[1];q=[1 0 0 0 1];[a,b,r]=residue(p,q)a =-0.1768 - 0.1768i -0.1768 + 0.1768i0.1768 - 0.1768i0.1768 + 0.1768ib =0.7071 + 0.7071i0.7071 - 0.7071i -0.7071 + 0.7071i -0.7071 - 0.7071ir =[](3):p=[1 0 1];q=[1 1 -1 -1];[a,b,r]=residue(p,q)a =0.5000-1.00000.5000b =-1.0000-1.00001.0000r =[] (4): p=[1 1 0 0 0 -8];[a,b,r]=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0 0 0;1 0 6 0 0;0 0 5 6 0;0 0 1 5 6;0 1 0 1 5]; D3=[5 6 1 0 0;1 5 0 0 0;0 1 0 6 0;0 0 0 5 6;0 0 1 1 5]; D4=[5 6 0 1 0;1 5 6 0 0;0 1 5 0 0;0 0 1 0 6;0 0 0 1 5]; D5=[5 6 0 0 1;1 5 6 0 0;0 1 5 6 0;0 0 1 5 0;0 0 0 1 1]; x1=det(D1)/det(D);x2=det(D2)/det(D);x3=det(D3)/det(D);x4=det(D4)/det(D);x5=det(D5)/det(D);x1,x2,x3,x4,x5x1 =2.2662x2 =-1.7218x3 =1.0571x4 =-0.5940x5 =0.3188练习 4.3 1:A=[1 2 0;3 4 -1; 1 1 -1];B=[1 2 3;-1 0 1;-2 4 -3];A',2+A,2*A-B,A*B,A^2,A^(-1)ans =1 3 12 4 10 -1 -1ans =3 4 25 6 13 3 1ans =1 2 -37 8 -34 -2 1ans =-1 2 51 2 162 -2 7ans =7 10 -214 21 -33 5 0ans =-3.0000 2.0000 -2.00002.0000 -1.0000 1.0000-1.0000 1.0000 -2.0000 2:(1):B=[2 4 3];B'ans =243(2):A=[1 2 3];B=[2 4 3];A.*B,B.*Aans =2 8 9ans =2 8 93:(1):A=[0 1 0;1 0 0;0 0 1];B=[1 0 0;0 0 1;0 1 0];C=[1 -4 3;2 0 -1;1 -2 0];A^(-1),B^(-1),X=A^(-1)*C*B^(-1) ans =0 1 01 0 00 0 1ans =1 0 00 0 10 1 0X =2 -1 01 3 -41 0 -2(2):>> A=[1 2 3;2 2 3;3 5 1];B=[1 0 0;2 0 0;3 0 0];A^(-1),x=A^(-1)*Bans =-1.0000 1.0000 0.00000.5385 -0.6154 0.23080.3077 0.0769 -0.1538x =1 0 00 0 00 0 0练习 4.41:(1):A=[4 2 -1;3 -1 2;11 3 0];b=[2;10;8];B=[A,b];rank(A),rank(B)ans =2ans =3(2):A=[2 1 -1 1;3 -2 1 -3;1 4 -3 5];b=[1;4;-2];B=[A,b];rank(A),rank(B)ans =2ans =2(3):A=[ 1 1 1 1; 1 2 -1 4;2 -3 -1 -5;3 1 2 11];b=[5;-2;-2;0];B=[A,b];rank(A),rank(B)ans =4ans =4(4):A=[ 1 1 2 -1; 2 1 1 -1;2 2 1 2];b=[0;0;0];B=[A,b];rank(A),rank(B)ans =3ans =32:syms a;A=[-2 1 1;1 -2 1;1 1 -2];b=[-2;a;a^2];B=[A,b];rank(A),rank(B)ans =2ans =3练习4.51:(1):A=[0 1;-1 0];[a,b]=eig(A)a =0.7071 0.70710 + 0.7071i 0 - 0.7071ib =0 + 1.0000i 000 - 1.0000i(2):A=[0 0 1;0 1 0;1 0 0];[a,b]=eig(A)a =0.7071 0.7071 00 0 -1.0000-0.7071 0.7071 0b =-1 0 00 1 00 0 1(3):A=[4 1 -1;3 2 -6;1 -5 3];[a,b]=eig(A)a =0.0185 -0.9009 -0.3066-0.7693 -0.1240 -0.7248-0.6386 -0.4158 0.6170b =-3.0527 0 00 3.6760 00 0 8.3766(4):A=[1 1 1 1;1 1 -1 -1;1 -1 1 -1;1 1 -1 1];[a,b]=eig(A)a =0.5615 0.3366 0.2673 -0.7683-0.5615 -0.3366 0.0000 -0.0000-0.5615 -0.3366 -0.5345 -0.6236-0.2326 0.8125 0.8018 -0.1447b =-1.4142 0 0 00 1.4142 0 00 0 2.0000 00 0 0 2.0000(5):A=[5 7 6 5;7 10 8 7;6 8 10 9;5 7 9 10];[a,b]=eig(A)a =0.8304 0.0933 0.3963 0.3803-0.5016 -0.3017 0.6149 0.5286-0.2086 0.7603 -0.2716 0.55200.1237 -0.5676 -0.6254 0.5209b =0.0102 0 0 00 0.8431 0 00 0 3.8581 00 0 0 30.2887(6):A=[5 6 0 0 0;1 5 6 0 0 ;0 1 5 6 0 ;0 0 1 5 6; 0 0 0 1 5 ]; [a,b]=eig(A)a =0.7843 -0.7843 -0.9860 -0.9237 -0.92370.5546 0.5546 0.0000 0.3771 -0.37710.2614 -0.2614 0.1643 -0.0000 0.00000.0924 0.0924 0.0000 -0.0628 0.06280.0218 -0.0218 -0.0274 0.0257 0.02579.2426 0 0 0 00 0.7574 0 0 00 0 5.0000 0 00 0 0 2.5505 00 0 0 0 7.4495 2:(1):A=[0 1;-1 0];[a,b]=eig(A)a =0.7071 0.70710 + 0.7071i 0 - 0.7071ib =0 + 1.0000i 00 0 - 1.0000i>> P=orth(a),B=P'*A*P,P*P'P =-0.7071 -0.70710 - 0.7071i 0 + 0.7071iB =0 + 1.0000i 0 - 0.0000i0 - 0.0000i 0 - 1.0000ians =1.0000 0 + 0.0000i0 - 0.0000i 1.0000>> inv(a)*A*a0 + 1.0000i 000 - 1.0000i3:(1):A=[2 0 0;0 3 2;0 2 3]; [a,b]=eig(A)a =0 1.0000 0-0.7071 0 0.70710.7071 0 0.7071b =1.0000 0 00 2.0000 00 0 5.0000>> P=orth(a),B=P'*A*P,P*P'P =-1.0000 0 -0.00000.0000 0.7071 0.7071-0.0000 -0.7071 0.7071B =2.0000 0.0000 0.00000.0000 1.0000 00.0000 0 5.0000ans =1.0000 -0.0000 0.0000-0.0000 1.0000 -0.00000.0000 -0.0000 1.0000(2):A=[1 1 0 -1;1 1 -1 0;0 -1 1 1;-1 0 1 1];[a,b]=eig(A)a =-0.5000 0.7071 0.0000 0.50000.5000 -0.0000 0.7071 0.50000.5000 0.7071 0.0000 -0.5000-0.5000 0 0.7071 -0.5000 b =-1.0000 0 0 00 1.0000 0 00 0 1.0000 00 0 0 3.0000 >> P=orth(a),B=P'*A*P,P*P'P =-0.5000 -0.4998 -0.4783 -0.52100.5000 -0.4822 0.5212 -0.49580.5000 0.4998 -0.4964 -0.5037-0.5000 0.5175 0.5031 -0.4786 B =-1.0000 0.0000 0.0000 0.00000.0000 2.9988 -0.0362 0.03440.0000 -0.0362 1.0007 -0.00060.0000 0.0344 -0.0006 1.0006 ans =1.0000 0.0000 0.0000 -0.00000.0000 1.0000 -0.0000 00.0000 -0.0000 1.0000 0.0000-0.0000 0 0.0000 1.0000练习5.3 1: [m,v]=unifstat(1,11)m =6v =8.33332:[m,v]=normstat(0,16)m =v =256>> s=sqrt(v)s =163:x=randn(200,6);s=std(x)s =0.9094 0.9757 0.9702 0.9393 0.9272 1.09824: x=normrnd(0,16,300,1);hist(x,10)练习 5.61:x=[352 373 411 441 462 490 529 577 641 692 743];y=[166 153 177 201 216 208 227 238 268 268 274];plot(x,y,'*')4:(1):x=[10 10 10 15 15 15 20 20 20 25 25 25 30 30 30];y=[25.2 27.3 28.7 29.8 31.1 27.8 31.2 32.6 29.7 31.7 30.1 32.3 29.4 30.8 32.8]; plot(x,y,'*')。