>> limit(x*cot(2*x),x,0) ans = 1/2 (4)limx??(cosmcx)
命令:syms x m; limit((cos(m/x))^x,x,inf) ans = 1
(5)lim(x?11x?1ex)
?1命令:syms x
>> limit(1/x-1/(exp(x)-1),x,1) ans =
(exp(1)-2)/(exp(1)-1) (6)lim(x??x2?x?x)
命令:syms x
>> limit((x^2+x)^(1/2)-x,x,inf)
ans = 1/2
练习2.4
1. 求下列不定积分,并用diff验证: (1)
?1?cosx
dx>>Clear >> syms x y >> y=1/(1+cos(x)); >> f=int(y,x) f =
tan(1/2*x) >> y=tan(1/2*x); >> yx=diff(y,x); >> y1=simple(yx) y1 =
1/2+1/2*tan(1/2*x)^2 (2)
?1?dxex
clear syms x y
y=1/(1+exp(x));
f=int(y,x) f =
-log(1+exp(x))+log(exp(x)) syms x y
y=-log(1+exp(x))+log(exp(x)); yx=diff(y,x); y1=simple(yx) y1 = 1/(1+exp(x)) (3)
?xsinxdx
2syms x y
y=x*sin(x)^2; >> f=int(y,x) f =
x*(-1/2*cos(x)*sin(x)+1/2*x)-1/4*cos(x)^2-1/4*x^2 clear
syms x y y=x*(-1/2*cos(x)*sin(x)+1/2*x)-1/4*cos(x)^2-1/4*x^2; yx=diff(y,x); >> y1=simple(yx) y1 =
x*sin(x)^2 (4)
?sec3xdx
syms x y y=sec(x)^3;
f=int(y,x) f =
1/2/cos(x)^2*sin(x)+1/2*log(sec(x)+tan(x)) clear syms x y
y=1/2/cos(x)^2*sin(x)+1/2*log(sec(x)+tan(x)); yx=diff(y,x); y1=simple(yx) y1 =
1/cos(x)^3
2. 求下列积分的数值解 1)?10x?xdx
clear
syms x
y=int(x^(-x),x,0,1) y =
int(x^(-x),x = 0 .. 1) vpa(y,10) ans =
1.291285997 2)?2?0ecos2x3xdx
clear
syms x
y=int(exp(2*x)*cos(x)^3,x, clear syms x
y=int((1/(2*pi)^(1/2))*exp(-x^2/2),x,0,1) y =
7186705221432913/36028797018963968*erf(1/2*2^(1/2))*2^(1/2)*pi^(1/0,2*pi) y =
22/65*exp(pi)^4-22/65vpa(ans,10)
2(3)
?112?0e?x2dx
>> clear >> syms x
>> y=int(1/(2*pi)^(1/2)*exp(-x^2/2),0,1); >> vpa(y,14) ans =
.34134474606855
2(4)
>> clear >> syms x
>> y=int(x*log(x^4)*asin(1/x^2),1,3); Warning: Explicit integral could not be found. > In sym.int at 58 >> vpa(y,14) ans =
2.4597721282375
2(5) >> clear >> syms x
>> y=int(1/(2*pi)^(1/2)*exp(-x^2/2),-inf,inf); >> vpa(y,14) ans =
.99999999999999
练习
2.5
1判断下列级数的收敛性,若收敛,求出其收敛值。
1)syms n
s1=symsum(1/n^(2^n),n,1,inf) s1 =
sum(1/(n^(2^n)),n = 1 .. Inf) vpa(s1,10) ans =
1.062652416 因此不收敛 2)syms n
s1=symsum(sin(1/n),n,1,inf) s1 =
sum(sin(1/n),n = 1 .. Inf) vpa(s1,10) ans =
sum(sin(1/n),n = 1 .. Inf) 不收敛 (3) >> clear
>> syms n
>> s=symsum(log(n)/n^3,n,1,inf) s =
-zeta(1,3) 收敛
(4) syms n
s1=symsum(1/(log10(n))^n,n,3,inf) s1 =
sum(1/((log(n)/log(10))^n),n = 3 .. inf) 不收敛 (5) syms n
s1=symsum(1/n*log10(n),n,2,inf) s1 =
sum(1/n*log(n)/log(10),n = 2 .. Inf) 不收敛 (6)
>> clear >> syms n
>> s=symsum((-1)^n*n/n^2+1,n,1,inf)
s =
sum((-1)^n/n+1,n = 1 .. Inf) 不收敛
习题3.1
1)clear;
[x,y]=meshgrid(-30:0.3:30);
z=10*sin(sqrt(x.^2+y.^2))./sqrt(1+x.^2+y.^2); >> meshc(x,y,z)
clear
>> [x,y]=meshgrid(-30:0.1:30);
>> z=10*sin((x^2+y^2)^(1/2))/(1+x^2+y^2)^(1/2) mesh(x,y,z)
1.