2. Write a computer code to implement the Composite Trapezoidal Rule quadrature
$T_h[f] = h\left(\frac{1}{2}f(x_0) + f(x_1) + ... + f(x_{N-1}) + \frac{1}{2}f(x_N)\right)$, (1)
to approximate the definite integral
$I[f] = \int_a^b f(x)dx$,
(2)
using the equally spaced points $x_0 = a$, $x_1 = x_0 + h$, $x_2 = x_0 + 2h$, ..., $x_N = b$, where
$h = (b - a)/N$. Make sure that all your codes have a preamble which describes the purpose
of the code, all the input variables, the expected output, your name, and the date of the last
time you modified the code.