Some open rules

The open NC rule with $\bbox[3pt, border: 3pt solid var(--emphColor)]{n + 1} = 1$, the is the midpoint rule $$\int_a^b f(x) dx = (b - a) f(\frac{a+b}{2}).$$
Please refer to the supplementary notes for more examples.
The NC rules provide a unified framework for thinking about and generalizing the classical approximation formulas we learned in calculus.

Issues and enhancements

It's natural to think that sampling the function at more nodes might help us obtain a better area approximation.
However, we might not want to use higher degree polynomials, since these tend to oscillate pretty wildly.
Instead, we'll break up the interval $[a, b]$ into small pieces and apply our rule on each piece.

Composite NC

We obtain the composite version of an NC rule by subdividing the interval $[a, b]$ into subintervals $[x_i, x_{i+1}]$, applying the rule on each piece, and summing the results.
The trapezoid rule approximates $$\int_c^d f(x) dx = \frac{d-c}{2}(f(c) + f(d)).$$
Set $n \geq 1$ and take $x_i = a + ih$, for $i = 0, 1, \ldots, n$, with $h = (b-a)/n$. The composite trapezoid rule specifies $$\int_a^b f(x) dx = \sum_{i=0}^{n-1} \int_{x_i}^{x_{i+1}} f(x) dx$$
The trapezoid rule approximates $$\int_c^d f(x) dx = \frac{d-c}{2}(f(c) + f(d)).$$
Set $n \geq 1$ and take $x_i = a + ih$, for $i = 0, 1, \ldots, n$, with $h = (b-a)/n$. The composite trapezoid rule specifies $$\int_a^b f(x) dx \color{var(--emphColor)}{\approx} \sum_{i=0}^{n-1} \frac{x_{i+1}-x_{i}}{2}(f(x_i) + f(x_{i+1}))$$
The trapezoid rule approximates $$\int_c^d f(x) dx = \frac{d-c}{2}(f(c) + f(d)).$$
Set $n \geq 1$ and take $x_i = a + ih$, for $i = 0, 1, \ldots, n$, with $h = (b-a)/n$. The composite trapezoid rule specifies $$\int_a^b f(x) dx \color{var(--emphColor)}{\approx} {h \over 2}\bigg(f(a) + 2\sum_{i=0}^{n-1} f(x_i) + f(b)\bigg)$$
The value $f(x_i)$ appears twice in the sum for each interior point $x_\color{var(--emphColor)}{1}, \ldots, x_\color{var(--emphColor)}{n-1}$, since each of these nodes is both the start and the end of some subinterval.

More examples

Please consult the supplementary notes for more examples.
We may track down the error term in our quadrature rules by integrating the remainder term guaranteed by our interpolation error theorem.

D.O.P.

The DOP provides another way of assessing the quality of our area approximations.
The degree of precision (DOP) of a quadrature rule is the largest integer $k$ such that the rule can integrate exactly every polynomial of degree at most $k$.
The DOP of a quadrature rule is $k$ if $$\int_a^b p(x) dx \color{var(--emphColor)}{=} \sum_{i = 0}^n w_i p(x_i)$$ for every polynomial $p$ of degree at most $k$, and there exists a polynomial $q$ of degree $k+1$ such that the quadrature rule does not integrate $q$ exactly.

DOP

Let $I_n(f) = \sum_i w_i f(x_i)$ denote the NC quadrature rule (open or closed) with $\bbox[3pt, border: 3pt solid var(--emphColor)]{n + 1}$ nodes.
If $n$ is even and $f$ has $n+2$ continuous derivatives, then the degree of precision is $n+1$.
If $n$ is odd and $f$ has $n+1$ continuous derivatives, then the degree of precision is $n$.
In the next module, we'll learn how to almost double the DOP with the same number of nodes, by choosing the nodes optimally.
Congratulations! You reached the end of this lecture.