SUNY Geneseo Department of Mathematics
Wednesday, February 25
Math 222 01
Spring 2015
Prof. Doug Baldwin
> xs = c( 0, pi/4, pi/2, 3*pi/4, pi )
> ys = sin( xs )
> coeffs = c( 1, 4, 2, 4, 1 )
> ys * coeffs
[1] 0.000000e+00 2.828427e+00 2.000000e+00 2.828427e+00 1.224647e-16
> sum( ys * coeffs )
[1] 7.656854
> (pi/12) * sum( ys * coeffs )
[1] 2.00456
> M = 1
> M * (pi)^5 / (180*4^4)
[1] 0.006641052