Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

The Midpoint Rule

We can begin to get more creative with our Reimann Sums to get better approximations for area under curves. Instead of using a left or right hand approximation, we can place our rectangles so the function touches the midpoint of the rectangle.


Image illustrating The Midpoint Rule


Midpoint Rule

∫abf(x)dx ≈∑i=1nf(xi‾)Δx=Δx(f(x1‾)+f(x2‾)+f(x3‾)+...+f(xn−1‾)+f(xn‾))\boxed{\displaystyle \int_a^bf\left(x\right)dx\ \approx\sum_{i=1}^nf\left(\overline{x_i}\right)\Delta x=\Delta x\left(f\left(\overline{x_1}\right)+f\left(\overline{x_2}\right)+f\left(\overline{x_3}\right)+...+f\left(\overline{x_{n-1}}\right)+f\left(\overline{x_n}\right)\right)}


where Δx=b−an,  xi=a+iΔx,  xi‾=xi−1+xi2\displaystyle \Delta x=\frac{b-a}{n}, \ \ x_i=a+i\Delta x , \ \ \overline{x_i}=\frac{x_{i-1}+x_i}{2} and nn is the number of subintervals.


Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

Example: The Midpoint Rule

Use the midpoint approximation for


∫04ex2dx\displaystyle \int_0^4e^{x^2}dx


using 4 sub intervals.



∫abf(x)dx ≈∑i=1nf(xi‾)Δx=Δx(f(x1‾)+f(x2‾)+f(x3‾)+...+f(xn−1‾)+f(xn‾))\displaystyle \int_a^bf\left(x\right)dx\ \approx\sum_{i=1}^nf\left(\overline{x_i}\right)\Delta x=\Delta x\left(f\left(\overline{x_1}\right)+f\left(\overline{x_2}\right)+f\left(\overline{x_3}\right)+...+f\left(\overline{x_{n-1}}\right)+f\left(\overline{x_n}\right)\right)



Δx=b−an=4−04=1\displaystyle \Delta x=\frac{b-a}{n}=\frac{4-0}{4}=1


∫04ex2dx≈1(f(.5)+f(1.5)+f(2.5)+f(3.5)) =(e.52+e1.52+e2.52+e3.52)\displaystyle \int_0^4e^{x^2}dx\approx1\left(f\left(.5\right)+f\left(1.5\right)+f\left(2.5\right)+f\left(3.5\right)\right)\ =\left(e^{.5^2}+e^{1.5^2}+e^{2.5^2}+e^{3.5^2}\right)


=(e.25+e2.25+e6.25+e12.25)=\left(e^{.25}+e^{2.25}+e^{6.25}+e^{12.25}\right)

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

The Trapezoidal Rule

We can begin to get more creative with our Reimann Sums to get better approximations for area under curves. Instead of using a rectangle approximation, we can place trapezoids on the graph to approximate area.



Image illustrating The Trapezoid Rule


Trapezoid Rule

∫abf(x)dx ≈∑i=1nf(xi−1)+f(xi)2=Δx2(f(x0)+2f(x1)+2f(x2)+...+2f(xn−1)+f(xn))\boxed{\int_a^bf\left(x\right)dx\ \approx\sum_{i=1}^n\frac{f\left(x_{i-1}\right)+f\left(x_i\right)}{2}=\frac{\Delta x}{2}\left(f\left(x_0\right)+2f\left(x_1\right)+2f\left(x_2\right)+...+2f\left(x_{n-1}\right)+f\left(x_n\right)\right)}


where Δx=b−an,  xi=a+iΔx\displaystyle \Delta x=\frac{b-a}{n} , \ \ x_i=a+i\Delta x , and nn is the number of subintervals.


Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

Example: The Trapezoid Rule

Use a trapezoid approximation for


∫04ex2dx\displaystyle \int_0^4e^{x^2}dx


using 4 sub intervals.



∫abf(x)dx ≈∑i=1nf(xi−1)+f(xi)2=Δx2(f(x0)+2f(x1)+2f(x2)+...+2f(xn−1)+f(xn))\displaystyle \int_a^bf\left(x\right)dx\ \approx\sum_{i=1}^n\frac{f\left(x_{i-1}\right)+f\left(x_i\right)}{2}=\frac{\Delta x}{2}\left(f\left(x_0\right)+2f\left(x_1\right)+2f\left(x_2\right)+...+2f\left(x_{n-1}\right)+f\left(x_n\right)\right)



Δx=b−an=4−04=1\displaystyle \Delta x=\frac{b-a}{n}=\frac{4-0}{4}=1


∫04ex2dx≈12(f(0)+2f(1)+2f(2)+2f(3)+f(4)) =12(e02+2e12+2e22+2e32+e42)\displaystyle \int_0^4e^{x^2}dx\approx\frac{1}{2}\left(f\left(0\right)+2f\left(1\right)+2f\left(2\right)+2f\left(3\right)+f\left(4\right)\right)\ =\frac{1}{2}\left(e^{0^2}+2e^{1^2}+2e^{2^2}+2e^{3^2}+e^{4^2}\right)


=12(1+2e+2e4+2e9+e16)\displaystyle =\frac{1}{2}\left(1+2e+2e^4+2e^9+e^{16}\right)

Which of the following is the integral approximation of

∫13cos⁡(x3)dx\int_1^3 \cos (x^3)dx

using the trapezoid rule with n=3n=3?

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

Simpson's Rule

We can begin to get more creative with our Reimann Sums to get better approximations for area under curves. Instead of using a rectangle approximation, we can place quadratics on the graph to approximate area.

Simpson's Rule Approximation

∫abf(x)dx ≈Δx3(f(x0)+4f(x1)+2f(x2)+4f(x3)+2f(x4)+...+4f(xn−1)+f(xn))\boxed{\displaystyle \int_a^bf\left(x\right)dx\ \approx\frac{\Delta x}{3}\left(f\left(x_0\right)+4f\left(x_1\right)+2f\left(x_2\right)+4f\left(x_3\right)+2f\left(x_4\right)+...+4f\left(x_{n-1}\right)+f\left(x_n\right)\right)}


where Δx=b−an,  xi=a+iΔx\displaystyle\Delta x=\frac{b-a}{n}, \ \ x_i=a+i\Delta x, and nn is the number of subintervals.


Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

Example: Simpson's Rule

Use a Simpson's Rule approximation for


∫04ex2dx\displaystyle \int_0^4e^{x^2}dx


using 4 sub intervals.



∫abf(x)dx ≈Δx3(f(x0)+4f(x1)+2f(x2)+4f(x3)+2f(x4)+...+4f(xn−1)+f(xn))\displaystyle \int_a^bf\left(x\right)dx\ \approx\frac{\Delta x}{3}\left(f\left(x_0\right)+4f\left(x_1\right)+2f\left(x_2\right)+4f\left(x_3\right)+2f\left(x_4\right)+...+4f\left(x_{n-1}\right)+f\left(x_n\right)\right)



Δx=b−an=4−04=1\displaystyle \Delta x=\frac{b-a}{n}=\frac{4-0}{4}=1


∫04ex2dx≈13(f(0)+4f(1)+2f(2)+4f(3)+f(4)) =13(e02+4e12+2e22+4e32+e42)\displaystyle \int_0^4e^{x^2}dx\approx\frac{1}{3}\left(f\left(0\right)+4f\left(1\right)+2f\left(2\right)+4f\left(3\right)+f\left(4\right)\right)\ =\frac{1}{3}\left(e^{0^2}+4e^{1^2}+2e^{2^2}+4e^{3^2}+e^{4^2}\right)


=13(1+4e+2e4+4e9+e16)=\frac{1}{3}\left(1+4e+2e^4+4e^9+e^{16}\right)

Using the Simpson's rule with n=4n=4, find the integral approximation of


∫04x2dx\displaystyle \int_0^4 x^2 dx.


Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

Error of Integral Approximations

Approximations aren't perfect - however, we are able to bound the error on them. By increasing nn (the number of rectangles) we can reduce the error created by our area approximations


Error for the Midpoint Approximation

Suppose ∣f′′(x)∣<K2|f''\left(x\right)|<K_2 for a≤x≤ba\le x\le b. Then the error using a definite integral Midpoint approximation is


∣EN∣=∣MN−Actual∣|E_N|=|M_N-\text{Actual}|

and the error can be bounded by


∣EN∣<K2(b−a)324n2\boxed{|E_N|<\frac{K_2\left(b-a\right)^3}{24n^2}}



Error for the Trapezoid Approximation

Suppose ∣f′′(x)∣<K2|f''\left(x\right)|<K_2for a≤x≤ba\le x\le b. Then the Error using a definite integral Trapezoid approximation is


∣EN∣=∣TN−Actual∣|E_N|=|T_N-\text{Actual}|

and the error can be bounded by


∣EN∣<K2(b−a)312n2\boxed{|E_N|<\frac{K_2\left(b-a\right)^3}{12n^2}}

Error for the Simpson's Approximation

Suppose ∣f(4)(x)∣<K4|f^{(4)}\left(x\right)|<K_4 for a≤x≤ba\le x\le b. Then the Error using a definite integral Simpson's approximation is

∣EN∣=∣SN−Actual∣|E_N|=|S_N-\text{Actual}|

and the error can be bounded by


∣EN∣<K4(b−a)5180n4\boxed{|E_N|<\frac{K_4\left(b-a\right)^5}{180n^4}}


How large does n have to be to guarantee that the integral approximation of ∫02x5dx\displaystyle \int_0^2x^5dx

using the Midpoint rule is accurate to within 0.0001?

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

Approximate Integration

Sometimes it's impossible to calculate the exact value of a definite integral. Instead, we can approximate the value by treating it like the area underneath a curve and follow these steps:

  1. We divide the area under the curve into equal width shapes like rectangles or trapezoids
  2. We calculate the area of each of these "nice shapes"
  3. We add up all of these areas to get the approximate total area (i.e. approximate value of the definite integral)
Image illustrating Numerical Integration (Summary)




Rule 1: Left Endpoint Approximation

Ln=∑i=1nf(xi−1)Δx=Δx[f(x0)+f(x1)+...+f(xn−1)]\displaystyle L_n=\sum_{i=1}^nf\left(x_{i-1}\right)\Delta x=\Delta x[f(x_0)+f(x_1)+...+f(x_{n-1})]

  • Δx=b−an\Delta x=\frac{b-a}{n}
  • xi=a+iΔxx_{i}=a+i\Delta x


Rule 2: Right Endpoint Approximation

Rn=∑i=1nf(xi)Δx=Δx[f(x1)+f(x2)+...+f(xn)]\displaystyle R_n=\sum_{i=1}^nf\left(x_{i}\right)\Delta x=\Delta x[f(x_1)+f(x_2)+...+f(x_{n})]

  • Δx=b−an\Delta x=\frac{b-a}{n}
  • xi=a+iΔxx_{i}=a+i\Delta x


Rule 3: Midpoint Rule Approximation

Mn=∑i=1nf(xi‾)Δx=Δx[f(x1‾)+f(x2‾)+...+f(xn‾)]\displaystyle M_n=\sum_{i=1}^nf\left(\overline{ x_i}\right)\Delta x=\Delta x[f(\overline {x_1})+f(\overline {x_2})+...+f(\overline{x_n})]

  • Δx=b−an\Delta x=\frac{b-a}{n}
  • xi‾=12(xi−1+xi)\overline{x_{i}}=\frac{1}{2}(x_{i-1}+x_i) (the midpoint of [xi−1,xi][x_{i-1},x_i]


Rule 4: Trapezoidal Rule Approximation

Tn=Δx2[f(x0)+2f(x1)+2f(x2)+...+2f(xn−1)+f(xn)]\displaystyle T_n=\frac{\Delta x}{2}\left[f\left(x_0\right)+2f\left(x_1\right)+2f\left(x_2\right)+...+2f\left(x_{n-1}\right)+f\left(x_n\right)\right]

  • Δx=b−an\Delta x=\frac{b-a}{n}
  • xi=a+iΔxx_{i}=a+i\Delta x

Rule 5: SImpson's Rule Approximation

Sn=Δx3[f(x0)+4f(x1)+2f(x2)+4f(x3)+...+2f(xn−2)+4f(xn−1)+f(xn)]\displaystyle S_n=\frac{\Delta x}{3}\left[f\left(x_0\right)+4f\left(x_1\right)+2f\left(x_2\right)+4f\left(x_3\right)+...+2f\left(x_{n-2}\right)+4f\left(x_{n-1}\right)+f\left(x_n\right)\right]

  • nn must be even
  • Δx=b−an\Delta x=\frac{b-a}{n}
  • xi=a+iΔxx_{i}=a+i\Delta x

Error Bounds for Trapezoidal & Midpoint Rule Approximations


If ∣f′′(x)∣≤K\displaystyle \left|f''\left(x\right)\right|\le K then ∣ET∣≤K(b−a)312n2\displaystyle \left|E_T\right|\le\frac{K\left(b-a\right)^3}{12n^2} and ∣EM∣≤K(b−a)324n2\displaystyle \left|E_M\right|\le\frac{K\left(b-a\right)^3}{24n^2}

  • This means that if we can find an upper and lower bound for the second derivative of the function, then we can calculate an error bound (upper and lower bound) for our Trapezoidal and Midpoint rule approximation

Error Bounds for Simpson's Rule Approximations

If ∣f(4)(x)∣≤K\displaystyle \left|f^{(4)}\left(x\right)\right|\le K then ∣ES∣≤K(b−a)5180n4\displaystyle \left|E_S\right|\le\frac{K\left(b-a\right)^5}{180n^4}

  • This means that if we can find an upper and lower bound for the fourth derivative of the function, then we can calculate an error bound (upper and lower bound) for our Simpson's rule approximation