Concept:
\(I = \mathop \smallint \limits_a^b f\left( x \right)\;dx\)
\({\rm{Number\;of\;intervals}} = \frac{{{\rm{b}} - {\rm{a}}}}{{\rm{h}}}{\rm{\;}}\)
where,
b is the upper limit, a is the lower limit, h is the step size
According to the trapezoidal rule
\(\mathop \smallint \limits_{\rm{a}}^{\rm{b}} {\rm{f}}\left( {\rm{x}} \right){\rm{dx}} = \frac{{\rm{h}}}{2}\left[ {{{\rm{y}}_{\rm{o}}} + {{\rm{y}}_{\rm{n}}} + 2\left( {{{\rm{y}}_1} + {{\rm{y}}_2} + {{\rm{y}}_3}{\rm{\;}} \ldots } \right)} \right]\)
Here, the interval [a, b] is divided into n number of intervals of equal width h.
It fits for a 1-degree polynomial.
Calculation
Given, Upper limit b = 0.5,
Lower limit a = 0, divided into 5 divisions
Step size (h) = (0.5 - 0)/5 = 0.1
f(x) = 10x - 20x2
x
|
0
|
0.1
|
0.2
|
0.3
|
0.4
|
0.5
|
f(x)
|
0
|
0.8
|
1.2
|
1.2
|
0.8
|
0
|
\(\mathop \smallint \limits_{\rm{a}}^{\rm{b}} {\rm{f}}\left( {\rm{x}} \right){\rm{dx}} = \frac{{\rm{h}}}{2}\left[ {{{\rm{y}}_{\rm{o}}} + {{\rm{y}}_{\rm{5}}} + 2\left( {{{\rm{y}}_1} + {{\rm{y}}_2} + {{\rm{y}}_3}+ {{\rm{y}}_4}{\rm{\;}}} \right)} \right]\)
\(\mathop \smallint \limits_{\rm{a}}^{\rm{b}} {\rm{f}}\left( {\rm{x}} \right){\rm{dx}} = \frac{{\rm{h}}}{2}\left[ {{{\rm{y}}_{\rm{o}}} + {{\rm{y}}_{\rm{5}}} + 2\left( {{{\rm{y}}_1} + {{\rm{y}}_2} + {{\rm{y}}_3}+ {{\rm{y}}_4}{\rm{\;}}} \right)} \right]\)
\(I = \frac{1}{2} \times \left[ {\left( {0 + 0} \right) + 2\left( {0.8 + 1.2 + 1.2 + 0.8} \right)} \right]\)
I = 0.4