porfa ayudenme°°°°°°° a..calcular la suprficie bajo una curva(integracion)

JONATHAN_INSANO
27 de Abril del 2008
calcular la suprficie bajo una curva(integracion); dados los limites y la funcion
mi correo es [email protected]
gracias

Noel Solw
27 de Abril del 2008
// program k2c8.CPP - page 40
// integral calculation - rectangles method Ű 2 7
// ≥ xż dx = ńńń = 2.333....
// ű 1 3
// c++ exercices book - dr. gershon kagan (first edition : 2001)
// arie wlos - 8/7/2001
// written in Borland CPP ver 3.1

#include <conio.h>
#include <iostream.h>
#include <iomanip.h>
#include <math.h>

double f(double x)
{
return x*x;
} // f

void main()
{
clrscr();
cout.setf(ios::fixed);
cout << setprecision(6);
cout << "integral calculation - rectangles method Ű 2 7" << endl;
cout << " ≥ xż dx = ńńń = "
<< "2.333...." << endl;
cout << " ű 1 3";
cout << endl << endl;
for(long n = 10; n <= 1000000; n *= 10)
{
float dx = 1.0/n;
double sum = 0;
for(double x = 1; x < 2; x += dx)
sum += f(x);
sum *= dx;
cout << "integral = " << setw(10) << sum << " n = "
<< setw(8) << n << endl;
}
cout << endl << "end of program - good bye ! ! ! " << endl;
getch();
} // MAIN

/*
integral calculation - rectangles method Ű 2 7
≥ xż dx = ńńń = 2.333....
ű 1 3

integral = 2.185 n = 10
integral = 2.35835 n = 100
integral = 2.331834 n = 1000
integral = 2.333583 n = 10000
integral = 2.333358 n = 100000
integral = 2.333336 n = 1000000

end of program - good bye ! ! !
*/