{"id":762,"date":"2025-06-20T17:10:45","date_gmt":"2025-06-20T17:10:45","guid":{"rendered":"https:\/\/content.one.lumenlearning.com\/calculus2\/?post_type=chapter&#038;p=762"},"modified":"2025-07-18T16:28:04","modified_gmt":"2025-07-18T16:28:04","slug":"error-analysis-in-numerical-integration-learn-it-2","status":"publish","type":"chapter","link":"https:\/\/content.one.lumenlearning.com\/calculus2\/chapter\/error-analysis-in-numerical-integration-learn-it-2\/","title":{"raw":"Error Analysis in Numerical Integration: Learn It 2","rendered":"Error Analysis in Numerical Integration: Learn It 2"},"content":{"raw":"<h2 data-type=\"title\">Error Bounds for the Midpoint and Trapezoidal Rules<\/h2>\r\nIn practice, you won't always know the exact value of an integral you're approximating. That's why we need <strong>error bounds<\/strong>\u2014formulas that tell you the maximum possible error in your approximation without knowing the true answer.\r\n\r\n<section class=\"textbox keyTakeaway\" aria-label=\"Key Takeaway\">\r\n<h3>error bounds for the midpoint and trapezoidal rules<\/h3>\r\n<p class=\"whitespace-normal break-words\">Let [latex]f(x)[\/latex] be continuous on [latex][a,b][\/latex] with a second derivative [latex]f''(x)[\/latex]. If [latex]M[\/latex] is the maximum value of [latex]|f''(x)|[\/latex] on [latex][a,b][\/latex], then:<\/p>\r\n\r\n<ul>\r\n \t<li class=\"whitespace-normal break-words\"><strong>Midpoint Rule Error<\/strong>: [latex]\\text{Error in } M_n \\leq \\frac{M(b-a)^3}{24n^2}[\/latex]<\/li>\r\n \t<li class=\"whitespace-normal break-words\"><strong>Trapezoidal Rule Error<\/strong>: [latex]\\text{Error in } T_n \\leq \\frac{M(b-a)^3}{12n^2}[\/latex]<\/li>\r\n<\/ul>\r\n<p class=\"whitespace-normal break-words\">where [latex]n[\/latex] is the number of subintervals.<\/p>\r\n\r\n<\/section>You can use these formulas to determine how many subintervals you need to guarantee your error stays below a certain threshold. This involves solving inequalities.\r\n\r\n<section class=\"textbox recall\" aria-label=\"Recall\"><strong>Rules for Solving Inequalities\r\n[latex]\\\\[\/latex]\r\n<\/strong>The process of solving an inequality is similar to solving an equation by isolating the variable. There are several rules to keep in mind when solving these inequalities.\r\n<ol>\r\n \t<li>Adding or subtracting the same number to both sides of an inequality yields an equivalent statement.<\/li>\r\n \t<li>Multiplying or dividing the same positive number to both sides of an inequality yields an equivalent statement.<\/li>\r\n \t<li>Multiplying or dividing a <strong>negative <\/strong>number to both sides of an inequality reverses the direction of the inequality.<\/li>\r\n \t<li>If [latex] x^n \\le a \\: \\text{and}\\:x\\ge0[\/latex]\u00a0 then [latex] x \\le \\sqrt[n] {a} [\/latex]<\/li>\r\n<\/ol>\r\n<\/section><section class=\"textbox proTip\" aria-label=\"Pro Tip\">These error bound formulas reveal several important patterns.\r\n<ul>\r\n \t<li class=\"whitespace-normal break-words\">The error decreases as [latex]n^2[\/latex], so doubling the number of subintervals reduces the error by a factor of 4<\/li>\r\n \t<li class=\"whitespace-normal break-words\">The trapezoidal rule has twice the error bound of the midpoint rule (notice the 12 vs 24 in the denominators)<\/li>\r\n \t<li class=\"whitespace-normal break-words\">Larger intervals [latex](b-a)[\/latex] and functions with larger second derivatives lead to bigger errors<\/li>\r\n<\/ul>\r\n<\/section><section class=\"textbox example\" aria-label=\"Example\">\r\n<div id=\"fs-id1165041952725\" data-type=\"problem\">\r\n<p id=\"fs-id1165042137782\">What value of [latex]n[\/latex] should be used to guarantee that an estimate of [latex]{\\displaystyle\\int }_{0}^{1}{e}^{{x}^{2}}dx[\/latex] is accurate to within 0.01 if we use the midpoint rule?<\/p>\r\n\r\n<\/div>\r\n[reveal-answer q=\"44558879\"]Show Solution[\/reveal-answer]\r\n[hidden-answer a=\"44558879\"]\r\n<div id=\"fs-id1165041791703\" data-type=\"solution\">\r\n<p id=\"fs-id1165041791705\">We begin by determining the value of [latex]M[\/latex], the maximum value of [latex]|f\\text{''}\\left(x\\right)|[\/latex] over [latex]\\left[0,1\\right][\/latex] for [latex]f\\left(x\\right)={e}^{{x}^{2}}[\/latex]. Since [latex]{f}^{\\prime }\\left(x\\right)=2x{e}^{{x}^{2}}[\/latex], we have<\/p>\r\n\r\n<div id=\"fs-id1165040656611\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]f^{\\prime\\prime} \\left(x\\right)=2e^{x^2}+4{x}^{2}{e}^{x^2}[\/latex].<\/div>\r\n&nbsp;\r\n<p id=\"fs-id1165042196940\">Thus,<\/p>\r\n\r\n<div id=\"fs-id1165042196943\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]|f\\text{''}\\left(x\\right)|=2{e}^{{x}^{2}}\\left(1+2{x}^{2}\\right)\\le 2\\cdot e\\cdot 3=6e[\/latex].<\/div>\r\n&nbsp;\r\n<p id=\"fs-id1165041804288\">From the error-bound in the above theorem, we have<\/p>\r\n\r\n<div id=\"fs-id1165040716363\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]\\text{Error in }{M}_{n}\\le \\frac{M{\\left(b-a\\right)}^{3}}{24{n}^{2}}\\le \\frac{6e{\\left(1 - 0\\right)}^{3}}{24{n}^{2}}=\\frac{6e}{24{n}^{2}}[\/latex].<\/div>\r\n&nbsp;\r\n<p id=\"fs-id1165040772778\">Now we solve the following inequality for [latex]n\\text{:}[\/latex]<\/p>\r\n\r\n<div id=\"fs-id1165042265412\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]\\frac{6e}{24{n}^{2}}\\le 0.01[\/latex].<\/div>\r\n&nbsp;\r\n<p id=\"fs-id1165042005486\">Thus, [latex]n\\ge \\sqrt{\\frac{600e}{24}}\\approx 8.24[\/latex]. Since [latex]n[\/latex] must be an integer satisfying this inequality, a choice of [latex]n=9[\/latex] would guarantee that [latex]|{\\displaystyle\\int }_{0}^{1}{e}^{{x}^{2}}dx-{M}_{n}|&lt;0.01[\/latex].<\/p>\r\n&nbsp;\r\n\r\n<\/div>\r\n<div id=\"fs-id1165040794903\" data-type=\"commentary\">\r\n<div data-type=\"title\"><strong>Analysis<\/strong><\/div>\r\n<p id=\"fs-id1165042039031\">We might have been tempted to round [latex]8.24[\/latex] down and choose [latex]n=8[\/latex], but this would be incorrect because we must have an integer greater than or equal to [latex]8.24[\/latex]. We need to keep in mind that the error estimates provide an upper bound only for the error. The actual estimate may, in fact, be a much better approximation than is indicated by the error bound.<\/p>\r\n\r\n<\/div>\r\n[\/hidden-answer]\r\n\r\n<\/section><section class=\"textbox watchIt\" aria-label=\"Watch It\">Watch the following video to see the worked solution to the example above.<center><iframe src=\"\/\/plugin.3playmedia.com\/show?mf=6722689&amp;p3sdk_version=1.10.1&amp;p=20361&amp;pt=375&amp;video_id=p2ksWUqIjmU&amp;video_target=tpm-plugin-8ppncdgd-p2ksWUqIjmU\" width=\"800px\" height=\"450px\" frameborder=\"0\" marginwidth=\"0px\" marginheight=\"0px\" data-mce-fragment=\"1\"><\/iframe><\/center>You can view the <a href=\"https:\/\/oerfiles.s3.us-west-2.amazonaws.com\/Calculus+II\/Transcripts\/3.6.3_transcript.html\" target=\"_blank\" rel=\"noopener\">transcript for \"3.6.3\" here (opens in new window)<\/a>.\r\n\r\n<\/section>","rendered":"<h2 data-type=\"title\">Error Bounds for the Midpoint and Trapezoidal Rules<\/h2>\n<p>In practice, you won&#8217;t always know the exact value of an integral you&#8217;re approximating. That&#8217;s why we need <strong>error bounds<\/strong>\u2014formulas that tell you the maximum possible error in your approximation without knowing the true answer.<\/p>\n<section class=\"textbox keyTakeaway\" aria-label=\"Key Takeaway\">\n<h3>error bounds for the midpoint and trapezoidal rules<\/h3>\n<p class=\"whitespace-normal break-words\">Let [latex]f(x)[\/latex] be continuous on [latex][a,b][\/latex] with a second derivative [latex]f''(x)[\/latex]. If [latex]M[\/latex] is the maximum value of [latex]|f''(x)|[\/latex] on [latex][a,b][\/latex], then:<\/p>\n<ul>\n<li class=\"whitespace-normal break-words\"><strong>Midpoint Rule Error<\/strong>: [latex]\\text{Error in } M_n \\leq \\frac{M(b-a)^3}{24n^2}[\/latex]<\/li>\n<li class=\"whitespace-normal break-words\"><strong>Trapezoidal Rule Error<\/strong>: [latex]\\text{Error in } T_n \\leq \\frac{M(b-a)^3}{12n^2}[\/latex]<\/li>\n<\/ul>\n<p class=\"whitespace-normal break-words\">where [latex]n[\/latex] is the number of subintervals.<\/p>\n<\/section>\n<p>You can use these formulas to determine how many subintervals you need to guarantee your error stays below a certain threshold. This involves solving inequalities.<\/p>\n<section class=\"textbox recall\" aria-label=\"Recall\"><strong>Rules for Solving Inequalities<br \/>\n[latex]\\\\[\/latex]<br \/>\n<\/strong>The process of solving an inequality is similar to solving an equation by isolating the variable. There are several rules to keep in mind when solving these inequalities.<\/p>\n<ol>\n<li>Adding or subtracting the same number to both sides of an inequality yields an equivalent statement.<\/li>\n<li>Multiplying or dividing the same positive number to both sides of an inequality yields an equivalent statement.<\/li>\n<li>Multiplying or dividing a <strong>negative <\/strong>number to both sides of an inequality reverses the direction of the inequality.<\/li>\n<li>If [latex]x^n \\le a \\: \\text{and}\\:x\\ge0[\/latex]\u00a0 then [latex]x \\le \\sqrt[n] {a}[\/latex]<\/li>\n<\/ol>\n<\/section>\n<section class=\"textbox proTip\" aria-label=\"Pro Tip\">These error bound formulas reveal several important patterns.<\/p>\n<ul>\n<li class=\"whitespace-normal break-words\">The error decreases as [latex]n^2[\/latex], so doubling the number of subintervals reduces the error by a factor of 4<\/li>\n<li class=\"whitespace-normal break-words\">The trapezoidal rule has twice the error bound of the midpoint rule (notice the 12 vs 24 in the denominators)<\/li>\n<li class=\"whitespace-normal break-words\">Larger intervals [latex](b-a)[\/latex] and functions with larger second derivatives lead to bigger errors<\/li>\n<\/ul>\n<\/section>\n<section class=\"textbox example\" aria-label=\"Example\">\n<div id=\"fs-id1165041952725\" data-type=\"problem\">\n<p id=\"fs-id1165042137782\">What value of [latex]n[\/latex] should be used to guarantee that an estimate of [latex]{\\displaystyle\\int }_{0}^{1}{e}^{{x}^{2}}dx[\/latex] is accurate to within 0.01 if we use the midpoint rule?<\/p>\n<\/div>\n<div class=\"qa-wrapper\" style=\"display: block\"><button class=\"show-answer show-answer-button collapsed\" data-target=\"q44558879\">Show Solution<\/button><\/p>\n<div id=\"q44558879\" class=\"hidden-answer\" style=\"display: none\">\n<div id=\"fs-id1165041791703\" data-type=\"solution\">\n<p id=\"fs-id1165041791705\">We begin by determining the value of [latex]M[\/latex], the maximum value of [latex]|f\\text{''}\\left(x\\right)|[\/latex] over [latex]\\left[0,1\\right][\/latex] for [latex]f\\left(x\\right)={e}^{{x}^{2}}[\/latex]. Since [latex]{f}^{\\prime }\\left(x\\right)=2x{e}^{{x}^{2}}[\/latex], we have<\/p>\n<div id=\"fs-id1165040656611\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]f^{\\prime\\prime} \\left(x\\right)=2e^{x^2}+4{x}^{2}{e}^{x^2}[\/latex].<\/div>\n<p>&nbsp;<\/p>\n<p id=\"fs-id1165042196940\">Thus,<\/p>\n<div id=\"fs-id1165042196943\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]|f\\text{''}\\left(x\\right)|=2{e}^{{x}^{2}}\\left(1+2{x}^{2}\\right)\\le 2\\cdot e\\cdot 3=6e[\/latex].<\/div>\n<p>&nbsp;<\/p>\n<p id=\"fs-id1165041804288\">From the error-bound in the above theorem, we have<\/p>\n<div id=\"fs-id1165040716363\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]\\text{Error in }{M}_{n}\\le \\frac{M{\\left(b-a\\right)}^{3}}{24{n}^{2}}\\le \\frac{6e{\\left(1 - 0\\right)}^{3}}{24{n}^{2}}=\\frac{6e}{24{n}^{2}}[\/latex].<\/div>\n<p>&nbsp;<\/p>\n<p id=\"fs-id1165040772778\">Now we solve the following inequality for [latex]n\\text{:}[\/latex]<\/p>\n<div id=\"fs-id1165042265412\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]\\frac{6e}{24{n}^{2}}\\le 0.01[\/latex].<\/div>\n<p>&nbsp;<\/p>\n<p id=\"fs-id1165042005486\">Thus, [latex]n\\ge \\sqrt{\\frac{600e}{24}}\\approx 8.24[\/latex]. Since [latex]n[\/latex] must be an integer satisfying this inequality, a choice of [latex]n=9[\/latex] would guarantee that [latex]|{\\displaystyle\\int }_{0}^{1}{e}^{{x}^{2}}dx-{M}_{n}|<0.01[\/latex].<\/p>\n<p>&nbsp;<\/p>\n<\/div>\n<div id=\"fs-id1165040794903\" data-type=\"commentary\">\n<div data-type=\"title\"><strong>Analysis<\/strong><\/div>\n<p id=\"fs-id1165042039031\">We might have been tempted to round [latex]8.24[\/latex] down and choose [latex]n=8[\/latex], but this would be incorrect because we must have an integer greater than or equal to [latex]8.24[\/latex]. We need to keep in mind that the error estimates provide an upper bound only for the error. The actual estimate may, in fact, be a much better approximation than is indicated by the error bound.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/section>\n<section class=\"textbox watchIt\" aria-label=\"Watch It\">Watch the following video to see the worked solution to the example above.<\/p>\n<div style=\"text-align: center;\"><iframe loading=\"lazy\" src=\"\/\/plugin.3playmedia.com\/show?mf=6722689&amp;p3sdk_version=1.10.1&amp;p=20361&amp;pt=375&amp;video_id=p2ksWUqIjmU&amp;video_target=tpm-plugin-8ppncdgd-p2ksWUqIjmU\" width=\"800px\" height=\"450px\" frameborder=\"0\" marginwidth=\"0px\" marginheight=\"0px\" data-mce-fragment=\"1\"><\/iframe><\/div>\n<p>You can view the <a href=\"https:\/\/oerfiles.s3.us-west-2.amazonaws.com\/Calculus+II\/Transcripts\/3.6.3_transcript.html\" target=\"_blank\" rel=\"noopener\">transcript for &#8220;3.6.3&#8221; here (opens in new window)<\/a>.<\/p>\n<\/section>\n","protected":false},"author":15,"menu_order":12,"template":"","meta":{"_candela_citation":"[]","pb_show_title":"on","pb_short_title":"","pb_subtitle":"","pb_authors":[],"pb_section_license":""},"chapter-type":[],"contributor":[],"license":[],"part":667,"module-header":"- Select Header -","content_attributions":[],"internal_book_links":[],"video_content":null,"cc_video_embed_content":{"cc_scripts":"","media_targets":[]},"try_it_collection":null,"_links":{"self":[{"href":"https:\/\/content.one.lumenlearning.com\/calculus2\/wp-json\/pressbooks\/v2\/chapters\/762"}],"collection":[{"href":"https:\/\/content.one.lumenlearning.com\/calculus2\/wp-json\/pressbooks\/v2\/chapters"}],"about":[{"href":"https:\/\/content.one.lumenlearning.com\/calculus2\/wp-json\/wp\/v2\/types\/chapter"}],"author":[{"embeddable":true,"href":"https:\/\/content.one.lumenlearning.com\/calculus2\/wp-json\/wp\/v2\/users\/15"}],"version-history":[{"count":4,"href":"https:\/\/content.one.lumenlearning.com\/calculus2\/wp-json\/pressbooks\/v2\/chapters\/762\/revisions"}],"predecessor-version":[{"id":1332,"href":"https:\/\/content.one.lumenlearning.com\/calculus2\/wp-json\/pressbooks\/v2\/chapters\/762\/revisions\/1332"}],"part":[{"href":"https:\/\/content.one.lumenlearning.com\/calculus2\/wp-json\/pressbooks\/v2\/parts\/667"}],"metadata":[{"href":"https:\/\/content.one.lumenlearning.com\/calculus2\/wp-json\/pressbooks\/v2\/chapters\/762\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/content.one.lumenlearning.com\/calculus2\/wp-json\/wp\/v2\/media?parent=762"}],"wp:term":[{"taxonomy":"chapter-type","embeddable":true,"href":"https:\/\/content.one.lumenlearning.com\/calculus2\/wp-json\/pressbooks\/v2\/chapter-type?post=762"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/content.one.lumenlearning.com\/calculus2\/wp-json\/wp\/v2\/contributor?post=762"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/content.one.lumenlearning.com\/calculus2\/wp-json\/wp\/v2\/license?post=762"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}