你好同学,代码供参考
第六题:
syms x y
f = x^(-y);
int(f,x)
int(f,y,0,1)
结果:
ans =
piecewise(y == 1, log(x), y ~= 1, -x^(1 - y)/(y - 1))
ans =
piecewise(x < 0, int(1/x^y, y, 0, 1), ~x < 0, (x - 1)/(x*log(x)))
第七题
考察一般符号方程的建立
syms x y z
eq = [x+y+z==1, x-y+z==2, 2*x-y-z==1];
[x,y,z] = solve(eq,[x,y,z])
结果:
x =
2/3
y =
-1/2
z =
5/6