Use the left and right arrow keys to navigate the presentation forward and backward respectively. You can also use the arrows at the bottom right of the screen to navigate with a mouse.
FAIR USE ACT DISCLAIMER: This site is for educational purposes only. This website may contain copyrighted material, the use of which has not been specifically authorized by the copyright holders. The material is made available on this website as a way to advance teaching, and copyright-protected materials are used to the extent necessary to make this class function in a distance learning environment. The Fair Use Copyright Disclaimer is under section 107 of the Copyright Act of 1976, allowance is made for “fair use” for purposes such as criticism, comment, news reporting, teaching, scholarship, education and research.
In basic calculus, we learn about various types of functions that have easy-to-solve integrals with closed form, e.g.,
However, there are far more integrals that cannot be solved this way than can be solved by hand.
Recall, when we define a Riemann sum, this is very similar to how a density estimator like a histogram or kernel density estimator works.
We will suppose that there is some function \[ f:[a,b] \rightarrow \mathbb{R} \] that we wish to integrate over the range above.
If \( f(x) \) can be evaluated at any given point \( x\in [a,b] \), we can take a partition of the interval \( [a,b] \) as follows:
\[ \begin{align} I_i = [x_{i-1}, x_i] & & \cup_{i=1}^n I_i = [a,b] \end{align} \]
Let us finally write the length of the \( i \)-th interval as \( \Delta_i = x_{i} - x_{i-1} \), and denote the collection of all the intervals and the representative points as \( \mathcal{I}_n \);
\[ \begin{align} S\left(\mathcal{I}_n\right) = \sum_{i=1}^n f\left(x_i^\ast\right) *\Delta_i \end{align} \]
Courtesy of I, KSmrq via Wikimedia Commons CC BY-SA
Although the method of Riemann sums discussed is relatively simple to implement in a computer language, it suffers from disadvantages like histograms do.
Like we considered with the kernel densities, we may instead use a smoothing function that will give weight to values of \( f(x) \) away from the representative point \( x_i^\ast \) for the interval \( I_i \).
For reasons that won't be considered directly in this class, polynomials can make very good approximations of arbitrary functions within certain bounds.
Polynomials are also very easy to integrate, so that if we can approximate \( f \) well by some polynomial \( p_n(x) \), we can get a faster converging sum by this approximation.
This idea is known as quadrature.
Let's suppose that a partition \( I_n \) of \( [a,b] \) is given with endpoints \( a=x_0 < \cdots < x_n = b \).
We will call the class of basis polynomials \( P_n \) which will be a collection of all polynomials \( p_n \in P_n \) for which \[ \begin{align} p_n(x) = \sum_{i=1}^n x^i c_i & & p_n(x_i) = f(x_i) \end{align} \] for some coefficient values \( c_i \).
The goal then is to choose some such polynomial \( p_n \) that gives a good approximation of \( f(x) \) over each sub-interval in the partition.
We will define a generic interpolation polynomial as follows:
\[ \begin{align} L_k(x) = \prod_{i=0,i\neq k}^n \frac{x - x_i}{x_k - x_i} \end{align} \]
where \( x_i \) are the endpoints of the partition and the product goes over all terms \( x_i \) except for \( x_k \) to avoid a division by zero.
Using the interpolation polynomials, we construct the Lagrange basis polynomial \( p_n \) as follows:
\[ \begin{align} p_n(x) = \sum_{i=1}^n f(x_i)L_i(x) \end{align} \]
so that this evaluates to \( f(x_i) \) at each endpoint in the partition, but it interpolates between the points with better accuracy than the flat Riemann sum.
We will need to now make a distinction between the theoretical, exact integral and its approximation:
\[ \begin{align} \mathcal{I}(f) = \int_{a}^b f(x) \mathrm{d}x. \end{align} \]
\[ \begin{align} \mathcal{I}_n(f) =& \int_a^b p_n(x) \mathrm{d}x\\ =&\sum_{i=1}^n \int_{a}^b f(x_i) L_i(x) \mathrm{d}x \end{align} \] where each of the individual polynomials can be easily evaluated, and a sum taken over the results.
In a proper numerical analysis course, we would study the rate at which,
\[ \vert \mathcal{I}(f) - \mathcal{I}_n(f) \vert \rightarrow 0 \] as the partition is refined, \( n\rightarrow\infty \).
Developing methods like this, showing the precision of these methods, and the rate at which we can increase the precision by taking a refinement of the partition, is an entire field of its own;
In the above, our Newton-Cotes rule describes actually a general family of different approximations we can make, some of which are taught in basic calculus.
Consider again the Newton-Cotes rule as follows:
\[ \begin{align} \mathcal{I}_n(f) = (b-a) \sum_{i=1}^n f(x_i) \alpha_i & & \alpha_i = \frac{1}{b-a}\int_{a}^b L_i(x) \mathrm{d}x \end{align} \]
Suppose the nodes \( x_i \) are equidistant in \( [a, b] \), i.e.,
In this particular case, this is the “closed” Newton-Cotes rule for which \( \alpha_k \) can be computed explicitly up to \( n=7 \);
The classical trapezoid rule is actually one of the Newton-Cotes techniques, we consider the following.
\[ \begin{align} L_0(x) &= \prod_{i=1}^1 \frac{x - x_i}{x_k - x_i} = \frac{x - x_1}{x_0 - x_1} = \frac{x - b}{-\left(b-a\right)} \\ L_1(x) &= \prod_{i=0}^0 \frac{x - x_i}{x_k - x_i} = \frac{x - x_0}{x_1 - x_0} = \frac{x -a}{\left(b - a\right)} \end{align} \]
\[ \begin{align} \alpha_0 &= \frac{1}{b-a} \int_a^b L_0(x) \mathrm{d}x = \frac{x^2 - 2bx}{-2(b-a)^2} \big\vert_{a}^b = \frac{b^2 - 2b^2}{-2\left(b-a\right)^2} - \frac{a^2 - 2ab}{-2\left(b-a\right)^2} = \frac{1}{2} \\ \alpha_1 &= \frac{1}{(b-a)} \int_a^b L_1(x) \mathrm{d}x = \frac{x^2 - 2ax}{2(b-a)^2} \big\vert_{a}^b = \frac{b^2 - 2ab}{2 \left(b-a\right)^2} - \frac{a^2 - 2a^2}{\left(b-a\right)^2} = \frac{1}{2} \end{align} \]
\[ \mathcal{I}_1 (f) = \left(b - a\right) \frac{f(b) + f(a)}{2}. \]