
The (left) rectangular rule is expressed as
|
| (1) |
| (2) |
| (3) |
|
|
|
|
|
| (5) |
| (6) |
|
|
| x | f(x) |
| 1 | 1 |
| 2 | 8 |
| 3 | 27 |
| 4 | 64 |
| 5 | 125 |
| 6 | 216 |
|
s=0;
for i=1:100
s=s+1.0/i;
end;
fprintf('sum=%f\n',s);
|
#include <stdio.h>
int main()
{
double s=0; int i;
for (i=1;i<100;i++) s=s + 1.0/i;
printf("sum=%f\n",s);
return 0;
}
|
|
| (10) |
|
For p < 1, it can be seen from the figure above that
|
|
|
| (14) |
| (15) |
| (16) |
|
|
|
|
|
|
|
| (17) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|