1)
∫0π/4xsinxdx=−xcosx∣0π/4+∫0π/4cosxdx=
=−xcosx∣0π/4+sinx∣0π/4=−42π+21=0.152
2)
f(x)=xsinx
I=(b−a)2f(a)+f(b)=4π2⋅42π=0.436
3)
for n = 2:
I=8π(2f(0)+f(π/8)+2f(π/8)+f(π/4))=8π(πsin(π/8)/8+πsin(π/4)/8)=0.021
for n = 4:
I=16π(2f(0)+f(π/16)+2f(π/16)+f(π/8)+2f(π/8)+f(3π/16)+2f(3π/16)+f(π/4))=
=16π(πsin(π/16)/16+πsin(π/8)/8+3πsin(3π/16)/16+πsin(π/4)/8)=
=0.616(0.012+0.048+0.104+0.88)=0.155
relative error:
for single application:
0.1520.436−0.152=1.87=187%
for n = 2:
0.1520.152−0.021=0.86=86%
for n = 4:
0.1520.155−0.152=0.02=2%
Comments