{"id":766,"date":"2025-06-20T17:10:55","date_gmt":"2025-06-20T17:10:55","guid":{"rendered":"https:\/\/content.one.lumenlearning.com\/calculus2\/?post_type=chapter&#038;p=766"},"modified":"2025-09-05T17:50:48","modified_gmt":"2025-09-05T17:50:48","slug":"error-analysis-in-numerical-integration-fresh-take","status":"publish","type":"chapter","link":"https:\/\/content.one.lumenlearning.com\/calculus2\/chapter\/error-analysis-in-numerical-integration-fresh-take\/","title":{"raw":"Error Analysis in Numerical Integration: Fresh Take","rendered":"Error Analysis in Numerical Integration: Fresh Take"},"content":{"raw":"<section class=\"textbox learningGoals\" aria-label=\"Learning Goals\">\r\n<ul>\r\n \t<li>Calculate how far off your numerical approximation might be from the true value<\/li>\r\n \t<li>Use error-bound formulas to estimate the accuracy of your approximation<\/li>\r\n<\/ul>\r\n<\/section>\r\n<h2>Absolute and Relative Error<\/h2>\r\n<div class=\"textbox shaded\">\r\n\r\n<strong>The Main Idea\u00a0<\/strong>\r\n<p class=\"whitespace-normal break-words\">When using numerical integration methods, you need to assess the quality of your approximation. Absolute and relative error give you different but complementary perspectives on accuracy, helping you understand both the size and significance of your approximation error.<\/p>\r\n<p class=\"whitespace-normal break-words\"><strong>The Two Error Types:<\/strong><\/p>\r\n<p class=\"whitespace-normal break-words\"><strong>Absolute Error<\/strong> = [latex]|A - B|[\/latex] (where [latex]A[\/latex] = true value, [latex]B[\/latex] = approximation)<\/p>\r\n\r\n<ul class=\"[&amp;:not(:last-child)_ul]:pb-1 [&amp;:not(:last-child)_ol]:pb-1 list-disc space-y-1.5 pl-7\">\r\n \t<li class=\"whitespace-normal break-words\">Tells you the actual difference between your estimate and the true value<\/li>\r\n \t<li class=\"whitespace-normal break-words\">Same units as your original measurement<\/li>\r\n \t<li class=\"whitespace-normal break-words\">Doesn't account for the scale of the true value<\/li>\r\n<\/ul>\r\n<p class=\"whitespace-normal break-words\"><strong>Relative Error<\/strong> = [latex]\\left|\\frac{A - B}{A}\\right| \\times 100%[\/latex]<\/p>\r\n\r\n<ul class=\"[&amp;:not(:last-child)_ul]:pb-1 [&amp;:not(:last-child)_ol]:pb-1 list-disc space-y-1.5 pl-7\">\r\n \t<li class=\"whitespace-normal break-words\">Expresses error as a percentage of the true value<\/li>\r\n \t<li class=\"whitespace-normal break-words\">Shows how significant the error is in context<\/li>\r\n \t<li class=\"whitespace-normal break-words\">Better for comparing accuracy across different problems<\/li>\r\n<\/ul>\r\n<p class=\"whitespace-normal break-words\">When comparing numerical methods (midpoint rule vs. trapezoidal rule), relative error often provides better insight into which method performs better overall. A method might have higher absolute error but lower relative error, making it more reliable for practical purposes.<\/p>\r\n<p class=\"whitespace-normal break-words\">Relative error helps you answer the crucial question: \"Is this approximation good enough for my purposes?\" An absolute error of [latex]0.001[\/latex] might be terrible for measuring microscopic distances but excellent for measuring building heights. Consider two scenarios:<\/p>\r\n\r\n<ul class=\"[&amp;:not(:last-child)_ul]:pb-1 [&amp;:not(:last-child)_ol]:pb-1 list-disc space-y-1.5 pl-7\">\r\n \t<li class=\"whitespace-normal break-words\">Error of [latex]0.01[\/latex] when true value is [latex]0.02[\/latex] ([latex]50 \\%[\/latex] relative error - very bad!)<\/li>\r\n \t<li class=\"whitespace-normal break-words\">Error of [latex]0.01[\/latex] when true value is [latex]100 [\/latex] ([latex]0.01 \\%[\/latex] relative error - excellent!)<\/li>\r\n<\/ul>\r\n<p class=\"whitespace-normal break-words\">The same absolute error can have vastly different meanings depending on context.<\/p>\r\n\r\n<\/div>\r\n<section class=\"textbox example\" aria-label=\"Example\">\r\n<div id=\"fs-id1165042133508\" data-type=\"problem\">\r\n<p id=\"fs-id1165042133510\">In an previous example, we estimated [latex]{\\displaystyle\\int }_{1}^{2}\\frac{1}{x}dx[\/latex] to be [latex]\\frac{24}{35}[\/latex] using [latex]{T}_{2}[\/latex]. The actual value of this integral is [latex]\\text{ln}2[\/latex]. Using [latex]\\frac{24}{35}\\approx 0.6857[\/latex] and [latex]\\text{ln}2\\approx 0.6931[\/latex], calculate the absolute error and the relative error.<\/p>\r\n\r\n<\/div>\r\n[reveal-answer q=\"44558890\"]Show Solution[\/reveal-answer]\r\n[hidden-answer a=\"44558890\"]\r\n<div id=\"fs-id1165041840001\" data-type=\"solution\">\r\n<p id=\"fs-id1165041840003\">0.0074, 1.1%<\/p>\r\n\r\n<\/div>\r\n[\/hidden-answer]\r\n\r\n<\/section>\r\n<h2 data-type=\"title\">Error Bounds for the Midpoint and Trapezoidal Rules<\/h2>\r\n<div class=\"textbox shaded\">\r\n\r\n<strong>The Main Idea\u00a0<\/strong>\r\n<p class=\"whitespace-normal break-words\">Error bounds give you mathematical guarantees about the worst-case scenario for your numerical approximation. Instead of hoping your estimate is accurate, you can determine exactly how many subintervals you need to achieve a specific level of precision.<\/p>\r\n<p class=\"whitespace-normal break-words\">The error bound formulas:<\/p>\r\n<p class=\"whitespace-normal break-words\"><strong>Midpoint Rule<\/strong>: [latex]\\text{Error in } M_n \\leq \\frac{M(b-a)^3}{24n^2}[\/latex]<\/p>\r\n<p class=\"whitespace-normal break-words\"><strong>Trapezoidal Rule<\/strong>: [latex]\\text{Error in } T_n \\leq \\frac{M(b-a)^3}{12n^2}[\/latex]<\/p>\r\n<p class=\"whitespace-normal break-words\">Where [latex]M[\/latex] = maximum value of [latex]|f''(x)|[\/latex] on [latex][a,b][\/latex]<\/p>\r\n<p class=\"whitespace-normal break-words\">Key insights from the formulas:<\/p>\r\n\r\n<ul class=\"[&amp;:not(:last-child)_ul]:pb-1 [&amp;:not(:last-child)_ol]:pb-1 list-disc space-y-1.5 pl-7\">\r\n \t<li class=\"whitespace-normal break-words\"><strong>Midpoint rule is twice as accurate<\/strong> as trapezoidal rule (note the 24 vs 12 in denominators)<\/li>\r\n \t<li class=\"whitespace-normal break-words\"><strong>Error decreases as [latex]n^2[\/latex]<\/strong>: doubling subintervals cuts error by factor of 4<\/li>\r\n \t<li class=\"whitespace-normal break-words\"><strong>Second derivative matters<\/strong>: functions with large [latex]|f''(x)|[\/latex] need more subintervals<\/li>\r\n \t<li class=\"whitespace-normal break-words\"><strong>Interval length impacts error<\/strong>: longer intervals [latex](b-a)[\/latex] increase error bounds<\/li>\r\n<\/ul>\r\n<p class=\"whitespace-normal break-words\"><strong>Problem-Solving Strategy:<\/strong><\/p>\r\n\r\n<ol class=\"[&amp;:not(:last-child)_ul]:pb-1 [&amp;:not(:last-child)_ol]:pb-1 list-decimal space-y-1.5 pl-7\">\r\n \t<li class=\"whitespace-normal break-words\"><strong>Find [latex]f''(x)[\/latex]<\/strong> and determine its maximum absolute value [latex]M[\/latex] on your interval<\/li>\r\n \t<li class=\"whitespace-normal break-words\"><strong>Set up the inequality<\/strong>: [latex]\\frac{M(b-a)^3}{24n^2} \\leq \\text{desired accuracy}[\/latex] (for midpoint rule)<\/li>\r\n \t<li class=\"whitespace-normal break-words\"><strong>Solve for [latex]n[\/latex]<\/strong>: [latex]n \\geq \\sqrt{\\frac{M(b-a)^3}{24 \\times \\text{desired accuracy}}}[\/latex]<\/li>\r\n \t<li class=\"whitespace-normal break-words\"><strong>Round up to the next integer<\/strong>: error bounds require [latex]n[\/latex] to be <strong>at least<\/strong> your calculated value<\/li>\r\n<\/ol>\r\n<p class=\"whitespace-normal break-words\">These formulas give you upper bounds\u2014your actual error might be much smaller, but it's guaranteed to be no larger than the bound specifies.<\/p>\r\n\r\n<\/div>\r\n<section class=\"textbox example\" aria-label=\"Example\">\r\n<div id=\"fs-id1165041831948\" data-type=\"problem\">\r\n<p id=\"fs-id1165041831950\">Find an upper bound for the error in using [latex]{M}_{4}[\/latex] to estimate [latex]{\\displaystyle\\int }_{0}^{1}{x}^{2}dx[\/latex].<\/p>\r\n\r\n<\/div>\r\n[reveal-answer q=\"44558859\"]Hint[\/reveal-answer]\r\n[hidden-answer a=\"44558859\"]\r\n<div id=\"fs-id1165041836992\" data-type=\"commentary\" data-element-type=\"hint\">\r\n<p id=\"fs-id1165041836999\">[latex]f\\text{''}\\left(x\\right)=2[\/latex], so [latex]M=2[\/latex].<\/p>\r\n\r\n<\/div>\r\n[\/hidden-answer]\r\n\r\n[reveal-answer q=\"44558869\"]Show Solution[\/reveal-answer]\r\n[hidden-answer a=\"44558869\"]\r\n<div id=\"fs-id1165040640441\" data-type=\"solution\">\r\n<p id=\"fs-id1165040640443\">[latex]\\frac{1}{192}[\/latex]<\/p>\r\n\r\n<\/div>\r\n[\/hidden-answer]\r\n\r\n<\/section>","rendered":"<section class=\"textbox learningGoals\" aria-label=\"Learning Goals\">\n<ul>\n<li>Calculate how far off your numerical approximation might be from the true value<\/li>\n<li>Use error-bound formulas to estimate the accuracy of your approximation<\/li>\n<\/ul>\n<\/section>\n<h2>Absolute and Relative Error<\/h2>\n<div class=\"textbox shaded\">\n<p><strong>The Main Idea\u00a0<\/strong><\/p>\n<p class=\"whitespace-normal break-words\">When using numerical integration methods, you need to assess the quality of your approximation. Absolute and relative error give you different but complementary perspectives on accuracy, helping you understand both the size and significance of your approximation error.<\/p>\n<p class=\"whitespace-normal break-words\"><strong>The Two Error Types:<\/strong><\/p>\n<p class=\"whitespace-normal break-words\"><strong>Absolute Error<\/strong> = [latex]|A - B|[\/latex] (where [latex]A[\/latex] = true value, [latex]B[\/latex] = approximation)<\/p>\n<ul class=\"[&amp;:not(:last-child)_ul]:pb-1 [&amp;:not(:last-child)_ol]:pb-1 list-disc space-y-1.5 pl-7\">\n<li class=\"whitespace-normal break-words\">Tells you the actual difference between your estimate and the true value<\/li>\n<li class=\"whitespace-normal break-words\">Same units as your original measurement<\/li>\n<li class=\"whitespace-normal break-words\">Doesn&#8217;t account for the scale of the true value<\/li>\n<\/ul>\n<p class=\"whitespace-normal break-words\"><strong>Relative Error<\/strong> = [latex]\\left|\\frac{A - B}{A}\\right| \\times 100%[\/latex]<\/p>\n<ul class=\"[&amp;:not(:last-child)_ul]:pb-1 [&amp;:not(:last-child)_ol]:pb-1 list-disc space-y-1.5 pl-7\">\n<li class=\"whitespace-normal break-words\">Expresses error as a percentage of the true value<\/li>\n<li class=\"whitespace-normal break-words\">Shows how significant the error is in context<\/li>\n<li class=\"whitespace-normal break-words\">Better for comparing accuracy across different problems<\/li>\n<\/ul>\n<p class=\"whitespace-normal break-words\">When comparing numerical methods (midpoint rule vs. trapezoidal rule), relative error often provides better insight into which method performs better overall. A method might have higher absolute error but lower relative error, making it more reliable for practical purposes.<\/p>\n<p class=\"whitespace-normal break-words\">Relative error helps you answer the crucial question: &#8220;Is this approximation good enough for my purposes?&#8221; An absolute error of [latex]0.001[\/latex] might be terrible for measuring microscopic distances but excellent for measuring building heights. Consider two scenarios:<\/p>\n<ul class=\"[&amp;:not(:last-child)_ul]:pb-1 [&amp;:not(:last-child)_ol]:pb-1 list-disc space-y-1.5 pl-7\">\n<li class=\"whitespace-normal break-words\">Error of [latex]0.01[\/latex] when true value is [latex]0.02[\/latex] ([latex]50 \\%[\/latex] relative error &#8211; very bad!)<\/li>\n<li class=\"whitespace-normal break-words\">Error of [latex]0.01[\/latex] when true value is [latex]100[\/latex] ([latex]0.01 \\%[\/latex] relative error &#8211; excellent!)<\/li>\n<\/ul>\n<p class=\"whitespace-normal break-words\">The same absolute error can have vastly different meanings depending on context.<\/p>\n<\/div>\n<section class=\"textbox example\" aria-label=\"Example\">\n<div id=\"fs-id1165042133508\" data-type=\"problem\">\n<p id=\"fs-id1165042133510\">In an previous example, we estimated [latex]{\\displaystyle\\int }_{1}^{2}\\frac{1}{x}dx[\/latex] to be [latex]\\frac{24}{35}[\/latex] using [latex]{T}_{2}[\/latex]. The actual value of this integral is [latex]\\text{ln}2[\/latex]. Using [latex]\\frac{24}{35}\\approx 0.6857[\/latex] and [latex]\\text{ln}2\\approx 0.6931[\/latex], calculate the absolute error and the relative error.<\/p>\n<\/div>\n<div class=\"qa-wrapper\" style=\"display: block\"><button class=\"show-answer show-answer-button collapsed\" data-target=\"q44558890\">Show Solution<\/button><\/p>\n<div id=\"q44558890\" class=\"hidden-answer\" style=\"display: none\">\n<div id=\"fs-id1165041840001\" data-type=\"solution\">\n<p id=\"fs-id1165041840003\">0.0074, 1.1%<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/section>\n<h2 data-type=\"title\">Error Bounds for the Midpoint and Trapezoidal Rules<\/h2>\n<div class=\"textbox shaded\">\n<p><strong>The Main Idea\u00a0<\/strong><\/p>\n<p class=\"whitespace-normal break-words\">Error bounds give you mathematical guarantees about the worst-case scenario for your numerical approximation. Instead of hoping your estimate is accurate, you can determine exactly how many subintervals you need to achieve a specific level of precision.<\/p>\n<p class=\"whitespace-normal break-words\">The error bound formulas:<\/p>\n<p class=\"whitespace-normal break-words\"><strong>Midpoint Rule<\/strong>: [latex]\\text{Error in } M_n \\leq \\frac{M(b-a)^3}{24n^2}[\/latex]<\/p>\n<p class=\"whitespace-normal break-words\"><strong>Trapezoidal Rule<\/strong>: [latex]\\text{Error in } T_n \\leq \\frac{M(b-a)^3}{12n^2}[\/latex]<\/p>\n<p class=\"whitespace-normal break-words\">Where [latex]M[\/latex] = maximum value of [latex]|f''(x)|[\/latex] on [latex][a,b][\/latex]<\/p>\n<p class=\"whitespace-normal break-words\">Key insights from the formulas:<\/p>\n<ul class=\"[&amp;:not(:last-child)_ul]:pb-1 [&amp;:not(:last-child)_ol]:pb-1 list-disc space-y-1.5 pl-7\">\n<li class=\"whitespace-normal break-words\"><strong>Midpoint rule is twice as accurate<\/strong> as trapezoidal rule (note the 24 vs 12 in denominators)<\/li>\n<li class=\"whitespace-normal break-words\"><strong>Error decreases as [latex]n^2[\/latex]<\/strong>: doubling subintervals cuts error by factor of 4<\/li>\n<li class=\"whitespace-normal break-words\"><strong>Second derivative matters<\/strong>: functions with large [latex]|f''(x)|[\/latex] need more subintervals<\/li>\n<li class=\"whitespace-normal break-words\"><strong>Interval length impacts error<\/strong>: longer intervals [latex](b-a)[\/latex] increase error bounds<\/li>\n<\/ul>\n<p class=\"whitespace-normal break-words\"><strong>Problem-Solving Strategy:<\/strong><\/p>\n<ol class=\"[&amp;:not(:last-child)_ul]:pb-1 [&amp;:not(:last-child)_ol]:pb-1 list-decimal space-y-1.5 pl-7\">\n<li class=\"whitespace-normal break-words\"><strong>Find [latex]f''(x)[\/latex]<\/strong> and determine its maximum absolute value [latex]M[\/latex] on your interval<\/li>\n<li class=\"whitespace-normal break-words\"><strong>Set up the inequality<\/strong>: [latex]\\frac{M(b-a)^3}{24n^2} \\leq \\text{desired accuracy}[\/latex] (for midpoint rule)<\/li>\n<li class=\"whitespace-normal break-words\"><strong>Solve for [latex]n[\/latex]<\/strong>: [latex]n \\geq \\sqrt{\\frac{M(b-a)^3}{24 \\times \\text{desired accuracy}}}[\/latex]<\/li>\n<li class=\"whitespace-normal break-words\"><strong>Round up to the next integer<\/strong>: error bounds require [latex]n[\/latex] to be <strong>at least<\/strong> your calculated value<\/li>\n<\/ol>\n<p class=\"whitespace-normal break-words\">These formulas give you upper bounds\u2014your actual error might be much smaller, but it&#8217;s guaranteed to be no larger than the bound specifies.<\/p>\n<\/div>\n<section class=\"textbox example\" aria-label=\"Example\">\n<div id=\"fs-id1165041831948\" data-type=\"problem\">\n<p id=\"fs-id1165041831950\">Find an upper bound for the error in using [latex]{M}_{4}[\/latex] to estimate [latex]{\\displaystyle\\int }_{0}^{1}{x}^{2}dx[\/latex].<\/p>\n<\/div>\n<div class=\"qa-wrapper\" style=\"display: block\"><button class=\"show-answer show-answer-button collapsed\" data-target=\"q44558859\">Hint<\/button><\/p>\n<div id=\"q44558859\" class=\"hidden-answer\" style=\"display: none\">\n<div id=\"fs-id1165041836992\" data-type=\"commentary\" data-element-type=\"hint\">\n<p id=\"fs-id1165041836999\">[latex]f\\text{''}\\left(x\\right)=2[\/latex], so [latex]M=2[\/latex].<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"qa-wrapper\" style=\"display: block\"><button class=\"show-answer show-answer-button collapsed\" data-target=\"q44558869\">Show Solution<\/button><\/p>\n<div id=\"q44558869\" class=\"hidden-answer\" style=\"display: none\">\n<div id=\"fs-id1165040640441\" data-type=\"solution\">\n<p id=\"fs-id1165040640443\">[latex]\\frac{1}{192}[\/latex]<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/section>\n","protected":false},"author":15,"menu_order":14,"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\/766"}],"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":7,"href":"https:\/\/content.one.lumenlearning.com\/calculus2\/wp-json\/pressbooks\/v2\/chapters\/766\/revisions"}],"predecessor-version":[{"id":2230,"href":"https:\/\/content.one.lumenlearning.com\/calculus2\/wp-json\/pressbooks\/v2\/chapters\/766\/revisions\/2230"}],"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\/766\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/content.one.lumenlearning.com\/calculus2\/wp-json\/wp\/v2\/media?parent=766"}],"wp:term":[{"taxonomy":"chapter-type","embeddable":true,"href":"https:\/\/content.one.lumenlearning.com\/calculus2\/wp-json\/pressbooks\/v2\/chapter-type?post=766"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/content.one.lumenlearning.com\/calculus2\/wp-json\/wp\/v2\/contributor?post=766"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/content.one.lumenlearning.com\/calculus2\/wp-json\/wp\/v2\/license?post=766"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}