目录
实验四:微积分基本运算
练习一
练习二
练习三
1.求莱昂纳多(Leonardo )方程的根。
clc;
clear;
p=[1 2 10 -20];
x=roots(p)
2. 求方程 的所有根。
clc;
clear;
p=[1 1 -4 1];
x=roots(p)
3. 求方程的根。
我们要先观察该函数图像,确定其零点大致在哪个区间内,才方便使用fzero函数。
clc;
clear;
f=inline('exp(x)+10*x-2');
ezplot('exp(x)+10*x-2')
x=fzero(f,0)
4. 求方程 的根。
clc;
clear;
p=[1 0 0 0 0.1 -32];
x=roots(p)
5. 求下列函数在指定区间上的最大值和最小值。
(1) ,
clc;
clear;
f=inline('sin(x)^3+cos(x)^3');
g=inline('-sin(x)^3-cos(x)^3');
[x,min]=fminbnd(f,pi/6,3*pi/4);
[x0,max]=fminbnd(g,pi/6,3*pi/4);
fprintf('该函数的最小值为%f\n该函数的最大值为%f',min,-max)
(2) .
clc;
clear;
f=inline('(x-1)/(x+4)');
g=inline('-(x-1)/(x+4)');
[x,min]=fminbnd(f,0,4);
[x0,max]=fminbnd(g,0,4);
fprintf('该函数的最小值为%f\n该函数的最大值为%f',min,-max)
1. 因式分解
syms x
f=x^6-1;
factor(f)
ans =[x - 1, x + 1, x^2 + x + 1, x^2 - x + 1]
2. 验证恒等式
syms x y
f=sin(x+y);
expand(f)
ans =cos(x)*sin(y) + cos(y)*sin(x)
3.化解表达式.
syms x y
f=sin(x)^2+2*sin(x)*cos(x)+cos(x)^2-1;
simplify(f)
ans =sin(2*x)
4. 设 试提取该表达式的分子和分母.
clc;
clear;
syms x
f=3/2*x^2+1/5;
[zi,mu]=numden(f);
disp(mu)
disp(zi)
10
15*x^2 + 2
5. 设f=exp(x^2)+sinxcos2x,定义f分别为数值函数和符号函数,求f(2),f(1.5).
clc;
clear;
syms x
f=inline('exp(x^2)+sin(x)*cos(2*x)');
f(2)
f(1.5)
x0=0:0.01:10;
f0=exp(x0.^2)+sin(x)*cos(2*x0);
f(2) = 54.0038
f(1.5) =8.5002
6. 设g=x^2+2*exp(x)+exp(-x),求g',g",并绘制g',g"的图形.
clear;
syms x
g=x^2+2*exp(x)+exp(-x);
g1=diff(g)
g2=diff(g,2)
subplot(1,2,1)
ezplot(g1)
subplot(1,2,2)
ezplot(g2)
g1 =2*x - exp(-x) + 2*exp(x)
g2 =exp(-x) + 2*exp(x) + 2
7. 求和:
(1) ;
clc;
clear;
syms n
f=1/n^2;
ans=symsum(f,n,1,inf)
ans =pi^2/6
(2);
clc;
clear;
syms n x
f=x^n;
symsum(f,n,0,inf)
ans =piecewise(1 <= x, Inf, abs(x) < 1, -1/(x - 1))
8. 求以下方程组的解:
其中a,b是参数,x,y是变量.
clc;
clear;
syms x y a b
out=solve(x^2-y==a,x+y==b,[x,y])
out.x= (4*a + 4*b + 1)^(1/2)/2 - 1/2
- (4*a + 4*b + 1)^(1/2)/2 - 1/2
out.y= b - (4*a + 4*b + 1)^(1/2)/2 + 1/2
b + (4*a + 4*b + 1)^(1/2)/2 + 1/2
9.画出下面两个椭圆的图形,并求出所有交点的坐标:
clc;
clear;
ezplot('(x-2)^2+(y+2*x-3)^2-5');
hold on
ezplot('18*(x-3)^2+y^2-36');
syms x y
f1=((x-2)^2+(y+2*x-3)^2==5);
f2=18*(x-3)^2+y^2==36;
[x1,y1]=solve(f1,f2,[x,y]);
for i=1:4
fprintf('(%f,%f) ',x1(i),y1(i));
end
(1.658066,1.893637)
(1.736226,-2.692907)
(4.028734,-4.117127)
(3.482882,-5.639401)
1.求下列函数的极限:
syms x
f=(x^3-x^2+x/2)*exp(1/x)-sqrt(x^6+1);
limit(f,x,inf)
ans=1/6;
syms x
f=(x+2)^(x+2)*(x+3)^(x+3)/(x+5)^(2*x+5);
limit(f,x,inf)
ans= exp(-5);
syms x
f=exp(log((sin(1/x)+cos(1/x)))*x);
limit(f,x,inf)
ans=exp(1);
(4)
syms n
f=1/exp(log(log(log(n)))*log(n));
limit(f,n,inf)
ans =0
推荐下一篇文章:数学实验第三版(主编:李继成 赵小艳)课后练习答案(四)(4)(5)(6)https://blog.csdn.net/2301_80199493/article/details/136006451?csdn_share_tail=%7B%22type%22%3A%22blog%22%2C%22rType%22%3A%22article%22%2C%22rId%22%3A%22136006451%22%2C%22source%22%3A%222301_80199493%22%7D
本文由作者自己创作,由于时间原因,难免出现些许差错,还望大家多多批评指正。创作不易,希望大家多多鼓励。