{"id":751,"date":"2025-06-20T17:10:02","date_gmt":"2025-06-20T17:10:02","guid":{"rendered":"https:\/\/content.one.lumenlearning.com\/calculus2\/?post_type=chapter&#038;p=751"},"modified":"2025-07-18T16:07:08","modified_gmt":"2025-07-18T16:07:08","slug":"numerical-integration-methods-learn-it-3","status":"publish","type":"chapter","link":"https:\/\/content.one.lumenlearning.com\/calculus2\/chapter\/numerical-integration-methods-learn-it-3\/","title":{"raw":"Numerical Integration Methods: Learn It 3","rendered":"Numerical Integration Methods: Learn It 3"},"content":{"raw":"<h2>Simpson's Rule<\/h2>\r\n<p class=\"whitespace-normal break-words\">We have seen how the midpoint rule approximates curves with rectangles and the trapezoidal rule uses straight lines. Simpson's rule takes this progression further by <strong>approximating curves with parabolas<\/strong> (quadratic functions).<\/p>\r\n<p class=\"whitespace-normal break-words\">This method uses piecewise quadratic functions to follow the curve more accurately than either rectangles or straight-line segments.<\/p>\r\n\r\n<h3 class=\"text-xl font-bold text-text-100 mt-1 -mb-0.5\">How Simpson's Rule Works<\/h3>\r\n<p class=\"whitespace-normal break-words\">The setup requires partitioning the interval into an <strong>even number<\/strong> of subintervals, each with equal width. This even number requirement is essential because we work with pairs of subintervals.<\/p>\r\n<p class=\"whitespace-normal break-words\"><strong>For each pair of subintervals:<\/strong> Over the first pair of subintervals, we approximate [latex]\\int_{x_0}^{x_2} f(x)dx[\/latex] with [latex]\\int_{x_0}^{x_2} p(x)dx[\/latex], where [latex]p(x) = Ax^2 + Bx + C[\/latex] is the unique quadratic function passing through the three points [latex](x_0, f(x_0))[\/latex], [latex](x_1, f(x_1))[\/latex], and [latex](x_2, f(x_2))[\/latex].<\/p>\r\n<p class=\"whitespace-normal break-words\"><strong>Continuing the pattern:<\/strong> Over the next pair of subintervals, we approximate [latex]\\int_{x_2}^{x_4} f(x)dx[\/latex] with the integral of another quadratic function passing through [latex](x_2, f(x_2))[\/latex], [latex](x_3, f(x_3))[\/latex], and [latex](x_4, f(x_4))[\/latex]. This process continues with each successive pair of subintervals.<\/p>\r\n\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\/11233841\/CNX_Calc_Figure_07_06_004.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 x sub 0, there are trapezoids shaded whose heights are represented by the function p(x), which is a curve following an approximate path of the original graph. The x-axis is scaled by increments of x sub 0, x sub 1, x sub 2. The second graph has on the x-axis at the point labeled x sub 0. There are shaded regions under the curve, divided by x sub 0, x sub 1, x sub 2, x sub 3, and x sub 4. The curve is sectioned into two different parts above the shaded areas. These two parts are labeled p sub 1(x) and p sub 2(x).\" width=\"975\" height=\"286\" data-media-type=\"image\/jpeg\" \/> Figure 4. With Simpson\u2019s rule, we approximate a definite integral by integrating a piecewise quadratic function.[\/caption]\r\n\r\n<section class=\"textbox questionHelp\" aria-label=\"Question Help\"><strong>Why Quadratics?<\/strong> Three points determine a unique parabola, just like two points determine a unique line. Using quadratic approximations captures the curvature of functions much better than straight-line approximations.<\/section>\r\n<h3 class=\"text-xl font-bold text-text-100 mt-1 -mb-0.5\">Deriving Simpson's Rule Formula<\/h3>\r\n<p class=\"whitespace-normal break-words\">To understand the formula for Simpson's rule, we need to derive the approximation over the first two subintervals. This derivation requires keeping track of several key relationships.<\/p>\r\n<p class=\"whitespace-pre-wrap break-words\">The quadratic function [latex]p(x) = Ax^2 + Bx + C[\/latex] must pass through our three points:<\/p>\r\n<p class=\"whitespace-pre-wrap break-words\" style=\"text-align: center;\">[latex]\\begin{array}{c}f(x_0) = p(x_0) = Ax_0^2 + Bx_0 + C\\\\ f(x_1) = p(x_1) = Ax_1^2 + Bx_1 + C\\\\ f(x_2) = p(x_2) = Ax_2^2 + Bx_2 + C\\end{array}[\/latex]<\/p>\r\n<p class=\"whitespace-normal break-words\">We also need these geometric facts:<\/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\">[latex]x_2 - x_0 = 2\\Delta x[\/latex], where [latex]\\Delta x[\/latex] is the length of a subinterval<\/li>\r\n \t<li class=\"whitespace-normal break-words\">[latex]x_2 + x_0 = 2x_1[\/latex], since [latex]x_1 = \\frac{(x_2 + x_0)}{2}[\/latex]<\/li>\r\n<\/ul>\r\n<p class=\"whitespace-normal break-words\">We can now integrate the quadratic approximation:<\/p>\r\n<p class=\"whitespace-normal break-words\" style=\"text-align: center;\">[latex]\\begin{array}{ccccc}\\hfill {\\displaystyle\\int _{{x}_{0}}^{{x}_{2}}f(x)dx}&amp; \\approx {\\displaystyle\\int _{{x}_{0}}^{{x}_{2}}p(x)dx}\\hfill &amp; &amp; &amp; \\\\ &amp; ={\\displaystyle\\int _{{x}_{0}}^{{x}_{2}}(A{x}^{2}+Bx+C)dx}\\hfill &amp; &amp; &amp; \\\\ &amp; =\\frac{A}{3}{x}^{3}+\\frac{B}{2}{x}^{2}+Cx|\\begin{array}{c}{}^{{x}_{2}} \\\\ {}_{{x}_{0}}\\end{array}\\hfill &amp; &amp; &amp; \\text{Find the antiderivative.}\\hfill \\\\ &amp; =\\frac{A}{3}({x}_{2}{}^{3}-{x}_{0}{}^{3})+\\frac{B}{2}({x}_{2}{}^{2}-{x}_{0}{}^{2})+C({x}_{2}-{x}_{0})\\hfill &amp; &amp; &amp; \\text{Evaluate the antiderivative.}\\hfill\\end{array}[\/latex]<\/p>\r\n<p class=\"whitespace-normal break-words\">After factoring and using algebraic identities:<\/p>\r\n<p class=\"whitespace-normal break-words\" style=\"text-align: center;\">[latex]\\begin{array}{ccccc} &amp; =\\frac{A}{3}({x}_{2}-{x}_{0})({x}_{2}{}^{2}+{x}_{2}{x}_{0}+{x}_{0}{}^{2}) \u00a0+\\frac{B}{2}({x}_{2}-{x}_{0})({x}_{2}+{x}_{0})+C({x}_{2}-{x}_{0})\\hfill &amp; &amp; &amp; \\\\ &amp; =\\frac{{x}_{2}-{x}_{0}}{6}(2A({x}_{2}{}^{2}+{x}_{2}{x}_{0}+{x}_{0}{}^{2})+3B({x}_{2}+{x}_{0})+6C)\\hfill &amp; &amp; &amp; \\text{Factor out}\\frac{{x}_{2}-{x}_{0}}{6}.\\hfill\\end{array}[\/latex]<\/p>\r\n<p class=\"whitespace-normal break-words\">Through careful algebraic manipulation and substitution of our relationships, this eventually simplifies to:<\/p>\r\n<p class=\"whitespace-normal break-words\" style=\"text-align: center;\">[latex]\\int_{x_0}^{x_2} f(x)dx = \\frac{\\Delta x}{3}(f(x_0) + 4f(x_1) + f(x_2))[\/latex]<\/p>\r\n<p class=\"whitespace-pre-wrap break-words\">When we apply the same method to approximate [latex]\\int_{x_2}^{x_4} f(x)dx[\/latex], we get:<\/p>\r\n<p class=\"whitespace-pre-wrap break-words\" style=\"text-align: center;\">[latex]\\int_{x_2}^{x_4} f(x)dx \\approx \\frac{\\Delta x}{3}(f(x_2) + 4f(x_3) + f(x_4))[\/latex]<\/p>\r\n<p class=\"whitespace-pre-wrap break-words\">Combining these approximations over the interval [latex][x_0, x_4][\/latex]:<\/p>\r\n<p class=\"whitespace-pre-wrap break-words\" style=\"text-align: center;\">[latex]\\int_{x_0}^{x_4} f(x)dx = \\frac{\\Delta x}{3}(f(x_0) + 4f(x_1) + 2f(x_2) + 4f(x_3) + f(x_4))[\/latex]<\/p>\r\n\r\n<section class=\"textbox proTip\" aria-label=\"Pro Tip\"><strong>Notice the Pattern<\/strong>: The coefficients follow a specific pattern: 1, 4, 2, 4, 1. Interior points where parabolas meet get coefficient 2, while other interior points get coefficient 4<\/section>This pattern continues as we add pairs of subintervals, leading us to the general Simpson's rule formula.\r\n\r\n<section class=\"textbox keyTakeaway\" aria-label=\"Key Takeaway\">\r\n<div>\r\n<h3>Simpson\u2019s Rule<\/h3>\r\nAssume that [latex]f\\left(x\\right)[\/latex] is continuous over [latex]\\left[a,b\\right][\/latex]. Let n be a positive even 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].\r\n\r\nSet\r\n<p style=\"text-align: center;\">[latex]{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}_{4}\\right)+\\cdots +2f\\left({x}_{n - 2}\\right)+4f\\left({x}_{n - 1}\\right)+f\\left({x}_{n}\\right)\\right)[\/latex].<\/p>\r\nThen,\r\n<p style=\"text-align: center;\">[latex]\\underset{n\\to \\text{+}\\infty }{\\text{lim}}{S}_{n}={\\displaystyle\\int }_{a}^{b}f\\left(x\\right)dx[\/latex].<\/p>\r\n\r\n<\/div>\r\n<\/section>","rendered":"<h2>Simpson&#8217;s Rule<\/h2>\n<p class=\"whitespace-normal break-words\">We have seen how the midpoint rule approximates curves with rectangles and the trapezoidal rule uses straight lines. Simpson&#8217;s rule takes this progression further by <strong>approximating curves with parabolas<\/strong> (quadratic functions).<\/p>\n<p class=\"whitespace-normal break-words\">This method uses piecewise quadratic functions to follow the curve more accurately than either rectangles or straight-line segments.<\/p>\n<h3 class=\"text-xl font-bold text-text-100 mt-1 -mb-0.5\">How Simpson&#8217;s Rule Works<\/h3>\n<p class=\"whitespace-normal break-words\">The setup requires partitioning the interval into an <strong>even number<\/strong> of subintervals, each with equal width. This even number requirement is essential because we work with pairs of subintervals.<\/p>\n<p class=\"whitespace-normal break-words\"><strong>For each pair of subintervals:<\/strong> Over the first pair of subintervals, we approximate [latex]\\int_{x_0}^{x_2} f(x)dx[\/latex] with [latex]\\int_{x_0}^{x_2} p(x)dx[\/latex], where [latex]p(x) = Ax^2 + Bx + C[\/latex] is the unique quadratic function passing through the three points [latex](x_0, f(x_0))[\/latex], [latex](x_1, f(x_1))[\/latex], and [latex](x_2, f(x_2))[\/latex].<\/p>\n<p class=\"whitespace-normal break-words\"><strong>Continuing the pattern:<\/strong> Over the next pair of subintervals, we approximate [latex]\\int_{x_2}^{x_4} f(x)dx[\/latex] with the integral of another quadratic function passing through [latex](x_2, f(x_2))[\/latex], [latex](x_3, f(x_3))[\/latex], and [latex](x_4, f(x_4))[\/latex]. This process continues with each successive pair of subintervals.<\/p>\n<figure style=\"width: 975px\" 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\/11233841\/CNX_Calc_Figure_07_06_004.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 x sub 0, there are trapezoids shaded whose heights are represented by the function p(x), which is a curve following an approximate path of the original graph. The x-axis is scaled by increments of x sub 0, x sub 1, x sub 2. The second graph has on the x-axis at the point labeled x sub 0. There are shaded regions under the curve, divided by x sub 0, x sub 1, x sub 2, x sub 3, and x sub 4. The curve is sectioned into two different parts above the shaded areas. These two parts are labeled p sub 1(x) and p sub 2(x).\" width=\"975\" height=\"286\" data-media-type=\"image\/jpeg\" \/><figcaption class=\"wp-caption-text\">Figure 4. With Simpson\u2019s rule, we approximate a definite integral by integrating a piecewise quadratic function.<\/figcaption><\/figure>\n<section class=\"textbox questionHelp\" aria-label=\"Question Help\"><strong>Why Quadratics?<\/strong> Three points determine a unique parabola, just like two points determine a unique line. Using quadratic approximations captures the curvature of functions much better than straight-line approximations.<\/section>\n<h3 class=\"text-xl font-bold text-text-100 mt-1 -mb-0.5\">Deriving Simpson&#8217;s Rule Formula<\/h3>\n<p class=\"whitespace-normal break-words\">To understand the formula for Simpson&#8217;s rule, we need to derive the approximation over the first two subintervals. This derivation requires keeping track of several key relationships.<\/p>\n<p class=\"whitespace-pre-wrap break-words\">The quadratic function [latex]p(x) = Ax^2 + Bx + C[\/latex] must pass through our three points:<\/p>\n<p class=\"whitespace-pre-wrap break-words\" style=\"text-align: center;\">[latex]\\begin{array}{c}f(x_0) = p(x_0) = Ax_0^2 + Bx_0 + C\\\\ f(x_1) = p(x_1) = Ax_1^2 + Bx_1 + C\\\\ f(x_2) = p(x_2) = Ax_2^2 + Bx_2 + C\\end{array}[\/latex]<\/p>\n<p class=\"whitespace-normal break-words\">We also need these geometric facts:<\/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\">[latex]x_2 - x_0 = 2\\Delta x[\/latex], where [latex]\\Delta x[\/latex] is the length of a subinterval<\/li>\n<li class=\"whitespace-normal break-words\">[latex]x_2 + x_0 = 2x_1[\/latex], since [latex]x_1 = \\frac{(x_2 + x_0)}{2}[\/latex]<\/li>\n<\/ul>\n<p class=\"whitespace-normal break-words\">We can now integrate the quadratic approximation:<\/p>\n<p class=\"whitespace-normal break-words\" style=\"text-align: center;\">[latex]\\begin{array}{ccccc}\\hfill {\\displaystyle\\int _{{x}_{0}}^{{x}_{2}}f(x)dx}& \\approx {\\displaystyle\\int _{{x}_{0}}^{{x}_{2}}p(x)dx}\\hfill & & & \\\\ & ={\\displaystyle\\int _{{x}_{0}}^{{x}_{2}}(A{x}^{2}+Bx+C)dx}\\hfill & & & \\\\ & =\\frac{A}{3}{x}^{3}+\\frac{B}{2}{x}^{2}+Cx|\\begin{array}{c}{}^{{x}_{2}} \\\\ {}_{{x}_{0}}\\end{array}\\hfill & & & \\text{Find the antiderivative.}\\hfill \\\\ & =\\frac{A}{3}({x}_{2}{}^{3}-{x}_{0}{}^{3})+\\frac{B}{2}({x}_{2}{}^{2}-{x}_{0}{}^{2})+C({x}_{2}-{x}_{0})\\hfill & & & \\text{Evaluate the antiderivative.}\\hfill\\end{array}[\/latex]<\/p>\n<p class=\"whitespace-normal break-words\">After factoring and using algebraic identities:<\/p>\n<p class=\"whitespace-normal break-words\" style=\"text-align: center;\">[latex]\\begin{array}{ccccc} & =\\frac{A}{3}({x}_{2}-{x}_{0})({x}_{2}{}^{2}+{x}_{2}{x}_{0}+{x}_{0}{}^{2}) \u00a0+\\frac{B}{2}({x}_{2}-{x}_{0})({x}_{2}+{x}_{0})+C({x}_{2}-{x}_{0})\\hfill & & & \\\\ & =\\frac{{x}_{2}-{x}_{0}}{6}(2A({x}_{2}{}^{2}+{x}_{2}{x}_{0}+{x}_{0}{}^{2})+3B({x}_{2}+{x}_{0})+6C)\\hfill & & & \\text{Factor out}\\frac{{x}_{2}-{x}_{0}}{6}.\\hfill\\end{array}[\/latex]<\/p>\n<p class=\"whitespace-normal break-words\">Through careful algebraic manipulation and substitution of our relationships, this eventually simplifies to:<\/p>\n<p class=\"whitespace-normal break-words\" style=\"text-align: center;\">[latex]\\int_{x_0}^{x_2} f(x)dx = \\frac{\\Delta x}{3}(f(x_0) + 4f(x_1) + f(x_2))[\/latex]<\/p>\n<p class=\"whitespace-pre-wrap break-words\">When we apply the same method to approximate [latex]\\int_{x_2}^{x_4} f(x)dx[\/latex], we get:<\/p>\n<p class=\"whitespace-pre-wrap break-words\" style=\"text-align: center;\">[latex]\\int_{x_2}^{x_4} f(x)dx \\approx \\frac{\\Delta x}{3}(f(x_2) + 4f(x_3) + f(x_4))[\/latex]<\/p>\n<p class=\"whitespace-pre-wrap break-words\">Combining these approximations over the interval [latex][x_0, x_4][\/latex]:<\/p>\n<p class=\"whitespace-pre-wrap break-words\" style=\"text-align: center;\">[latex]\\int_{x_0}^{x_4} f(x)dx = \\frac{\\Delta x}{3}(f(x_0) + 4f(x_1) + 2f(x_2) + 4f(x_3) + f(x_4))[\/latex]<\/p>\n<section class=\"textbox proTip\" aria-label=\"Pro Tip\"><strong>Notice the Pattern<\/strong>: The coefficients follow a specific pattern: 1, 4, 2, 4, 1. Interior points where parabolas meet get coefficient 2, while other interior points get coefficient 4<\/section>\n<p>This pattern continues as we add pairs of subintervals, leading us to the general Simpson&#8217;s rule formula.<\/p>\n<section class=\"textbox keyTakeaway\" aria-label=\"Key Takeaway\">\n<div>\n<h3>Simpson\u2019s Rule<\/h3>\n<p>Assume that [latex]f\\left(x\\right)[\/latex] is continuous over [latex]\\left[a,b\\right][\/latex]. Let n be a positive even 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].<\/p>\n<p>Set<\/p>\n<p style=\"text-align: center;\">[latex]{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}_{4}\\right)+\\cdots +2f\\left({x}_{n - 2}\\right)+4f\\left({x}_{n - 1}\\right)+f\\left({x}_{n}\\right)\\right)[\/latex].<\/p>\n<p>Then,<\/p>\n<p style=\"text-align: center;\">[latex]\\underset{n\\to \\text{+}\\infty }{\\text{lim}}{S}_{n}={\\displaystyle\\int }_{a}^{b}f\\left(x\\right)dx[\/latex].<\/p>\n<\/div>\n<\/section>\n","protected":false},"author":15,"menu_order":7,"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\/751"}],"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":14,"href":"https:\/\/content.one.lumenlearning.com\/calculus2\/wp-json\/pressbooks\/v2\/chapters\/751\/revisions"}],"predecessor-version":[{"id":1313,"href":"https:\/\/content.one.lumenlearning.com\/calculus2\/wp-json\/pressbooks\/v2\/chapters\/751\/revisions\/1313"}],"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\/751\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/content.one.lumenlearning.com\/calculus2\/wp-json\/wp\/v2\/media?parent=751"}],"wp:term":[{"taxonomy":"chapter-type","embeddable":true,"href":"https:\/\/content.one.lumenlearning.com\/calculus2\/wp-json\/pressbooks\/v2\/chapter-type?post=751"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/content.one.lumenlearning.com\/calculus2\/wp-json\/wp\/v2\/contributor?post=751"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/content.one.lumenlearning.com\/calculus2\/wp-json\/wp\/v2\/license?post=751"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}