Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- double f(double x){
- double a = sqrt(0.6*x+1.7)/(2.1*x + sqrt(0.7*x*x + 1));
- return a;
- }
- int main(){
- double integral = 0;
- double a = 1.2, b = 2;
- double n = 1;
- double h = (b-a)/n;
- double x = a+h/2;
- while(x<b){
- integral += f(x);
- x+=h;
- }
- std::cout << integral << std::endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement