# Thread: Heavily stuck on Newton-Cotes integration

1. ## Heavily stuck on Newton-Cotes integration

For an integral of form $\displaystyle \int_{-2}^2 x^2e^xdx$, calculate the Newton-Cotes quadrature and estimate the error for:

- $\displaystyle n=1$ (Trapezoid rule)
- $\displaystyle n=2$ (Simpson's rule)
- $\displaystyle n=3$ (3/8 rule)
So I know the formulas for the errors but I don't know what I'm supposed to plug into the formulas... It's very hard to find some examples rather than raw definitions so I'm kind of stuck. Should I solve the initial integral as if it were a regular integral to move on or I'm to plug something into the formula right from the beginning?

2. ## Re: Heavily stuck on Newton-Cotes integration

Hey Glyper.

What are the formulas for the errors?

3. ## Re: Heavily stuck on Newton-Cotes integration

$\displaystyle -\frac{(b-a)^3}{12}\,f^{(2)}(\xi)$ for trapezoid rule, $\displaystyle -\frac{(b-a)^5}{2880}\,f^{(4)}(\xi)$ for Simpson's rule and $\displaystyle -\frac{(b-a)^5}{6480}\,f^{(4)}(\xi)$ for 3/8 rule.