{"id":1597,"date":"2021-07-22T16:42:17","date_gmt":"2021-07-22T16:42:17","guid":{"rendered":"https:\/\/courses.lumenlearning.com\/calculus2\/?post_type=chapter&#038;p=1597"},"modified":"2022-03-19T04:16:45","modified_gmt":"2022-03-19T04:16:45","slug":"the-midpoint-and-trapezoidal-rules","status":"publish","type":"chapter","link":"https:\/\/courses.lumenlearning.com\/calculus2\/chapter\/the-midpoint-and-trapezoidal-rules\/","title":{"raw":"The Midpoint and Trapezoidal Rules","rendered":"The Midpoint and Trapezoidal Rules"},"content":{"raw":"<div class=\"textbox learning-objectives\" data-type=\"abstract\">\r\n<h3>Learning Outcomes<\/h3>\r\n<ul>\r\n \t<li>Approximate the value of a definite integral by using the midpoint and trapezoidal rules<\/li>\r\n<\/ul>\r\n<\/div>\r\n<section id=\"fs-id1165041769647\" data-depth=\"1\">\r\n<h2 data-type=\"title\">The Midpoint Rule<\/h2>\r\n<p id=\"fs-id1165041958773\">Earlier in this text we defined the definite integral of a function over an interval as the limit of <span class=\"no-emphasis\" data-type=\"term\">Riemann sums<\/span>. In general, any Riemann sum of a function [latex]f\\left(x\\right)[\/latex] over an interval [latex]\\left[a,b\\right][\/latex] may be viewed as an estimate of [latex]{\\displaystyle\\int }_{a}^{b}f\\left(x\\right)dx[\/latex]. Recall that a Riemann sum of a function [latex]f\\left(x\\right)[\/latex] over an interval [latex]\\left[a,b\\right][\/latex] is obtained by selecting a partition<\/p>\r\n\r\n<div id=\"fs-id1165042273486\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]P=\\left\\{{x}_{0},{x}_{1},{x}_{2}, \\ldots,{x}_{n}\\right\\},\\text{ where }a={x}_{0}&lt;{x}_{1}&lt;{x}_{2}&lt;\\cdots &lt;{x}_{n}=b[\/latex]<\/div>\r\n&nbsp;\r\n<p id=\"fs-id1165041952162\">and a set<\/p>\r\n\r\n<div id=\"fs-id1165041974915\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]S=\\left\\{{x}_{1}^{*},{x}_{2}^{*},\\ldots ,{x}_{n}^{*}\\right\\},\\text{ where }{x}_{i - 1}\\le {x}_{i}^{*}\\le {x}_{i}\\text{ for all }i[\/latex].<\/div>\r\n&nbsp;\r\n<p id=\"fs-id1165041762259\">The Riemann sum corresponding to the partition [latex]P[\/latex] and the set [latex]S[\/latex] is given by [latex]\\displaystyle\\sum _{i=1}^{n}f\\left({x}_{i}^{*}\\right)\\Delta {x}_{i}[\/latex], where [latex]\\Delta {x}_{i}={x}_{i}-{x}_{i - 1}[\/latex], the length of the <em data-effect=\"italics\">i<\/em>th subinterval.<\/p>\r\n<p id=\"fs-id1165041843704\">The <span data-type=\"term\">midpoint rule<\/span> for estimating a definite integral uses a Riemann sum with subintervals of equal width and the midpoints, [latex]{m}_{i}[\/latex], of each subinterval in place of [latex]{x}_{i}^{*}[\/latex]. Formally, we state a theorem regarding the convergence of the midpoint rule as follows.<\/p>\r\n\r\n<div id=\"fs-id1165042137683\" class=\"theorem\" data-type=\"note\">\r\n<div data-type=\"title\">\r\n<div class=\"textbox shaded\">\r\n<h3 style=\"text-align: center;\" data-type=\"title\">The Midpoint Rule<\/h3>\r\n\r\n<hr \/>\r\n<p id=\"fs-id1165040775196\">Assume that [latex]f\\left(x\\right)[\/latex] is continuous on [latex]\\left[a,b\\right][\/latex]. Let <em data-effect=\"italics\">n<\/em> be a positive integer and [latex]\\Delta x=\\frac{b-a}{n}[\/latex]. If [latex]\\left[a,b\\right][\/latex] is divided into [latex]n[\/latex] subintervals, each of length [latex]\\Delta x[\/latex], and [latex]{m}_{i}[\/latex] is the midpoint of the <em data-effect=\"italics\">i<\/em>th subinterval, set<\/p>\r\n\r\n<div id=\"fs-id1165040697119\" style=\"text-align: center;\" data-type=\"equation\">[latex]{M}_{n}=\\displaystyle\\sum _{i=1}^{n}f\\left({m}_{i}\\right)\\Delta x[\/latex].<\/div>\r\n&nbsp;\r\n<p id=\"fs-id1165042262133\">Then [latex]\\underset{n\\to \\infty }{\\text{lim}}{M}_{n}={\\displaystyle\\int }_{a}^{b}f\\left(x\\right)dx[\/latex].<\/p>\r\n\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n<p id=\"fs-id1165041977672\">As we can see in Figure 1, if [latex]f\\left(x\\right)\\ge 0[\/latex] over [latex]\\left[a,b\\right][\/latex], then [latex]\\displaystyle\\sum _{i=1}^{n}f\\left({m}_{i}\\right)\\Delta x[\/latex] corresponds to the sum of the areas of rectangles approximating the area between the graph of [latex]f\\left(x\\right)[\/latex] and the <em data-effect=\"italics\">x<\/em>-axis over [latex]\\left[a,b\\right][\/latex]. The graph shows the rectangles corresponding to [latex]{M}_{4}[\/latex] for a nonnegative function over a closed interval [latex]\\left[a,b\\right][\/latex].<\/p>\r\n\r\n<figure id=\"CNX_Calc_Figure_07_06_001\"><figcaption><\/figcaption>[caption id=\"\" align=\"aligncenter\" width=\"487\"]<img src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/4175\/2019\/04\/11233831\/CNX_Calc_Figure_07_06_001.jpg\" alt=\"This figure is a graph of a non-negative function in the first quadrant. The function increases and decreases. The quadrant is divided into a grid. Beginning on the x-axis at the point labeled a = x sub 0, there are rectangles shaded whose heights are approximately the height of the curve. The x-axis is scaled by increments of msub1, x sub 1, m sub 2, x sub 2, m sub 3, x sub 3, m sub 4 and b = x sub 4.\" width=\"487\" height=\"286\" data-media-type=\"image\/jpeg\" \/> Figure 1. The midpoint rule approximates the area between the graph of [latex]f\\left(x\\right)[\/latex] and the x-axis by summing the areas of rectangles with midpoints that are points on [latex]f\\left(x\\right)[\/latex].[\/caption]<\/figure>\r\n<div id=\"fs-id1165040799117\" data-type=\"example\">\r\n<div id=\"fs-id1165041845776\" data-type=\"exercise\">\r\n<div id=\"fs-id1165041843774\" data-type=\"problem\">\r\n<div data-type=\"title\">\r\n<div class=\"textbox exercises\">\r\n<h3>Example:\u00a0Using the Midpoint Rule with [latex]{M}_{4}[\/latex]<\/h3>\r\n<div id=\"fs-id1165041843774\" data-type=\"problem\">\r\n<p id=\"fs-id1165040716416\">Use the midpoint rule to estimate [latex]{\\displaystyle\\int }_{0}^{1}{x}^{2}dx[\/latex] using four subintervals. Compare the result with the actual value of this integral.<\/p>\r\n\r\n<\/div>\r\n[reveal-answer q=\"44558899\"]Show Solution[\/reveal-answer]\r\n[hidden-answer a=\"44558899\"]\r\n<div id=\"fs-id1165042276048\" data-type=\"solution\">\r\n<p id=\"fs-id1165042050773\">Each subinterval has length [latex]\\Delta x=\\frac{1 - 0}{4}=\\frac{1}{4}[\/latex]. Therefore, the subintervals consist of<\/p>\r\n\r\n<div id=\"fs-id1165042066546\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]\\left[0,\\frac{1}{4}\\right],\\left[\\frac{1}{4},\\frac{1}{2}\\right],\\left[\\frac{1}{2},\\frac{3}{4}\\right],\\text{and}\\left[\\frac{3}{4},1\\right][\/latex].<\/div>\r\n&nbsp;\r\n<p id=\"fs-id1165041815762\">The midpoints of these subintervals are [latex]\\left\\{\\frac{1}{8},\\frac{3}{8},\\frac{5}{8},\\frac{7}{8}\\right\\}[\/latex]. Thus,<\/p>\r\n\r\n<div id=\"fs-id1165041791048\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]{M}_{4}=\\frac{1}{4}f\\left(\\frac{1}{8}\\right)+\\frac{1}{4}f\\left(\\frac{3}{8}\\right)+\\frac{1}{4}f\\left(\\frac{5}{8}\\right)+\\frac{1}{4}f\\left(\\frac{7}{8}\\right)=\\frac{1}{4}\\cdot \\frac{1}{64}+\\frac{1}{4}\\cdot \\frac{9}{64}+\\frac{1}{4}\\cdot \\frac{25}{64}+\\frac{1}{4}\\cdot \\frac{21}{64}=\\frac{21}{64}[\/latex].<\/div>\r\n&nbsp;\r\n<p id=\"fs-id1165041770066\">Since<\/p>\r\n\r\n<div id=\"fs-id1165041915328\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]{\\displaystyle\\int }_{0}^{1}{x}^{2}dx=\\frac{1}{3}\\text{and}|\\frac{1}{3}-\\frac{21}{64}|=\\frac{1}{192}\\approx 0.0052[\/latex],<\/div>\r\n&nbsp;\r\n<p id=\"fs-id1165042134377\">we see that the midpoint rule produces an estimate that is somewhat close to the actual value of the definite integral.<\/p>\r\n\r\n<\/div>\r\n[\/hidden-answer]\r\n\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n<div id=\"fs-id1165041840100\" data-type=\"example\">\r\n<div id=\"fs-id1165042126032\" data-type=\"exercise\">\r\n<div id=\"fs-id1165041827477\" data-type=\"problem\">\r\n<div data-type=\"title\">\r\n<div class=\"textbox exercises\">\r\n<h3>Example:\u00a0Using the Midpoint Rule with [latex]{M}_{6}[\/latex]<\/h3>\r\n<div id=\"fs-id1165041827477\" data-type=\"problem\">\r\n<p id=\"fs-id1165042128953\">Use [latex]{M}_{6}[\/latex] to estimate the length of the curve [latex]y=\\frac{1}{2}{x}^{2}[\/latex] on [latex]\\left[1,4\\right][\/latex].<\/p>\r\n\r\n<\/div>\r\n[reveal-answer q=\"44558898\"]Show Solution[\/reveal-answer]\r\n[hidden-answer a=\"44558898\"]\r\n<div id=\"fs-id1165040754773\" data-type=\"solution\">\r\n<p id=\"fs-id1165041805251\">The length of [latex]y=\\frac{1}{2}{x}^{2}[\/latex] on [latex]\\left[1,4\\right][\/latex] is<\/p>\r\n\r\n<div id=\"fs-id1165041813602\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]{\\displaystyle\\int }_{1}^{4}\\sqrt{1+{\\left(\\frac{dy}{dx}\\right)}^{2}}dx[\/latex].<\/div>\r\n&nbsp;\r\n<p id=\"fs-id1165040691246\">Since [latex]\\frac{dy}{dx}=x[\/latex], this integral becomes [latex]{\\displaystyle\\int }_{1}^{4}\\sqrt{1+{x}^{2}}dx[\/latex].<\/p>\r\n<p id=\"fs-id1165041893161\">If [latex]\\left[1,4\\right][\/latex] is divided into six subintervals, then each subinterval has length [latex]\\Delta x=\\frac{4 - 1}{6}=\\frac{1}{2}[\/latex] and the midpoints of the subintervals are [latex]\\left\\{\\frac{5}{4},\\frac{7}{4},\\frac{9}{4},\\frac{11}{4},\\frac{13}{4},\\frac{15}{4}\\right\\}[\/latex]. If we set [latex]f\\left(x\\right)=\\sqrt{1+{x}^{2}}[\/latex],<\/p>\r\n\r\n<div id=\"fs-id1165042017909\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]\\begin{array}{cc}\\hfill {M}_{6}&amp; =\\frac{1}{2}f\\left(\\frac{5}{4}\\right)+\\frac{1}{2}f\\left(\\frac{7}{4}\\right)+\\frac{1}{2}f\\left(\\frac{9}{4}\\right)+\\frac{1}{2}f\\left(\\frac{11}{4}\\right)+\\frac{1}{2}f\\left(\\frac{13}{4}\\right)+\\frac{1}{2}f\\left(\\frac{15}{4}\\right)\\hfill \\\\ &amp; \\approx \\frac{1}{2}\\left(1.6008+2.0156+2.4622+2.9262+3.4004+3.8810\\right)=8.1431.\\hfill \\end{array}[\/latex]<\/div>\r\n&nbsp;\r\n\r\n<\/div>\r\n[\/hidden-answer]\r\n\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n<div id=\"fs-id1165041894379\" class=\"checkpoint\" data-type=\"note\">\r\n<div id=\"fs-id1165042058790\" data-type=\"exercise\">\r\n<div id=\"fs-id1165042231132\" data-type=\"problem\">\r\n<div class=\"textbox key-takeaways\">\r\n<h3>try it<\/h3>\r\n<div id=\"fs-id1165042231132\" data-type=\"problem\">\r\n<p id=\"fs-id1165040706128\">Use the midpoint rule with [latex]n=2[\/latex] to estimate [latex]{\\displaystyle\\int }_{1}^{2}\\frac{1}{x}dx[\/latex].<\/p>\r\n\r\n<\/div>\r\n[reveal-answer q=\"44558896\"]Hint[\/reveal-answer]\r\n[hidden-answer a=\"44558896\"]\r\n<div id=\"fs-id1165041834633\" data-type=\"commentary\" data-element-type=\"hint\">\r\n<p id=\"fs-id1165040743320\">[latex]\\Delta x=\\frac{1}{2}[\/latex], [latex]{m}_{1}=\\frac{5}{4}[\/latex], and [latex]{m}_{2}=\\frac{7}{4}[\/latex].<\/p>\r\n\r\n<\/div>\r\n[\/hidden-answer]\r\n\r\n[reveal-answer q=\"44558897\"]Show Solution[\/reveal-answer]\r\n[hidden-answer a=\"44558897\"]\r\n<div id=\"fs-id1165041815897\" data-type=\"solution\">\r\n<p id=\"fs-id1165041816976\">[latex]\\frac{24}{35}[\/latex]<\/p>\r\n\r\n<\/div>\r\n[\/hidden-answer]\r\n\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n<\/section><section id=\"fs-id1165041822197\" data-depth=\"1\">\r\n<h2 data-type=\"title\">The Trapezoidal Rule<\/h2>\r\n<p id=\"fs-id1165042006539\">We can also approximate the value of a definite integral by using trapezoids rather than rectangles. In Figure 2, the area beneath the curve is approximated by trapezoids rather than by rectangles.<\/p>\r\n\r\n<figure id=\"CNX_Calc_Figure_07_06_002\"><figcaption><\/figcaption>\r\n\r\n[caption id=\"\" align=\"aligncenter\" width=\"487\"]<img src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/4175\/2019\/04\/11233834\/CNX_Calc_Figure_07_06_002.jpg\" alt=\"This figure is a graph of a non-negative function in the first quadrant. The function increases and decreases. The quadrant is divided into a grid. Beginning on the x-axis at the point labeled a = x sub 0, there are trapezoids shaded whose heights are approximately the height of the curve. The x-axis is scaled by increments of a = x sub 0, x sub 1, x sub 2, x sub 3, and b = x sub 4.\" width=\"487\" height=\"286\" data-media-type=\"image\/jpeg\" \/> Figure 2. Trapezoids may be used to approximate the area under a curve, hence approximating the definite integral.[\/caption]<\/figure>\r\n<p id=\"fs-id1165041821083\">The <span data-type=\"term\">trapezoidal rule<\/span> for estimating definite integrals uses trapezoids rather than rectangles to approximate the area under a curve. To gain insight into the final form of the rule, consider the trapezoids shown in Figure 2. We assume that the length of each subinterval is given by [latex]\\Delta x[\/latex]. First, recall that the area of a trapezoid with a height of <em data-effect=\"italics\">h<\/em> and bases of length [latex]{b}_{1}[\/latex] and [latex]{b}_{2}[\/latex] is given by [latex]\\text{Area}=\\frac{1}{2}h\\left({b}_{1}+{b}_{2}\\right)[\/latex]. We see that the first trapezoid has a height [latex]\\Delta x[\/latex] and parallel bases of length [latex]f\\left({x}_{0}\\right)[\/latex] and [latex]f\\left({x}_{1}\\right)[\/latex]. Thus, the area of the first trapezoid in Figure 2 is<\/p>\r\n\r\n<div id=\"fs-id1165040644975\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]\\frac{1}{2}\\Delta x\\left(f\\left({x}_{0}\\right)+f\\left({x}_{1}\\right)\\right)[\/latex].<\/div>\r\n&nbsp;\r\n<p id=\"fs-id1165040713973\">The areas of the remaining three trapezoids are<\/p>\r\n\r\n<div id=\"fs-id1165042135238\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]\\frac{1}{2}\\Delta x\\left(f\\left({x}_{1}\\right)+f\\left({x}_{2}\\right)\\right),\\frac{1}{2}\\Delta x\\left(f\\left({x}_{2}\\right)+f\\left({x}_{3}\\right)\\right),\\text{and}\\frac{1}{2}\\Delta x\\left(f\\left({x}_{3}\\right)+f\\left({x}_{4}\\right)\\right)[\/latex].<\/div>\r\n&nbsp;\r\n<p id=\"fs-id1165041818057\">Consequently,<\/p>\r\n\r\n<div id=\"fs-id1165042136358\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]{\\displaystyle\\int }_{a}^{b}f\\left(x\\right)dx\\approx \\frac{1}{2}\\Delta x\\left(f\\left({x}_{0}\\right)+f\\left({x}_{1}\\right)\\right)+\\frac{1}{2}\\Delta x\\left(f\\left({x}_{1}\\right)+f\\left({x}_{2}\\right)\\right)+\\frac{1}{2}\\Delta x\\left(f\\left({x}_{2}\\right)+f\\left({x}_{3}\\right)\\right)+\\frac{1}{2}\\Delta x\\left(f\\left({x}_{3}\\right)+f\\left({x}_{4}\\right)\\right)[\/latex].<\/div>\r\n&nbsp;\r\n<p id=\"fs-id1165041800257\">After taking out a common factor of [latex]\\frac{1}{2}\\Delta x[\/latex] and combining like terms, we have<\/p>\r\n\r\n<div id=\"fs-id1165041782960\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]{\\displaystyle\\int }_{a}^{b}f\\left(x\\right)dx\\approx \\frac{1}{2}\\Delta x\\left(f\\left({x}_{0}\\right)+2f\\left({x}_{1}\\right)+2f\\left({x}_{2}\\right)+2f\\left({x}_{3}\\right)+f\\left({x}_{4}\\right)\\right)[\/latex].<\/div>\r\n&nbsp;\r\n<p id=\"fs-id1165040671242\">Generalizing, we formally state the following rule.<\/p>\r\n\r\n<div id=\"fs-id1165041809779\" class=\"theorem\" data-type=\"note\">\r\n<div data-type=\"title\">\r\n<div class=\"textbox shaded\">\r\n<h3 style=\"text-align: center;\" data-type=\"title\">The Trapezoidal Rule<\/h3>\r\n\r\n<hr \/>\r\n<p id=\"fs-id1165042129188\">Assume that [latex]f\\left(x\\right)[\/latex] is continuous over [latex]\\left[a,b\\right][\/latex]. Let <em data-effect=\"italics\">n<\/em> be a positive integer and [latex]\\Delta x=\\frac{b-a}{n}[\/latex]. Let [latex]\\left[a,b\\right][\/latex] be divided into [latex]n[\/latex] subintervals, each of length [latex]\\Delta x[\/latex], with endpoints at [latex]P=\\left\\{{x}_{0},{x}_{1},{x}_{2}\\ldots ,{x}_{n}\\right\\}[\/latex]. Set<\/p>\r\n\r\n<div id=\"fs-id1165041762506\" style=\"text-align: center;\" data-type=\"equation\">[latex]{T}_{n}=\\frac{1}{2}\\Delta x\\left(f\\left({x}_{0}\\right)+2f\\left({x}_{1}\\right)+2f\\left({x}_{2}\\right)+\\cdots +2f\\left({x}_{n - 1}\\right)+f\\left({x}_{n}\\right)\\right)[\/latex].<\/div>\r\n&nbsp;\r\n<p id=\"fs-id1165040744211\">Then, [latex]\\underset{n\\to \\text{+}\\infty }{\\text{lim}}{T}_{n}={\\displaystyle\\int }_{a}^{b}f\\left(x\\right)dx[\/latex].<\/p>\r\n\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n<p id=\"fs-id1165041846939\">Before continuing, let\u2019s make a few observations about the trapezoidal rule. First of all, it is useful to note that<\/p>\r\n\r\n<div id=\"fs-id1165040697663\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]{T}_{n}=\\frac{1}{2}\\left({L}_{n}+{R}_{n}\\right)\\text{where}{L}_{n}=\\displaystyle\\sum _{i=1}^{n}f\\left({x}_{i - 1}\\right)\\Delta x\\text{and}{R}_{n}=\\displaystyle\\sum _{i=1}^{n}f\\left({x}_{i}\\right)\\Delta x[\/latex].<\/div>\r\n&nbsp;\r\n<p id=\"fs-id1165042027656\">That is, [latex]{L}_{n}[\/latex] and [latex]{R}_{n}[\/latex] approximate the integral using the left-hand and right-hand endpoints of each subinterval, respectively. In addition, a careful examination of Figure 3 leads us to make the following observations about using the trapezoidal rules and midpoint rules to estimate the definite integral of a nonnegative function. The trapezoidal rule tends to overestimate the value of a definite integral systematically over intervals where the function is concave up and to underestimate the value of a definite integral systematically over intervals where the function is concave down. On the other hand, the midpoint rule tends to average out these errors somewhat by partially overestimating and partially underestimating the value of the definite integral over these same types of intervals. This leads us to hypothesize that, in general, the midpoint rule tends to be more accurate than the trapezoidal rule.<\/p>\r\n\r\n<figure id=\"CNX_Calc_Figure_07_06_003\"><figcaption><\/figcaption>\r\n\r\n[caption id=\"\" align=\"aligncenter\" width=\"975\"]<img src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/4175\/2019\/04\/11233837\/CNX_Calc_Figure_07_06_003.jpg\" alt=\"This figure has two graphs, both of the same non-negative function in the first quadrant. The function increases and decreases. The quadrant is divided into a grid. The first graph, beginning on the x-axis at the point labeled a = x sub 0, there are trapezoids shaded whose heights are approximately the height of the curve. The x-axis is scaled by increments of a = x sub 0, xsub1, x sub 2, x sub 3, and b = x sub 4. The second graph has on the x-axis at the point labeled a = x sub 0. There are rectangles shaded whose heights are approximately the height of the curve. The x-axis is scaled by increments of m sub 1, x sub 1, m sub 2, x sub 2, m sub 3, x sub 3, m sub 4 and b = x sub 4.\" width=\"975\" height=\"286\" data-media-type=\"image\/jpeg\" \/> Figure 3. The trapezoidal rule tends to be less accurate than the midpoint rule.[\/caption]<\/figure>\r\n<div id=\"fs-id1165042234318\" data-type=\"example\">\r\n<div id=\"fs-id1165042008444\" data-type=\"exercise\">\r\n<div id=\"fs-id1165042008447\" data-type=\"problem\">\r\n<div data-type=\"title\">\r\n<div class=\"textbox exercises\">\r\n<h3>Example:\u00a0Using the Trapezoidal Rule<\/h3>\r\n<div id=\"fs-id1165042008447\" data-type=\"problem\">\r\n<p id=\"fs-id1165040682509\">Use the trapezoidal rule to estimate [latex]{\\displaystyle\\int }_{0}^{1}{x}^{2}dx[\/latex] using four subintervals.<\/p>\r\n\r\n<\/div>\r\n[reveal-answer q=\"44558895\"]Show Solution[\/reveal-answer]\r\n[hidden-answer a=\"44558895\"]\r\n<div id=\"fs-id1165042108930\" data-type=\"solution\">\r\n<p id=\"fs-id1165042108932\">The endpoints of the subintervals consist of elements of the set [latex]P=\\left\\{0,\\frac{1}{4},\\frac{1}{2},\\frac{3}{4},1\\right\\}[\/latex] and [latex]\\Delta x=\\frac{1 - 0}{4}=\\frac{1}{4}[\/latex]. Thus,<\/p>\r\n\r\n<div id=\"fs-id1165041788152\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]\\begin{array}{cc}\\hfill {\\displaystyle\\int }_{0}^{1}{x}^{2}dx&amp; \\approx \\frac{1}{2}\\cdot \\frac{1}{4}\\left(f\\left(0\\right)+2f\\left(\\frac{1}{4}\\right)+2f\\left(\\frac{1}{2}\\right)+2f\\left(\\frac{3}{4}\\right)+f\\left(1\\right)\\right)\\hfill \\\\ &amp; =\\frac{1}{8}\\left(0+2\\cdot \\frac{1}{16}+2\\cdot \\frac{1}{4}+2\\cdot \\frac{9}{16}+1\\right)\\hfill \\\\ &amp; =\\frac{11}{32}.\\hfill \\end{array}[\/latex]<\/div>\r\n&nbsp;\r\n\r\n<\/div>\r\n[\/hidden-answer]\r\n\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n\r\n[caption]Watch the following video to see the worked solution to Example:\u00a0Using the Trapezoidal Rule[\/caption]\r\n\r\n<center><iframe title=\"YouTube video player\" src=\"https:\/\/www.youtube.com\/embed\/4nqKNEy0zlE?controls=0&amp;start=796&amp;end=1007&amp;autoplay=0\" width=\"750\" height=\"450\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/center>\r\n<p class=\"p1\">For closed captioning, open the video on its original page by clicking the Youtube logo in the lower right-hand corner of the video display. In YouTube, the video will begin at the same starting point as this clip, but will continue playing until the very end.<\/p>\r\nYou can view the <a href=\"https:\/\/oerfiles.s3.us-west-2.amazonaws.com\/Calculus+II\/Transcripts\/3.6.1_796to1007_transcript.html\" target=\"_blank\" rel=\"noopener\">transcript for this segmented clip of \"3.6.1\" here (opens in new window)<\/a>.\r\n<div id=\"fs-id1165042009032\" class=\"checkpoint\" data-type=\"note\">\r\n<div id=\"fs-id1165041814721\" data-type=\"exercise\">\r\n<div id=\"fs-id1165041814723\" data-type=\"problem\">\r\n<div class=\"textbox key-takeaways\">\r\n<h3>try it<\/h3>\r\n<div id=\"fs-id1165041814723\" data-type=\"problem\">\r\n<p id=\"fs-id1165041814725\">Use the trapezoidal rule with [latex]n=2[\/latex] to estimate [latex]{\\displaystyle\\int }_{1}^{2}\\frac{1}{x}dx[\/latex].<\/p>\r\n\r\n<\/div>\r\n[reveal-answer q=\"44558893\"]Hint[\/reveal-answer]\r\n[hidden-answer a=\"44558893\"]\r\n<div id=\"fs-id1165040692039\" data-type=\"commentary\" data-element-type=\"hint\">\r\n<p id=\"fs-id1165041803658\">Set [latex]\\Delta x=\\frac{1}{2}[\/latex]. The endpoints of the subintervals are the elements of the set [latex]P=\\left\\{1,\\frac{3}{2},2\\right\\}[\/latex].<\/p>\r\n\r\n<\/div>\r\n[\/hidden-answer]\r\n\r\n[reveal-answer q=\"44558894\"]Show Solution[\/reveal-answer]\r\n[hidden-answer a=\"44558894\"]\r\n<div id=\"fs-id1165041782503\" data-type=\"solution\">\r\n<p id=\"fs-id1165041782505\">[latex]\\frac{17}{24}[\/latex]<\/p>\r\n\r\n<\/div>\r\n[\/hidden-answer]\r\n\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n<\/section><section id=\"fs-id1165040757737\" data-depth=\"1\"><\/section>","rendered":"<div class=\"textbox learning-objectives\" data-type=\"abstract\">\n<h3>Learning Outcomes<\/h3>\n<ul>\n<li>Approximate the value of a definite integral by using the midpoint and trapezoidal rules<\/li>\n<\/ul>\n<\/div>\n<section id=\"fs-id1165041769647\" data-depth=\"1\">\n<h2 data-type=\"title\">The Midpoint Rule<\/h2>\n<p id=\"fs-id1165041958773\">Earlier in this text we defined the definite integral of a function over an interval as the limit of <span class=\"no-emphasis\" data-type=\"term\">Riemann sums<\/span>. In general, any Riemann sum of a function [latex]f\\left(x\\right)[\/latex] over an interval [latex]\\left[a,b\\right][\/latex] may be viewed as an estimate of [latex]{\\displaystyle\\int }_{a}^{b}f\\left(x\\right)dx[\/latex]. Recall that a Riemann sum of a function [latex]f\\left(x\\right)[\/latex] over an interval [latex]\\left[a,b\\right][\/latex] is obtained by selecting a partition<\/p>\n<div id=\"fs-id1165042273486\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]P=\\left\\{{x}_{0},{x}_{1},{x}_{2}, \\ldots,{x}_{n}\\right\\},\\text{ where }a={x}_{0}<{x}_{1}<{x}_{2}<\\cdots <{x}_{n}=b[\/latex]<\/div>\n<p>&nbsp;<\/p>\n<p id=\"fs-id1165041952162\">and a set<\/p>\n<div id=\"fs-id1165041974915\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]S=\\left\\{{x}_{1}^{*},{x}_{2}^{*},\\ldots ,{x}_{n}^{*}\\right\\},\\text{ where }{x}_{i - 1}\\le {x}_{i}^{*}\\le {x}_{i}\\text{ for all }i[\/latex].<\/div>\n<p>&nbsp;<\/p>\n<p id=\"fs-id1165041762259\">The Riemann sum corresponding to the partition [latex]P[\/latex] and the set [latex]S[\/latex] is given by [latex]\\displaystyle\\sum _{i=1}^{n}f\\left({x}_{i}^{*}\\right)\\Delta {x}_{i}[\/latex], where [latex]\\Delta {x}_{i}={x}_{i}-{x}_{i - 1}[\/latex], the length of the <em data-effect=\"italics\">i<\/em>th subinterval.<\/p>\n<p id=\"fs-id1165041843704\">The <span data-type=\"term\">midpoint rule<\/span> for estimating a definite integral uses a Riemann sum with subintervals of equal width and the midpoints, [latex]{m}_{i}[\/latex], of each subinterval in place of [latex]{x}_{i}^{*}[\/latex]. Formally, we state a theorem regarding the convergence of the midpoint rule as follows.<\/p>\n<div id=\"fs-id1165042137683\" class=\"theorem\" data-type=\"note\">\n<div data-type=\"title\">\n<div class=\"textbox shaded\">\n<h3 style=\"text-align: center;\" data-type=\"title\">The Midpoint Rule<\/h3>\n<hr \/>\n<p id=\"fs-id1165040775196\">Assume that [latex]f\\left(x\\right)[\/latex] is continuous on [latex]\\left[a,b\\right][\/latex]. Let <em data-effect=\"italics\">n<\/em> be a positive integer and [latex]\\Delta x=\\frac{b-a}{n}[\/latex]. If [latex]\\left[a,b\\right][\/latex] is divided into [latex]n[\/latex] subintervals, each of length [latex]\\Delta x[\/latex], and [latex]{m}_{i}[\/latex] is the midpoint of the <em data-effect=\"italics\">i<\/em>th subinterval, set<\/p>\n<div id=\"fs-id1165040697119\" style=\"text-align: center;\" data-type=\"equation\">[latex]{M}_{n}=\\displaystyle\\sum _{i=1}^{n}f\\left({m}_{i}\\right)\\Delta x[\/latex].<\/div>\n<p>&nbsp;<\/p>\n<p id=\"fs-id1165042262133\">Then [latex]\\underset{n\\to \\infty }{\\text{lim}}{M}_{n}={\\displaystyle\\int }_{a}^{b}f\\left(x\\right)dx[\/latex].<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p id=\"fs-id1165041977672\">As we can see in Figure 1, if [latex]f\\left(x\\right)\\ge 0[\/latex] over [latex]\\left[a,b\\right][\/latex], then [latex]\\displaystyle\\sum _{i=1}^{n}f\\left({m}_{i}\\right)\\Delta x[\/latex] corresponds to the sum of the areas of rectangles approximating the area between the graph of [latex]f\\left(x\\right)[\/latex] and the <em data-effect=\"italics\">x<\/em>-axis over [latex]\\left[a,b\\right][\/latex]. The graph shows the rectangles corresponding to [latex]{M}_{4}[\/latex] for a nonnegative function over a closed interval [latex]\\left[a,b\\right][\/latex].<\/p>\n<figure id=\"CNX_Calc_Figure_07_06_001\"><figcaption><\/figcaption><div style=\"width: 497px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/4175\/2019\/04\/11233831\/CNX_Calc_Figure_07_06_001.jpg\" alt=\"This figure is a graph of a non-negative function in the first quadrant. The function increases and decreases. The quadrant is divided into a grid. Beginning on the x-axis at the point labeled a = x sub 0, there are rectangles shaded whose heights are approximately the height of the curve. The x-axis is scaled by increments of msub1, x sub 1, m sub 2, x sub 2, m sub 3, x sub 3, m sub 4 and b = x sub 4.\" width=\"487\" height=\"286\" data-media-type=\"image\/jpeg\" \/><\/p>\n<p class=\"wp-caption-text\">Figure 1. The midpoint rule approximates the area between the graph of [latex]f\\left(x\\right)[\/latex] and the x-axis by summing the areas of rectangles with midpoints that are points on [latex]f\\left(x\\right)[\/latex].<\/p>\n<\/div>\n<\/figure>\n<div id=\"fs-id1165040799117\" data-type=\"example\">\n<div id=\"fs-id1165041845776\" data-type=\"exercise\">\n<div id=\"fs-id1165041843774\" data-type=\"problem\">\n<div data-type=\"title\">\n<div class=\"textbox exercises\">\n<h3>Example:\u00a0Using the Midpoint Rule with [latex]{M}_{4}[\/latex]<\/h3>\n<div id=\"fs-id1165041843774\" data-type=\"problem\">\n<p id=\"fs-id1165040716416\">Use the midpoint rule to estimate [latex]{\\displaystyle\\int }_{0}^{1}{x}^{2}dx[\/latex] using four subintervals. Compare the result with the actual value of this integral.<\/p>\n<\/div>\n<div class=\"qa-wrapper\" style=\"display: block\"><span class=\"show-answer collapsed\" style=\"cursor: pointer\" data-target=\"q44558899\">Show Solution<\/span><\/p>\n<div id=\"q44558899\" class=\"hidden-answer\" style=\"display: none\">\n<div id=\"fs-id1165042276048\" data-type=\"solution\">\n<p id=\"fs-id1165042050773\">Each subinterval has length [latex]\\Delta x=\\frac{1 - 0}{4}=\\frac{1}{4}[\/latex]. Therefore, the subintervals consist of<\/p>\n<div id=\"fs-id1165042066546\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]\\left[0,\\frac{1}{4}\\right],\\left[\\frac{1}{4},\\frac{1}{2}\\right],\\left[\\frac{1}{2},\\frac{3}{4}\\right],\\text{and}\\left[\\frac{3}{4},1\\right][\/latex].<\/div>\n<p>&nbsp;<\/p>\n<p id=\"fs-id1165041815762\">The midpoints of these subintervals are [latex]\\left\\{\\frac{1}{8},\\frac{3}{8},\\frac{5}{8},\\frac{7}{8}\\right\\}[\/latex]. Thus,<\/p>\n<div id=\"fs-id1165041791048\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]{M}_{4}=\\frac{1}{4}f\\left(\\frac{1}{8}\\right)+\\frac{1}{4}f\\left(\\frac{3}{8}\\right)+\\frac{1}{4}f\\left(\\frac{5}{8}\\right)+\\frac{1}{4}f\\left(\\frac{7}{8}\\right)=\\frac{1}{4}\\cdot \\frac{1}{64}+\\frac{1}{4}\\cdot \\frac{9}{64}+\\frac{1}{4}\\cdot \\frac{25}{64}+\\frac{1}{4}\\cdot \\frac{21}{64}=\\frac{21}{64}[\/latex].<\/div>\n<p>&nbsp;<\/p>\n<p id=\"fs-id1165041770066\">Since<\/p>\n<div id=\"fs-id1165041915328\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]{\\displaystyle\\int }_{0}^{1}{x}^{2}dx=\\frac{1}{3}\\text{and}|\\frac{1}{3}-\\frac{21}{64}|=\\frac{1}{192}\\approx 0.0052[\/latex],<\/div>\n<p>&nbsp;<\/p>\n<p id=\"fs-id1165042134377\">we see that the midpoint rule produces an estimate that is somewhat close to the actual value of the definite integral.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div id=\"fs-id1165041840100\" data-type=\"example\">\n<div id=\"fs-id1165042126032\" data-type=\"exercise\">\n<div id=\"fs-id1165041827477\" data-type=\"problem\">\n<div data-type=\"title\">\n<div class=\"textbox exercises\">\n<h3>Example:\u00a0Using the Midpoint Rule with [latex]{M}_{6}[\/latex]<\/h3>\n<div id=\"fs-id1165041827477\" data-type=\"problem\">\n<p id=\"fs-id1165042128953\">Use [latex]{M}_{6}[\/latex] to estimate the length of the curve [latex]y=\\frac{1}{2}{x}^{2}[\/latex] on [latex]\\left[1,4\\right][\/latex].<\/p>\n<\/div>\n<div class=\"qa-wrapper\" style=\"display: block\"><span class=\"show-answer collapsed\" style=\"cursor: pointer\" data-target=\"q44558898\">Show Solution<\/span><\/p>\n<div id=\"q44558898\" class=\"hidden-answer\" style=\"display: none\">\n<div id=\"fs-id1165040754773\" data-type=\"solution\">\n<p id=\"fs-id1165041805251\">The length of [latex]y=\\frac{1}{2}{x}^{2}[\/latex] on [latex]\\left[1,4\\right][\/latex] is<\/p>\n<div id=\"fs-id1165041813602\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]{\\displaystyle\\int }_{1}^{4}\\sqrt{1+{\\left(\\frac{dy}{dx}\\right)}^{2}}dx[\/latex].<\/div>\n<p>&nbsp;<\/p>\n<p id=\"fs-id1165040691246\">Since [latex]\\frac{dy}{dx}=x[\/latex], this integral becomes [latex]{\\displaystyle\\int }_{1}^{4}\\sqrt{1+{x}^{2}}dx[\/latex].<\/p>\n<p id=\"fs-id1165041893161\">If [latex]\\left[1,4\\right][\/latex] is divided into six subintervals, then each subinterval has length [latex]\\Delta x=\\frac{4 - 1}{6}=\\frac{1}{2}[\/latex] and the midpoints of the subintervals are [latex]\\left\\{\\frac{5}{4},\\frac{7}{4},\\frac{9}{4},\\frac{11}{4},\\frac{13}{4},\\frac{15}{4}\\right\\}[\/latex]. If we set [latex]f\\left(x\\right)=\\sqrt{1+{x}^{2}}[\/latex],<\/p>\n<div id=\"fs-id1165042017909\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]\\begin{array}{cc}\\hfill {M}_{6}& =\\frac{1}{2}f\\left(\\frac{5}{4}\\right)+\\frac{1}{2}f\\left(\\frac{7}{4}\\right)+\\frac{1}{2}f\\left(\\frac{9}{4}\\right)+\\frac{1}{2}f\\left(\\frac{11}{4}\\right)+\\frac{1}{2}f\\left(\\frac{13}{4}\\right)+\\frac{1}{2}f\\left(\\frac{15}{4}\\right)\\hfill \\\\ & \\approx \\frac{1}{2}\\left(1.6008+2.0156+2.4622+2.9262+3.4004+3.8810\\right)=8.1431.\\hfill \\end{array}[\/latex]<\/div>\n<p>&nbsp;<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div id=\"fs-id1165041894379\" class=\"checkpoint\" data-type=\"note\">\n<div id=\"fs-id1165042058790\" data-type=\"exercise\">\n<div id=\"fs-id1165042231132\" data-type=\"problem\">\n<div class=\"textbox key-takeaways\">\n<h3>try it<\/h3>\n<div id=\"fs-id1165042231132\" data-type=\"problem\">\n<p id=\"fs-id1165040706128\">Use the midpoint rule with [latex]n=2[\/latex] to estimate [latex]{\\displaystyle\\int }_{1}^{2}\\frac{1}{x}dx[\/latex].<\/p>\n<\/div>\n<div class=\"qa-wrapper\" style=\"display: block\"><span class=\"show-answer collapsed\" style=\"cursor: pointer\" data-target=\"q44558896\">Hint<\/span><\/p>\n<div id=\"q44558896\" class=\"hidden-answer\" style=\"display: none\">\n<div id=\"fs-id1165041834633\" data-type=\"commentary\" data-element-type=\"hint\">\n<p id=\"fs-id1165040743320\">[latex]\\Delta x=\\frac{1}{2}[\/latex], [latex]{m}_{1}=\\frac{5}{4}[\/latex], and [latex]{m}_{2}=\\frac{7}{4}[\/latex].<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"qa-wrapper\" style=\"display: block\"><span class=\"show-answer collapsed\" style=\"cursor: pointer\" data-target=\"q44558897\">Show Solution<\/span><\/p>\n<div id=\"q44558897\" class=\"hidden-answer\" style=\"display: none\">\n<div id=\"fs-id1165041815897\" data-type=\"solution\">\n<p id=\"fs-id1165041816976\">[latex]\\frac{24}{35}[\/latex]<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/section>\n<section id=\"fs-id1165041822197\" data-depth=\"1\">\n<h2 data-type=\"title\">The Trapezoidal Rule<\/h2>\n<p id=\"fs-id1165042006539\">We can also approximate the value of a definite integral by using trapezoids rather than rectangles. In Figure 2, the area beneath the curve is approximated by trapezoids rather than by rectangles.<\/p>\n<figure id=\"CNX_Calc_Figure_07_06_002\"><figcaption><\/figcaption><div style=\"width: 497px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/4175\/2019\/04\/11233834\/CNX_Calc_Figure_07_06_002.jpg\" alt=\"This figure is a graph of a non-negative function in the first quadrant. The function increases and decreases. The quadrant is divided into a grid. Beginning on the x-axis at the point labeled a = x sub 0, there are trapezoids shaded whose heights are approximately the height of the curve. The x-axis is scaled by increments of a = x sub 0, x sub 1, x sub 2, x sub 3, and b = x sub 4.\" width=\"487\" height=\"286\" data-media-type=\"image\/jpeg\" \/><\/p>\n<p class=\"wp-caption-text\">Figure 2. Trapezoids may be used to approximate the area under a curve, hence approximating the definite integral.<\/p>\n<\/div>\n<\/figure>\n<p id=\"fs-id1165041821083\">The <span data-type=\"term\">trapezoidal rule<\/span> for estimating definite integrals uses trapezoids rather than rectangles to approximate the area under a curve. To gain insight into the final form of the rule, consider the trapezoids shown in Figure 2. We assume that the length of each subinterval is given by [latex]\\Delta x[\/latex]. First, recall that the area of a trapezoid with a height of <em data-effect=\"italics\">h<\/em> and bases of length [latex]{b}_{1}[\/latex] and [latex]{b}_{2}[\/latex] is given by [latex]\\text{Area}=\\frac{1}{2}h\\left({b}_{1}+{b}_{2}\\right)[\/latex]. We see that the first trapezoid has a height [latex]\\Delta x[\/latex] and parallel bases of length [latex]f\\left({x}_{0}\\right)[\/latex] and [latex]f\\left({x}_{1}\\right)[\/latex]. Thus, the area of the first trapezoid in Figure 2 is<\/p>\n<div id=\"fs-id1165040644975\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]\\frac{1}{2}\\Delta x\\left(f\\left({x}_{0}\\right)+f\\left({x}_{1}\\right)\\right)[\/latex].<\/div>\n<p>&nbsp;<\/p>\n<p id=\"fs-id1165040713973\">The areas of the remaining three trapezoids are<\/p>\n<div id=\"fs-id1165042135238\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]\\frac{1}{2}\\Delta x\\left(f\\left({x}_{1}\\right)+f\\left({x}_{2}\\right)\\right),\\frac{1}{2}\\Delta x\\left(f\\left({x}_{2}\\right)+f\\left({x}_{3}\\right)\\right),\\text{and}\\frac{1}{2}\\Delta x\\left(f\\left({x}_{3}\\right)+f\\left({x}_{4}\\right)\\right)[\/latex].<\/div>\n<p>&nbsp;<\/p>\n<p id=\"fs-id1165041818057\">Consequently,<\/p>\n<div id=\"fs-id1165042136358\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]{\\displaystyle\\int }_{a}^{b}f\\left(x\\right)dx\\approx \\frac{1}{2}\\Delta x\\left(f\\left({x}_{0}\\right)+f\\left({x}_{1}\\right)\\right)+\\frac{1}{2}\\Delta x\\left(f\\left({x}_{1}\\right)+f\\left({x}_{2}\\right)\\right)+\\frac{1}{2}\\Delta x\\left(f\\left({x}_{2}\\right)+f\\left({x}_{3}\\right)\\right)+\\frac{1}{2}\\Delta x\\left(f\\left({x}_{3}\\right)+f\\left({x}_{4}\\right)\\right)[\/latex].<\/div>\n<p>&nbsp;<\/p>\n<p id=\"fs-id1165041800257\">After taking out a common factor of [latex]\\frac{1}{2}\\Delta x[\/latex] and combining like terms, we have<\/p>\n<div id=\"fs-id1165041782960\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]{\\displaystyle\\int }_{a}^{b}f\\left(x\\right)dx\\approx \\frac{1}{2}\\Delta x\\left(f\\left({x}_{0}\\right)+2f\\left({x}_{1}\\right)+2f\\left({x}_{2}\\right)+2f\\left({x}_{3}\\right)+f\\left({x}_{4}\\right)\\right)[\/latex].<\/div>\n<p>&nbsp;<\/p>\n<p id=\"fs-id1165040671242\">Generalizing, we formally state the following rule.<\/p>\n<div id=\"fs-id1165041809779\" class=\"theorem\" data-type=\"note\">\n<div data-type=\"title\">\n<div class=\"textbox shaded\">\n<h3 style=\"text-align: center;\" data-type=\"title\">The Trapezoidal Rule<\/h3>\n<hr \/>\n<p id=\"fs-id1165042129188\">Assume that [latex]f\\left(x\\right)[\/latex] is continuous over [latex]\\left[a,b\\right][\/latex]. Let <em data-effect=\"italics\">n<\/em> be a positive integer and [latex]\\Delta x=\\frac{b-a}{n}[\/latex]. Let [latex]\\left[a,b\\right][\/latex] be divided into [latex]n[\/latex] subintervals, each of length [latex]\\Delta x[\/latex], with endpoints at [latex]P=\\left\\{{x}_{0},{x}_{1},{x}_{2}\\ldots ,{x}_{n}\\right\\}[\/latex]. Set<\/p>\n<div id=\"fs-id1165041762506\" style=\"text-align: center;\" data-type=\"equation\">[latex]{T}_{n}=\\frac{1}{2}\\Delta x\\left(f\\left({x}_{0}\\right)+2f\\left({x}_{1}\\right)+2f\\left({x}_{2}\\right)+\\cdots +2f\\left({x}_{n - 1}\\right)+f\\left({x}_{n}\\right)\\right)[\/latex].<\/div>\n<p>&nbsp;<\/p>\n<p id=\"fs-id1165040744211\">Then, [latex]\\underset{n\\to \\text{+}\\infty }{\\text{lim}}{T}_{n}={\\displaystyle\\int }_{a}^{b}f\\left(x\\right)dx[\/latex].<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p id=\"fs-id1165041846939\">Before continuing, let\u2019s make a few observations about the trapezoidal rule. First of all, it is useful to note that<\/p>\n<div id=\"fs-id1165040697663\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]{T}_{n}=\\frac{1}{2}\\left({L}_{n}+{R}_{n}\\right)\\text{where}{L}_{n}=\\displaystyle\\sum _{i=1}^{n}f\\left({x}_{i - 1}\\right)\\Delta x\\text{and}{R}_{n}=\\displaystyle\\sum _{i=1}^{n}f\\left({x}_{i}\\right)\\Delta x[\/latex].<\/div>\n<p>&nbsp;<\/p>\n<p id=\"fs-id1165042027656\">That is, [latex]{L}_{n}[\/latex] and [latex]{R}_{n}[\/latex] approximate the integral using the left-hand and right-hand endpoints of each subinterval, respectively. In addition, a careful examination of Figure 3 leads us to make the following observations about using the trapezoidal rules and midpoint rules to estimate the definite integral of a nonnegative function. The trapezoidal rule tends to overestimate the value of a definite integral systematically over intervals where the function is concave up and to underestimate the value of a definite integral systematically over intervals where the function is concave down. On the other hand, the midpoint rule tends to average out these errors somewhat by partially overestimating and partially underestimating the value of the definite integral over these same types of intervals. This leads us to hypothesize that, in general, the midpoint rule tends to be more accurate than the trapezoidal rule.<\/p>\n<figure id=\"CNX_Calc_Figure_07_06_003\"><figcaption><\/figcaption><div style=\"width: 985px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/4175\/2019\/04\/11233837\/CNX_Calc_Figure_07_06_003.jpg\" alt=\"This figure has two graphs, both of the same non-negative function in the first quadrant. The function increases and decreases. The quadrant is divided into a grid. The first graph, beginning on the x-axis at the point labeled a = x sub 0, there are trapezoids shaded whose heights are approximately the height of the curve. The x-axis is scaled by increments of a = x sub 0, xsub1, x sub 2, x sub 3, and b = x sub 4. The second graph has on the x-axis at the point labeled a = x sub 0. There are rectangles shaded whose heights are approximately the height of the curve. The x-axis is scaled by increments of m sub 1, x sub 1, m sub 2, x sub 2, m sub 3, x sub 3, m sub 4 and b = x sub 4.\" width=\"975\" height=\"286\" data-media-type=\"image\/jpeg\" \/><\/p>\n<p class=\"wp-caption-text\">Figure 3. The trapezoidal rule tends to be less accurate than the midpoint rule.<\/p>\n<\/div>\n<\/figure>\n<div id=\"fs-id1165042234318\" data-type=\"example\">\n<div id=\"fs-id1165042008444\" data-type=\"exercise\">\n<div id=\"fs-id1165042008447\" data-type=\"problem\">\n<div data-type=\"title\">\n<div class=\"textbox exercises\">\n<h3>Example:\u00a0Using the Trapezoidal Rule<\/h3>\n<div id=\"fs-id1165042008447\" data-type=\"problem\">\n<p id=\"fs-id1165040682509\">Use the trapezoidal rule to estimate [latex]{\\displaystyle\\int }_{0}^{1}{x}^{2}dx[\/latex] using four subintervals.<\/p>\n<\/div>\n<div class=\"qa-wrapper\" style=\"display: block\"><span class=\"show-answer collapsed\" style=\"cursor: pointer\" data-target=\"q44558895\">Show Solution<\/span><\/p>\n<div id=\"q44558895\" class=\"hidden-answer\" style=\"display: none\">\n<div id=\"fs-id1165042108930\" data-type=\"solution\">\n<p id=\"fs-id1165042108932\">The endpoints of the subintervals consist of elements of the set [latex]P=\\left\\{0,\\frac{1}{4},\\frac{1}{2},\\frac{3}{4},1\\right\\}[\/latex] and [latex]\\Delta x=\\frac{1 - 0}{4}=\\frac{1}{4}[\/latex]. Thus,<\/p>\n<div id=\"fs-id1165041788152\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]\\begin{array}{cc}\\hfill {\\displaystyle\\int }_{0}^{1}{x}^{2}dx& \\approx \\frac{1}{2}\\cdot \\frac{1}{4}\\left(f\\left(0\\right)+2f\\left(\\frac{1}{4}\\right)+2f\\left(\\frac{1}{2}\\right)+2f\\left(\\frac{3}{4}\\right)+f\\left(1\\right)\\right)\\hfill \\\\ & =\\frac{1}{8}\\left(0+2\\cdot \\frac{1}{16}+2\\cdot \\frac{1}{4}+2\\cdot \\frac{9}{16}+1\\right)\\hfill \\\\ & =\\frac{11}{32}.\\hfill \\end{array}[\/latex]<\/div>\n<p>&nbsp;<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>Watch the following video to see the worked solution to Example:\u00a0Using the Trapezoidal Rule<\/p>\n<div style=\"text-align: center;\"><iframe loading=\"lazy\" title=\"YouTube video player\" src=\"https:\/\/www.youtube.com\/embed\/4nqKNEy0zlE?controls=0&amp;start=796&amp;end=1007&amp;autoplay=0\" width=\"750\" height=\"450\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/div>\n<p class=\"p1\">For closed captioning, open the video on its original page by clicking the Youtube logo in the lower right-hand corner of the video display. In YouTube, the video will begin at the same starting point as this clip, but will continue playing until the very end.<\/p>\n<p>You can view the <a href=\"https:\/\/oerfiles.s3.us-west-2.amazonaws.com\/Calculus+II\/Transcripts\/3.6.1_796to1007_transcript.html\" target=\"_blank\" rel=\"noopener\">transcript for this segmented clip of &#8220;3.6.1&#8221; here (opens in new window)<\/a>.<\/p>\n<div id=\"fs-id1165042009032\" class=\"checkpoint\" data-type=\"note\">\n<div id=\"fs-id1165041814721\" data-type=\"exercise\">\n<div id=\"fs-id1165041814723\" data-type=\"problem\">\n<div class=\"textbox key-takeaways\">\n<h3>try it<\/h3>\n<div id=\"fs-id1165041814723\" data-type=\"problem\">\n<p id=\"fs-id1165041814725\">Use the trapezoidal rule with [latex]n=2[\/latex] to estimate [latex]{\\displaystyle\\int }_{1}^{2}\\frac{1}{x}dx[\/latex].<\/p>\n<\/div>\n<div class=\"qa-wrapper\" style=\"display: block\"><span class=\"show-answer collapsed\" style=\"cursor: pointer\" data-target=\"q44558893\">Hint<\/span><\/p>\n<div id=\"q44558893\" class=\"hidden-answer\" style=\"display: none\">\n<div id=\"fs-id1165040692039\" data-type=\"commentary\" data-element-type=\"hint\">\n<p id=\"fs-id1165041803658\">Set [latex]\\Delta x=\\frac{1}{2}[\/latex]. The endpoints of the subintervals are the elements of the set [latex]P=\\left\\{1,\\frac{3}{2},2\\right\\}[\/latex].<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"qa-wrapper\" style=\"display: block\"><span class=\"show-answer collapsed\" style=\"cursor: pointer\" data-target=\"q44558894\">Show Solution<\/span><\/p>\n<div id=\"q44558894\" class=\"hidden-answer\" style=\"display: none\">\n<div id=\"fs-id1165041782503\" data-type=\"solution\">\n<p id=\"fs-id1165041782505\">[latex]\\frac{17}{24}[\/latex]<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/section>\n<section id=\"fs-id1165040757737\" data-depth=\"1\"><\/section>\n\n\t\t\t <section class=\"citations-section\" role=\"contentinfo\">\n\t\t\t <h3>Candela Citations<\/h3>\n\t\t\t\t\t <div>\n\t\t\t\t\t\t <div id=\"citation-list-1597\">\n\t\t\t\t\t\t\t <div class=\"licensing\"><div class=\"license-attribution-dropdown-subheading\">CC licensed content, Original<\/div><ul class=\"citation-list\"><li>3.6.1. <strong>Authored by<\/strong>: Ryan Melton. <strong>License<\/strong>: <em><a target=\"_blank\" rel=\"license\" href=\"https:\/\/creativecommons.org\/licenses\/by\/4.0\/\">CC BY: Attribution<\/a><\/em><\/li><\/ul><div class=\"license-attribution-dropdown-subheading\">CC licensed content, Shared previously<\/div><ul class=\"citation-list\"><li>Calculus Volume 2. <strong>Authored by<\/strong>: Gilbert Strang, Edwin (Jed) Herman. <strong>Provided by<\/strong>: OpenStax. <strong>Located at<\/strong>: <a target=\"_blank\" href=\"https:\/\/openstax.org\/books\/calculus-volume-2\/pages\/1-introduction\">https:\/\/openstax.org\/books\/calculus-volume-2\/pages\/1-introduction<\/a>. <strong>License<\/strong>: <em><a target=\"_blank\" rel=\"license\" href=\"https:\/\/creativecommons.org\/licenses\/by-nc-sa\/4.0\/\">CC BY-NC-SA: Attribution-NonCommercial-ShareAlike<\/a><\/em>. <strong>License Terms<\/strong>: Access for free at https:\/\/openstax.org\/books\/calculus-volume-2\/pages\/1-introduction<\/li><\/ul><\/div>\n\t\t\t\t\t\t <\/div>\n\t\t\t\t\t <\/div>\n\t\t\t <\/section>","protected":false},"author":17533,"menu_order":20,"template":"","meta":{"_candela_citation":"[{\"type\":\"cc\",\"description\":\"Calculus Volume 2\",\"author\":\"Gilbert Strang, Edwin (Jed) Herman\",\"organization\":\"OpenStax\",\"url\":\"https:\/\/openstax.org\/books\/calculus-volume-2\/pages\/1-introduction\",\"project\":\"\",\"license\":\"cc-by-nc-sa\",\"license_terms\":\"Access for free at https:\/\/openstax.org\/books\/calculus-volume-2\/pages\/1-introduction\"},{\"type\":\"original\",\"description\":\"3.6.1\",\"author\":\"Ryan Melton\",\"organization\":\"\",\"url\":\"\",\"project\":\"\",\"license\":\"cc-by\",\"license_terms\":\"\"}]","CANDELA_OUTCOMES_GUID":"","pb_show_title":"on","pb_short_title":"","pb_subtitle":"","pb_authors":[],"pb_section_license":""},"chapter-type":[],"contributor":[],"license":[],"class_list":["post-1597","chapter","type-chapter","status-publish","hentry"],"part":158,"_links":{"self":[{"href":"https:\/\/courses.lumenlearning.com\/calculus2\/wp-json\/pressbooks\/v2\/chapters\/1597","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/courses.lumenlearning.com\/calculus2\/wp-json\/pressbooks\/v2\/chapters"}],"about":[{"href":"https:\/\/courses.lumenlearning.com\/calculus2\/wp-json\/wp\/v2\/types\/chapter"}],"author":[{"embeddable":true,"href":"https:\/\/courses.lumenlearning.com\/calculus2\/wp-json\/wp\/v2\/users\/17533"}],"version-history":[{"count":5,"href":"https:\/\/courses.lumenlearning.com\/calculus2\/wp-json\/pressbooks\/v2\/chapters\/1597\/revisions"}],"predecessor-version":[{"id":2068,"href":"https:\/\/courses.lumenlearning.com\/calculus2\/wp-json\/pressbooks\/v2\/chapters\/1597\/revisions\/2068"}],"part":[{"href":"https:\/\/courses.lumenlearning.com\/calculus2\/wp-json\/pressbooks\/v2\/parts\/158"}],"metadata":[{"href":"https:\/\/courses.lumenlearning.com\/calculus2\/wp-json\/pressbooks\/v2\/chapters\/1597\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/courses.lumenlearning.com\/calculus2\/wp-json\/wp\/v2\/media?parent=1597"}],"wp:term":[{"taxonomy":"chapter-type","embeddable":true,"href":"https:\/\/courses.lumenlearning.com\/calculus2\/wp-json\/pressbooks\/v2\/chapter-type?post=1597"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/courses.lumenlearning.com\/calculus2\/wp-json\/wp\/v2\/contributor?post=1597"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/courses.lumenlearning.com\/calculus2\/wp-json\/wp\/v2\/license?post=1597"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}