SUNY Geneseo Department of Mathematics
Tuesday, November 11
Math 221 10
Fall 2014
Prof. Doug Baldwin
Endpoints | f′(t) | f′(midpoint) |
---|---|---|
0.0 | 0.0 | |
0.5 | 0.25 | 0.0625 |
1.0 | 1.0 | 0.5625 |
1.5 | 2.25 | 1.5625 |
2.0 | 4.0 | 3.0625 |
> x = seq( 0, 2, length = 5 )
> x
[1] 0.0 0.5 1.0 1.5 2.0
> x[2]
[1] 0.5
> x[2:5]
[1] 0.5 1.0 1.5 2.0
> x[1:4]
[1] 0.0 0.5 1.0 1.5
> m = ( x[1:4] + x[2:5])/2
> m
[1] 0.25 0.75 1.25 1.75
> y = m^2
> y
[1] 0.0625 0.5625 1.5625 3.0625
> y * 0.5
[1] 0.03125 0.28125 0.78125 1.53125
> sum( y * 0.5 )
[1] 2.625
> x = seq( 0, 2, length = 5001 )
> m = ( x[1:5000] + x[2:5001])/2
> y = m^2
> dx = 2/5000
> sum( y * dx )
[1] 2.666667