>> syms x y;
>> z=int(int(y*sqrt(1+x^2-y^2),y,x,1),x,-1,1)
z =
1/2
>>
>> syms x y;
>> z=int(int(sin(y^2),x,0,y),y,0,1)
z =
sin(1/2)^2
如果先对y求积分:
>> syms x y;
>> int(int(sin(y^2),y,x,1),x,0,1)
ans =
sin(1/2)^2
结果一样。
>> syms x y;
>> int(int(sin(pi*(x^2+y^2)),y,-sqrt(1-x^2),sqrt(1-x^2)),x,-1,1)
Warning: Explicit integral could not be found.
ans =
int((2^(1/2)*fresnelS(2^(1/2)*(1 - x^2)^(1/2))*cos(pi*x^2))/2 - (2^(1/2)*fresnelS(-2^(1/2)*(1 - x^2)^(1/2))*cos(pi*x^2))/2 + (2^(1/2)*fresnelC(2^(1/2)*(1 - x^2)^(1/2))*sin(pi*x^2))/2 - (2^(1/2)*fresnelC(-2^(1/2)*(1 - x^2)^(1/2))*sin(pi*x^2))/2, x == -1..1)
>> syms theta r;
>> int(int(r*sin(pi*r^2),r,0,1),theta,0,2*pi)
ans =
2
>> syms x y z;
>> int(int(int(x,z,0,1-x-2*y),y,0,(1-x)/2),x,0,1)
ans =
1/48
柱坐标计算:
>> syms theta rho z;
>> int(int(int(rho^3*sin(theta)*cos(theta)/sqrt(z),z,rho,1),rho,0,1),theta,0,pi/2)
ans =
1/36
球坐标计算:
>> syms theta phi r; >>int(int(int(r^4*sin(phi)^3*sin(theta)*cos(theta)/sqrt(r*cos(phi)),r,0,1/cos(phi)),phi,0,pi/4),theta,0,pi/2) ans = 1/36
重积分数值积分命令:
z=dblquad(f,a,b,c,d) 求矩形区域f(x,y)的重积分,
a,b分别是x的积分上下限,c,d分别是y的积分上下限。
z=triplequad(f,a,b,c,d,e,f) 求三元函数f(x,y,z)在长方体区域内的重积分,
a,b分别是x的积分上下限,c,d分别是y的积分上下限,e,f分别是z的积分上下限。
>> f=inline('x.*exp(x.^2+y.^2)','x','y');
>> dblquad(f,0,2,-2,2)
ans =
881.8304
>> f=inline('y.*sin(x)+z.*cos(x)','x','y','z');
>> triplequad(f,0,pi,0,1,-1,1)
ans =
2.0000
版权声明:本文为u014147522原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。