Deriving the first and second order Newton-Cotes formulas

In summary, the conversation discusses the Newton-Cotes formulas of order 1 and 2, which involve fitting cubic and quartic curves across known discrete points on a function, similar to Simpson's Rule. These formulas can be used to approximate definite integrals and are also known as the prismoidal method and Boole's rule.
  • #1
MarkFL
Gold Member
MHB
13,288
12
Much like Simpson's Rule, a.k.a. the prismoidal method, improves upon the trapezoidal method by fitting parabolic arcs across known discrete points on some function $f(x)$ rather than line segments, Newton-Cotes formulas of order 1 and 2 fit cubic and quartic curves across points on the curve.

Newton-Cotes formula order 1

First, we need to compute the definite integral:

\(\displaystyle \int_{-h}^h Ax^3+Bx^2+Cx+D\,dx\)

Applying the FTOC, we find:

\(\displaystyle \int_{-h}^h Ax^3+Bx^2+Cx+D\,dx=\left[\frac{Ax^4}{4}+\frac{Bx^3}{3}+\frac{Cx^2}{2}+Dx \right]_{-h}^h=\)

\(\displaystyle \left(\frac{Ah^4}{4}+\frac{Bh^3}{3}+\frac{Ch^2}{2}+Dh \right)-\left(\frac{A(-h)^4}{4}+\frac{B(-h)^3}{3}+\frac{C(-h)^2}{2}+D(-h) \right)=\)

\(\displaystyle \frac{2Bh^3}{3}+2Dh=\frac{2h}{3}\left(Bh^2+3D \right)\)

We will require that the cubic integrand pass through the points:

\(\displaystyle \left(-h,y_0 \right),\,\left(-\frac{h}{3},y_1 \right),\,\left(\frac{h}{3},y_2 \right),\,\left(h,y_3 \right)\)

From this, the following system of equations results:

\(\displaystyle y_0=-Ah^3+Bh^2-Ch+D\)

\(\displaystyle y_1=-\frac{Ah^3}{27}+\frac{Bh^2}{9}-\frac{Ch}{3}+D\)

\(\displaystyle y_2=\frac{Ah^3}{27}+\frac{Bh^2}{9}+\frac{Ch}{3}+D\)

\(\displaystyle y_3=Ah^3+Bh^2+Ch+D\)

From these equation, we find:

\(\displaystyle y_0-y_1-y_2+y_3=\frac{16}{9}Bh^2\)

\(\displaystyle Bh^2=\frac{9}{16}\left(y_0-y_1-y_2+y_3 \right)\)

We also find:

\(\displaystyle -y_0+9y_1+9y_2-y_3=16D\)

\(\displaystyle 3D=\frac{3}{16}\left(-y_0+9y_1+9y_2-y_3 \right)\)

Using these values, we find:

\(\displaystyle \int_{-h}^h Ax^3+Bx^2+Cx+D\,dx=\frac{2h}{3}\left(Bh^2+3D \right)=\frac{h}{4}\left(y_0+3y_1+3y_2+y_3 \right)\)

Now, suppose that some closed interval $[a,b]$, is partitioned into $n$ sub-intervals of equal width:

\(\displaystyle \Delta x=x_{k+1}-x_{k}=\frac{b-a}{n}\)

where $n$ is a multiple of 3.

Then on each sub-interval $\left[x_{k-3},x_k \right]$, where:

\(\displaystyle h=\frac{3\Delta x}{2}\)

the definite integral may be approximated by:

\(\displaystyle \int_{x_{k-3}}^{x_k} f(x)\,dx\approx\frac{3\Delta x}{8}\left(f\left(x_{k-3} \right)+3f\left(x_{k-2} \right)+3f\left(x_{k-1} \right)+f\left(x_{k} \right) \right)\)

Hence, we have found:

\(\displaystyle \int_a^b f(x)\,dx\approx\frac{3(b-a)}{8n}\left(f\left(x_{0} \right)+3f\left(x_{1} \right)+3f\left(x_{2} \right)+2f\left(x_{3} \right)+\cdots \right.\)

\(\displaystyle \;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\left.+2f\left(x_{n-3} \right)+3f\left(x_{n-2} \right)+3f\left(x_{n-1} \right)+f\left(x_{n} \right) \right)\)

This is also known as Simpson's 3/8 rule.

Newton-Cotes formula order 2

Now, let's proceed in a like manner to derive the second order Newton-Cotes formula. First we need to compute:

\(\displaystyle \int_{-h}^h Ax^4+Bx^3+Cx^2+Dx+E\,dx=\frac{2h}{15}\left(3Ah^4+5Ch^2+15E \right)\)

We will require that the quartic integrand pass through the points:

\(\displaystyle \left(-h,y_0 \right),\,\left(-\frac{h}{2},y_1 \right),\,\left(0,y_2 \right),\,\left(\frac{h}{2},y_3 \right),\,\left(h,y_4 \right)\)

From this, the following system of equations results:

\(\displaystyle y_0=Ah^4-Bh^3+Ch^2-Dh+E\)

\(\displaystyle y_1=\frac{Ah^4}{16}-\frac{Bh^3}{8}+\frac{Ch^2}{4}-\frac{Dh}{2}+E\)

\(\displaystyle y_2=E\)

\(\displaystyle y_3=\frac{Ah^4}{16}+\frac{Bh^3}{8}+\frac{Ch^2}{4}+\frac{Dh}{2}+E\)

\(\displaystyle y_4=Ah^4+Bh^3+Ch^2+Dh+E\)

From these equation, we find:

\(\displaystyle y_0-4y_1+6y_2-4y_3+y_4=\frac{3Ah^4}{2}\)

\(\displaystyle Ah^4=\frac{2}{3}\left(y_0-4y_1+6y_2-4y_3+y_4 \right)\)

We also find:

\(\displaystyle -y_0+16y_1-30y_2+16y_3-y_4=6Ch^2\)

\(\displaystyle Ch^2=\frac{1}{6}\left(-y_0+16y_1-30y_2+16y_3-y_4 \right)\)

Using these values, we find:

\(\displaystyle \int_{-h}^h Ax^4+Bx^3+Cx^2+Dx+E\,dx=\frac{2h}{15}\left(3Ah^4+5Ch^2+15E \right)=\frac{h}{45}\left(7y_0+32y_1+12y_2+32y_3+7y_4 \right)\)

And so, we ultimately find:

\(\displaystyle \int_a^b f(x)\,dx\approx\frac{2(b-a)}{45n}\left(7f\left(x_{0} \right)+32f\left(x_{1} \right)+12f\left(x_{2} \right)+32f\left(x_{3} \right)+14f\left(x_{4} \right)+\cdots\right.\)

\(\displaystyle \;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\left.+14f\left(x_{n-4} \right)+32f\left(x_{n-3} \right)+12f\left(x_{n-2} \right)+32f\left(x_{n-1} \right)+7f\left(x_{n} \right) \right)\)

This is also known as Boole's rule.
 
Last edited by a moderator:
Physics news on Phys.org
  • #2
Thanks @MarkFL! What math forum can we move this to?
 

1. What is the purpose of deriving the first and second order Newton-Cotes formulas?

The first and second order Newton-Cotes formulas are used to approximate the value of a definite integral. They provide a way to estimate the area under a curve by dividing it into smaller sections and using polynomial functions to approximate each section.

2. How do you derive the first and second order Newton-Cotes formulas?

To derive the first and second order Newton-Cotes formulas, you first divide the interval of integration into equal subintervals. Then, you use polynomial interpolation to approximate the function within each subinterval. Finally, you integrate the approximating polynomials to get the corresponding weights for each subinterval.

3. What is the difference between the first and second order Newton-Cotes formulas?

The first order Newton-Cotes formula uses a straight line (linear) approximation for each subinterval, while the second order formula uses a quadratic approximation. This means that the first order formula is less accurate, but easier to calculate, while the second order formula is more accurate, but more complex.

4. What are the limitations of the first and second order Newton-Cotes formulas?

The first and second order Newton-Cotes formulas have limitations when used to approximate integrals with highly oscillatory functions or functions with sharp peaks. This is because the interpolating polynomials may not accurately capture the behavior of the function within each subinterval.

5. How do you choose the number of subintervals for the first and second order Newton-Cotes formulas?

The number of subintervals for the first and second order Newton-Cotes formulas depends on the desired level of accuracy. Generally, the more subintervals used, the more accurate the approximation will be. However, using too many subintervals can also lead to numerical errors, so it is important to find a balance between accuracy and efficiency.

Similar threads

Replies
3
Views
737
  • Calculus
Replies
1
Views
1K
  • Advanced Physics Homework Help
Replies
0
Views
296
Replies
4
Views
357
  • Precalculus Mathematics Homework Help
Replies
2
Views
863
  • Calculus and Beyond Homework Help
Replies
1
Views
540
  • Introductory Physics Homework Help
Replies
7
Views
680
  • Linear and Abstract Algebra
Replies
14
Views
1K
Replies
1
Views
12K
  • Advanced Physics Homework Help
Replies
3
Views
890
Back
Top