1. 求方程xx2 1 x) x2 1 0.5x 0的正根。
解:syms x;
2. 求满足m ln(1 n)>100的最小m 第2题
n 0
解; y=0;n=0;
while y<100
n=n+1;
y=y+log(n);
end
m=n-1
3.
已知函数f(x)=x 2 在(-2, 2)内有两个根。取步长h=0.05, 通过计算函数值求得函数的最小值点和两个根的近似解。(提示:求近似根等价于求函数绝对值的最小值点)
解;x=-2:0.05:2;
y=x.^4-2.^x;
ymin=min(y);
[imin,jmin]=find(y==ymin);
xmin=x(imin,jmin)
ymin=y(imin,jmin)
x1=-2:0.05:x(imin,jmin);
y1=abs(x1.^4-2.^x1);
y1min=min(y1);
[i1min,j1min]=find(y1==y1min);
x1min=x1(i1min,j1min)
y1min=y1(i1min,j1min)
x2=x(imin,jmin):0.05:2;
y2=abs(x2.^4-2.^x2);
y2min=min(y2);
% [i2min,j2min]=find(y2==y2min);
% x2min=x2(i2min,j2min)
% y2min=y2(i2min,j2min)
%第4题
% [x,y]=solve('(x-2)^2+(y+2*x-3)^2=5, 18*(x-3)^2+y^2=36 '
4. (椭园的交点) 两个椭圆可能具有0~4个交点,求下列两个椭园的所有交点坐标
(x - 2) 2 + (y - 3 + 2x) 2 = 5
2 (x-3)2 + (y/3) 2 = 4
[x,y]=solve('(x-2)^2+(y+2*x-3)^2=5, 18*(x-3)^2+y^2=36 ') 4x