实验五matlab符号计算
实验 5 符号计算 教师评分班级 学号 姓名实验日期 2014 年 6 月 17 日 星期 二 第 1 至 2 节课实验地点实验目的1. 掌握定义符号对象的办法2. 掌握符号表达式的运算法则以及符号矩阵运算3. 掌握求符号函数极限及导数的方法4. 掌握求符号函数定积分和不定积分的方法5. 掌握级数求和的方法6. 掌握将函数展开围泰勒级数的方法7. 掌握微分方程符号求解8. 掌握代数方程符号求解的方法指导教师教师评语实验内容1. page372 第 1 题x=sym( x );y=sym( y );x=6;y=5;z=(x+1)/(sqrt(3+x)-sqrt(y))显示结果:z =9.16312. page372 第 2 题(1)syms x y;f=x^4-y^4;factor(f)(2)factor(sym( 5135 ))显示结果:(1)ans =(x-y)*(x+y)*(x^2+y^2)(2)ans =(5)*(13)*(79)3.page372 第 3 题(1)syms B1 B2s=sin(B1).*sin(B2)-cos(B1).*cos(B2);simple(s)(2)syms x y;s=(4*x^2+8*x+3)/(2*x+1);simple(s)显示结果:(1)ans =-cos(B1+B2)(2)ans =2*x+34.page372 第 5 题(1)syms x;f=(x.*(exp(sin(x)+1)-2.*(exp(tan(x)-1))))/sin(x)^3;limit(f)(2)syms x;f=(sqrt(pi)-sqrt(acos(x)))/(sqrt(x+1));limit(f,x,-1, right )(3)syms x;f=(1-cos(2*x))/x;diff(f)diff(f,x,2)(4)A=sym( [a^x,t^3;t*cos(x),log(x)] )C=det(A)diff(C)(5)syms x y;f=(x^2-2*x).*exp(-x^2-y^2-x*y);diff(f,x)显示结果:(1)ans = Inf(2)ans = -Inf(3)ans =2*sin(2*x)/x-(1-cos(2*x))/x^2ans =4*cos(2*x)/x-4*sin(2*x)/x^2+2*(1-cos(2*x))/x^3(4)ans =a^x*log(a)*log(x)+a^x/x+t^4*sin(x)(5)ans =(2*x-2)*exp(-x^2-y^2-x*y)+(x^2-2*x)*(-2*x-y)*exp(-x^2-y^2-x*y)5. page372 第 6 题(1)x=sym( x );f=1/(1+x^4+x^8);int(f);g=simple(ans)(2)x=sym( x );f=1/(asin(x))^2.*sqrt(1-x^2);int(f)(3)f=(x^2+1)/(x^4+1);int(f,0,+inf)(4)f=exp(x).*(1+exp(x))^2;int(f,0,log(2))g=simple(ans)显示结果:(1)g =1/12*3^(1/2)*(2*atan(1/3*(1+2*x)*3^(1/2))+2*atan(1/3*(2*x-1)*3^(1/2))-log(x^2-3^(1/2)*x+1)+log(x^2+3^(1/2)*x+1))(2)ans =int(1/asin(x)^2*(1-x^2)^(1/2),x)(3)ans =1/2*pi*2^(1/2)(4)g =-7/3+exp(6243314768165359/9007199254740992)+exp(6243314768165359/4503599627370496)+1/3*exp(18729944304496077/9007199254740992)6.page373 第 1 题(1)n=sym( n );s1=symsum(1/(2*n-1),n,1,10)(2)n=sym( n );s1=symsum(n^2*x^(n-1),1,inf)n=sym( n );s1=symsum(n^2/5^n,1,inf)显示结果:(1)s1 = 31037876/14549535(2)s1 =sum(n^2*x^(n-1),x = 1 Inf)s1 =15/327.page373 第 2 题f=log(x);显示结果:ans =taylor(f,6,1) x-1-1/2*(x-1)^2+1/3*(x-1)^3-1/4*(x-1)^4+1/5*(x-1)^58.page373 第 3 题(1)x=solve( log(1+x)-5/(1+sin(x))=2 , x )g=simple(ans)(2)x=solve( x^2+9*(sqrt(x+1))-1 , x )g=simple(ans)(3)x=solve( 3*x*exp(x)+5.*sin(x)-78.5 , x )g=simple(ans)(4)[x y]=solve( sqrt(x^2+y^2)-100 , 3*x+5*y-8 , x,y )显示结果:(1)g =5*x-137/60-5*x^2+10/3*x^3-5/4*x^4+1/5*x^5(2)g =5*x-137/60-5*x^2+10/3*x^3-5/4*x^4+1/5*x^5(3)g =5*x-137/60-5*x^2+10/3*x^3-5/4*x^4+1/5*x^5(4)x =12/17-10/17*21246^(1/2)12/17+10/17*21246^(1/2)y =20/17+6/17*21246^(1/2)20/17-6/17*21246^(1/2)9.page373 第 5 题[x,y,z]=dsolve( Dx=2*x-3*y+3*z , Dy=4*x-5*y+3*z , Dz=4*x-4*y+2*z , t )显示结果:x =C2*exp(-t)+C3*exp(2*t)y =C2*exp(-t)+C3*exp(2*t)+exp(-2*t)*C1z =C3*exp(2*t)+exp(-2*t)*C1