matlab的符号计算
作者:互联网
#############################
01 展开:展开因式:expand(f)
--- 幂函数:则根据次数从高到低 --- 三角函数:展开角部分 --- 指数:展开指数部分
>> z=(x+y+3)*(2*x-4*y+7)+sin(x+y)+exp(x+y)+log(x*y) z = exp(x + y) + log(x*y) + sin(x + y) + (2*x - 4*y + 7)*(x + y + 3) >> expand(z) ans = 13*x - 5*y + log(x*y) + exp(x)*exp(y) + cos(x)*sin(y) + cos(y)*sin(x) - 2*x*y + 2*x^2 - 4*y^2 + 21 >>
>> z=(x+y+3)*(2*x-4*y+7) z = (2*x - 4*y + 7)*(x + y + 3) >> expand(z) ans = 2*x^2 - 2*x*y + 13*x - 4*y^2 - 5*y + 21 >>
02 合并:因式分解:factor(f)
>> z1=3*x^3+2*x^2+x+2 z1 = 3*x^3 + 2*x^2 + x + 2 >> factor(z1) ans = [ x + 1, 3*x^2 - x + 2] >>
>> z1=x^2+2*x*y+y^2 z1 = x^2 + 2*x*y + y^2 >> factor(z1) ans = [ x + y, x + y] >>
03 合并同类项:collect(f)
>> z2=x^2+x*y*7-x^2+y+x-8 z2 = x + y + 7*x*y - 8 >> collect(z2) ans = (7*y + 1)*x + y - 8 >> collect(z2,y) ans = (7*x + 1)*y + x - 8 >> collect(z2,x) ans = (7*y + 1)*x + y - 8 >>
04 化简:simplify(f)
>> z3=x^2+y^2-2*x*y+sin(x)^2+cos(x)^2 z3 = cos(x)^2 + sin(x)^2 - 2*x*y + x^2 + y^2 >> simplify(z3) ans = x^2 - 2*x*y + y^2 + 1 >>
05 解方程:solve(f,x)
>> z=x^3+x-6 z = x^3 + x - 6 >> solve(z,x) ans = root(z^3 + z - 6, z, 1) root(z^3 + z - 6, z, 2) root(z^3 + z - 6, z, 3) >> z=x^2+x-2 z = x^2 + x - 2 >> solve(z,x) ans = -2 1 >>
06 级数求和:symsum(f,n,a,b)
--- 级数求和:symsum(f,n,a,b):f为一个级数的通项,是一个符号表达式,求自变量n为从a到b的通项和;
其中inf可表示无穷大
>> f=n f = n >> symsum(f,n,1,n) ans = (n*(n + 1))/2 >> symsum(f,n,1,10) ans = 55 >> f=1/n^2 f = 1/n^2 >> symsum(f,n,1,inf) ans = pi^2/6 >>
07 求极限:limit(f,x,a)
--- 某点极限: limit(f,x,a) --- 某点左极限:limit(f,x,a,'left') --- 某点右极限:limit(f,x,a,'right') --- 无穷极限: limit(f,x,inf) --- 正无穷极限:limit(f,x,+inf) --- 负无穷极限:limit(f,x,-inf)
>> f=sin(x)/x f = sin(x)/x >> limit(f,x,0) ans = 1 >> limit(f,x,0,'right') ans = 1 >> limit(f,x,0,'left') ans = 1 >> limit(f,x,inf) ans = 0 >> limit(f,x,+inf) ans = 0 >> limit(f,x,-inf) ans = 0 >>
08:求导数:diff(f,x,n)
--- diff(f,x,n) 表示函数f对自变量x求n阶导数
>> f=x^2+exp(x)+log(x)+sin(x)+cos(x) f = cos(x) + exp(x) + log(x) + sin(x) + x^2 >> diff(f,x,2) ans = exp(x) - cos(x) - sin(x) - 1/x^2 + 2 >>
09 泰勒展开:taylor(f,x,a,'Order',n)
--- taylor(f,x,a,'Order',n) 表示函数f在自变量x=a处的泰勒展开式,n为展开的阶数
>> f=exp(x) f = exp(x) >> taylor(f,x,0,'Order',3) ans = x^2/2 + x + 1 >> taylor(f,x,1,'Order',3) ans = exp(1) + exp(1)*(x - 1) + (exp(1)*(x - 1)^2)/2 >>
10 求积分:int(f,x,a,b)
--- int(f,x) 表示函数f对自变量x的不定积分 --- int(f,x,a,b) 表示函数f对自变量x从a到b的定积分
>> f=sin(x) f = sin(x) >> int(f,x,0,pi) ans = 2 >> int(f,x) ans = -cos(x) >>
##########################
标签:---,limit,matlab,exp,ans,符号计算,inf,sin 来源: https://www.cnblogs.com/igoodful/p/14770704.html