(a)

V. 0.00

(b)

V. A=1.90

h=pi/4

prosentteina 5%

A = (-3.4121464408724096, 2.8424015431477025)
B = (2.0278535591275904, 2.8424015431477025)
C = (-2.9779253920844173, -2.273490868815492)
D = (2.8619482174550437, -2.273490868815492)
f(x) = cos(x)
a = Integral(f, 0, π)
b = TrapezoidalSum(f, 0, π, 4)
g(x) = abs(f(x))
c = TrapezoidalSum(g, 0, π, 4)
d: (π / 4 * ((1 / 2 * g(0)) + g(π / 4) + g(π / 2) + g(((3 * π)) / 4) + (1 / 2 * g(π))))
tarkka = Integral(g, 0, π)
virhe: (2 - 1.9) / 2