Concept:
Trapezoidal rule states that for a function y = f(x)
x
|
x0
|
x1
|
x2
|
x3
|
……
|
xn
|
y
|
y0
|
y1
|
y2
|
y3
|
……
|
yn
|
xn = x0 + nh, where n = Number of sub-intervals
h = step-size
\(\mathop \smallint \nolimits_{{x_0}}^{{x_0} + nh} f\left( x \right)dx = \frac{h}{2}\left[ {\left( {{y_0} + {y_n}} \right) + 2\left( {{y_1} + {y_2} + {y_3} + \ldots + {y_{n - 1}}} \right)} \right]\) …1)
For a trapezoidal rule, the number of sub-intervals must be a multiple of 1.
Calculation:
x = 1, y (0) = 1×ln1 = 0
x = 2, y (n) = 2ln2
\(\mathop \smallint \limits_1^2 {\rm{x}}\ln {\rm{xdx}} = \frac{1}{2}\left[ {0 + 2\ln 2} \right] = \ln 2 = 0.69\)
Key Points:
Apart from the trapezoidal rule, other numerical integration methods are;
A) Simpson’s one-third rule
B) Simpson’s three-eighth rule
A) Simpson’s one-third rule:
For applying this rule, the number of subintervals must be a multiple of 2.
\(\mathop \smallint \nolimits_{{x_0}}^{{x_0} + nh} f\left( x \right)dx = \frac{h}{3}\left[ {\left( {{y_0} + {y_n}} \right) + 4\left( {{y_1} + {y_3} + {y_5} + \ldots + {y_{n - 1}}} \right) + 2\left( {{y_2} + {y_4} + {y_6} + \ldots + {y_{n - 2}}} \right)} \right]\) ..2)
B) Simpson’s three-eighths rule:
For applying this rule, the number of subintervals must be a multiple of 3.
\(\mathop \smallint \nolimits_{{x_0}}^{{x_0} + nh} f\left( x \right)dx = \frac{{3h}}{8}\left[ {\left( {{y_0} + {y_n}} \right) + 3\left( {{y_1} + {y_2} + {y_4} + {y_5} + \ldots } \right) + 2\left( {{y_3} + {y_6} + \ldots } \right)} \right]\) …3)