exp的定积分如何求:计算expx函数从0到1的定积分
exp的定积分如何求:计算expx函数从0到1的定积分double a=0 b=1 x h F=0;system("title 计算定积分");using namespace std;int main(){
(一)程序代码:
#include<iostream>
#include<cmath>
#define N 100
using namespace std;
int main()
{
system("title 计算定积分");
double a=0 b=1 x h F=0;
h=(b-a)/N;
x=(h-a)/2;
while(x<=b)
{
F=F exp(x)*h;
x=x h;
}
cout<<"e^x从"<<a<<"到"<<b<<"的定积分:"<<F<<endl;
return 0;
}
(二)程序运行结果:
(三)函数exp(x)从0到1定积分的几何意义