永发信息网

有ex 又有x的方程的根怎么求

答案:2  悬赏:40  手机版
解决时间 2021-03-01 22:23
  • 提问者网友:像風在裏
  • 2021-03-01 02:07
有ex 又有x的方程的根怎么求
最佳答案
  • 五星知识达人网友:风格不统一
  • 2021-03-01 02:54
由ex-x-2=0得ex=x+2,令y=ex,y=x+2
在同一坐标系中画出y=ex与y=x+2的图象如图所示.
由图象可知y=ex与y=x+2有两个交点,
故方程ex-x-2=0在实数范围内有两解.
全部回答
  • 1楼网友:躲不过心动
  • 2021-03-01 04:22
程序代码: #include<iostream> #include<math.h> using namespace std; double algorithe(double ,double); double algorithe(double); int main() { double a=2,b=0; algorithe(0.0,2.0); return 0; } double algorithe(double x,double y) { if(algorithe((y+x)/2)>=0&&algorithe((y+x)/2)<pow(10,-6)) { cout<<(y+x)/2<<endl; return 1; } if(algorithe((y+x)/2)>=pow(10,-6)) y=(x+y)/2; if(algorithe((y+x)/2)<0.0) x=(x+y)/2; algorithe(x,y); return 0; } double algorithe(double x) { return exp(x)+x-2; } 采用的是二分法。
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯