函数int:用于实现符号积分运算
1.不定积分
syms alpha t x;
fh1 = (3 - x^2)^3;
I1 = int(fh1)
fh2 = sin(x)^2;
I2 = int(fh2)
fh3 = exp(alpha*t);
I3 = int(fh3)
fh4 = 5*x*t/(1+x^2);
I4 = int(fh4,t)
2.一重定积分
syms t x;
I1 = int(abs(1-x),1,2) %求定积分(1)
fh2 = 1/(1+x^2);
I2 = int(fh2,-inf,inf) %求定积分(2)
I3 = int(4*x/t,x,2,sin(t)) %求定积分(3)
fh4 = x^3/(x-1)^100;
I4 = int(f4,2,3) %求定积分(4)
I4 = vpa(I4,15)
3.多重积分
syms x y
int1 = int(int(x*sin(x),x,y,sqrt(y)),y,0,1)
int1 = vpa(int1,10)
int2 = int(int(x*exp(-y^2),x,0,sqrt(y)),y,0,1)
int2 = vpa(int2,10)
int3 = int(int(x^2+y^2,x,sqrt(y),2),y,1,4)
int3 = vpa(int3,10)
4.第一类曲线积分
syms t;
syms a positive;
x = a*cos(t);
y = a*sin(t);
z = a*t;
ds = sqrt(diff(x,t)^2+diff(y,t)^2+diff(z,t)^2);
I8 = int(z^2/(x^2+y^2)*ds,t,0,2*pi)
syms t a k;
x = a*cos(t);
y = a*sin(t);
z = k*t;
ds = sqrt(diff(x,t)^2+diff(y,t)^2+diff(z,t)^2);
I9 = int((x^2+y^2+z^2)*ds,t,0,2*pi)
5.第二类曲线积分
syms t;
syms a positive;
x = a*cos(t);
y = a*sin(t);
F = [(x+y)/(x^2+y^2),-(x-y)/(x^2+y^2)];
ds = [diff(x,t);diff(y,t)];
I0 = int(F*ds,t,2*pi,0)
syms t;
syms a b positive;
x = a*cos(t);
y = a*sin(t);
z = b*t;
F = [y,-x,(x+y+z)];
ds = [diff(x,t);diff(y,t);diff(z,t)];
I11 = int(F*ds,t,0,pi/2)
6.第一类曲面积分
syms x y dx dy;
z = sqrt(4-x^2-y^2);
ds = simplify(sqrt(1+diff(z,x)^2+diff(z,y)^2))*dx*dy
syms r theta;
I = int(int(r/(4-r^2),r,0,sqrt(3)),theta,0,2*pi)