Unit 1 · Lesson 7 of 7

Numerical quadrature

Estimate an integral when no elementary formula is handy

A measured rate can be sampled at discrete times. Trapezoids or parabolic panels turn those observations into an accumulated quantity.

What you'll be able to do
  • Set up the model and calculate its quadrature estimate.
  • Connect the equation to the changing visual.
  • Explain the assumptions and identify a misleading interpretation.
Predict before exploring

What will change if you increase even panel count n? Predict the direction, then explain the response.

A model you can changeMove one control at a time.
Read the modelTn=h[f0+fn2+∑i=1n−1fi],Sn=h3[f0+4f1+2f2+⋯+fn]T_n=h\left[\frac{f_0+f_n}{2}+\sum_{i=1}^{n-1}f_i\right],\quad S_n=\frac h3[f_0+4f_1+2f_2+\cdots+f_n]

Integrate exp(−x²) on [0,2]. Simpson uses even n. A high-resolution Simpson value provides a numerical reference, not an elementary exact antiderivative.

Time (s) versus Measured rate. Sampled rate. Selected quadrature estimate: 0.88203 . Smoothness, panel width, and rule order affect accuracy. More panels are not a substitute for understanding discontinuities or singular endpoints.000.5112Measured rateTime (s)
Sampled rate

quadrature estimate
Set up before calculating

Symbolic relationship

Tn=h[f0+fn2+∑i=1n−1fi],Sn=h3[f0+4f1+2f2+⋯+fn]T_n=h\left[\frac{f_0+f_n}{2}+\sum_{i=1}^{n-1}f_i\right],\quad S_n=\frac h3[f_0+4f_1+2f_2+\cdots+f_n]

Dimensions and units

[R]=1,[q1]=1[q2]=1[R]=\mathrm{1},\qquad [q_{1}]=\mathrm{1}\quad [q_{2}]=\mathrm{1}

Keep the stated units on every input. Ratios, counts, angles in radians, interest factors, and exponents are dimensionless. Add or compare quantities only when their units and reference dates agree.

Even panel count nq1=(6 1)q_{1}=\left(6\,1\right)
Rule: 0 trapezoid, 1 Simpsonq2=(1 1)q_{2}=\left(1\,1\right)

The result is reported in dimensionless units. Convert inputs to the model’s unit system before evaluating.

h=26,S6=0.882032,Iref≈0.882081h=\frac2{6},\quad S_6=0.882032,\quad I_{ref}\approx0.882081

Smoothness, panel width, and rule order affect accuracy. More panels are not a substitute for understanding discontinuities or singular endpoints.

Assumptions, units, and limits

Integrate exp(−x²) on [0,2]. Simpson uses even n. A high-resolution Simpson value provides a numerical reference, not an elementary exact antiderivative.

The controls specify a new scenario. Curves are calculated from the equations; physical illustrations are schematic.

01

From the situation to an equation

Trapezoid weights are one half at endpoints and one inside. Simpson weights alternate four and two between endpoint ones, and require an even number of panels. Error behavior depends on smoothness and derivatives of the integrand.

Tn=h[f0+fn2+∑i=1n−1fi],Sn=h3[f0+4f1+2f2+⋯+fn]T_n=h\left[\frac{f_0+f_n}{2}+\sum_{i=1}^{n-1}f_i\right],\quad S_n=\frac h3[f_0+4f_1+2f_2+\cdots+f_n]
02

Keep the reasoning visible

h=(b−a)/nh=(b-a)/n

Smoothness, panel width, and rule order affect accuracy. More panels are not a substitute for understanding discontinuities or singular endpoints.

03

What makes this model useful?

Integrate exp(−x²) on [0,2]. Simpson uses even n. A high-resolution Simpson value provides a numerical reference, not an elementary exact antiderivative.

The reference displayed here is itself a high-resolution numerical approximation. More samples do not automatically repair an unmodeled discontinuity.

A worked example

Calculate the starting scenario

  1. Use even panel count n = 6 ; rule: 0 trapezoid, 1 simpson = 1 .
  2. Set up before calculating

    Symbolic relationship

    Tn=h[f0+fn2+∑i=1n−1fi],Sn=h3[f0+4f1+2f2+⋯+fn]T_n=h\left[\frac{f_0+f_n}{2}+\sum_{i=1}^{n-1}f_i\right],\quad S_n=\frac h3[f_0+4f_1+2f_2+\cdots+f_n]

    Dimensions and units

    [R]=1,[q1]=1[q2]=1[R]=\mathrm{1},\qquad [q_{1}]=\mathrm{1}\quad [q_{2}]=\mathrm{1}

    Keep the stated units on every input. Ratios, counts, angles in radians, interest factors, and exponents are dimensionless. Add or compare quantities only when their units and reference dates agree.

    Even panel count nq1=(6 1)q_{1}=\left(6\,1\right)
    Rule: 0 trapezoid, 1 Simpsonq2=(1 1)q_{2}=\left(1\,1\right)

    The result is reported in dimensionless units. Convert inputs to the model’s unit system before evaluating.

    h=26,S6=0.882032,Iref≈0.882081h=\frac2{6},\quad S_6=0.882032,\quad I_{ref}\approx0.882081
  3. Smoothness, panel width, and rule order affect accuracy. More panels are not a substitute for understanding discontinuities or singular endpoints. The checked quantity is quadrature estimate.
Make the idea your own

Calculate, compare, and explain

Numeric checks allow 1% rounding error. Values near zero use a small absolute tolerance. Work through the setup before opening a solution.

Calculate and explain

Rebuild the starting calculation

Calculate the quadrature estimate using even panel count n 6 , rule: 0 trapezoid, 1 simpson 1 . State the meaning of its sign and units.

Checked quantity: quadrature estimate · dimensionless. Follow the definition for finite-cutoff and numerical-model questions.

Hint

Trapezoid weights are one half at endpoints and one inside. Simpson weights alternate four and two between endpoint ones, and require an even number of panels. Error behavior depends on smoothness and derivatives of the integrand.

Explore the visual solution
Read the modelTn=h[f0+fn2+∑i=1n−1fi],Sn=h3[f0+4f1+2f2+⋯+fn]T_n=h\left[\frac{f_0+f_n}{2}+\sum_{i=1}^{n-1}f_i\right],\quad S_n=\frac h3[f_0+4f_1+2f_2+\cdots+f_n]

Integrate exp(−x²) on [0,2]. Simpson uses even n. A high-resolution Simpson value provides a numerical reference, not an elementary exact antiderivative.

Time (s) versus Measured rate. Sampled rate. Selected quadrature estimate: 0.88203 . Smoothness, panel width, and rule order affect accuracy. More panels are not a substitute for understanding discontinuities or singular endpoints.000.5112Measured rateTime (s)
Sampled rate

quadrature estimate
Set up before calculating

Symbolic relationship

Tn=h[f0+fn2+∑i=1n−1fi],Sn=h3[f0+4f1+2f2+⋯+fn]T_n=h\left[\frac{f_0+f_n}{2}+\sum_{i=1}^{n-1}f_i\right],\quad S_n=\frac h3[f_0+4f_1+2f_2+\cdots+f_n]

Dimensions and units

[R]=1,[q1]=1[q2]=1[R]=\mathrm{1},\qquad [q_{1}]=\mathrm{1}\quad [q_{2}]=\mathrm{1}

Keep the stated units on every input. Ratios, counts, angles in radians, interest factors, and exponents are dimensionless. Add or compare quantities only when their units and reference dates agree.

Even panel count nq1=(6 1)q_{1}=\left(6\,1\right)
Rule: 0 trapezoid, 1 Simpsonq2=(1 1)q_{2}=\left(1\,1\right)

The result is reported in dimensionless units. Convert inputs to the model’s unit system before evaluating.

h=26,S6=0.882032,Iref≈0.882081h=\frac2{6},\quad S_6=0.882032,\quad I_{ref}\approx0.882081

Smoothness, panel width, and rule order affect accuracy. More panels are not a substitute for understanding discontinuities or singular endpoints.

Assumptions, units, and limits

Integrate exp(−x²) on [0,2]. Simpson uses even n. A high-resolution Simpson value provides a numerical reference, not an elementary exact antiderivative.

The controls specify a new scenario. Curves are calculated from the equations; physical illustrations are schematic.

Walk through the assumptions

What we assumed: Integrate exp(−x²) on [0,2]. Simpson uses even n. A high-resolution Simpson value provides a numerical reference, not an elementary exact antiderivative.

What changes: Treat the domain, timing, and constraints as part of the model. If an input leaves the stated range or the governing relationship changes, the original result is no longer justified. Rebuild the equation with the changed condition, then compare predictions while holding the other inputs fixed.

The controls explore variations. These written steps retain the original question's inputs.

Trapezoid weights are one half at endpoints and one inside. Simpson weights alternate four and two between endpoint ones, and require an even number of panels. Error behavior depends on smoothness and derivatives of the integrand.

Tn=h[f0+fn2+∑i=1n−1fi],Sn=h3[f0+4f1+2f2+⋯+fn]T_n=h\left[\frac{f_0+f_n}{2}+\sum_{i=1}^{n-1}f_i\right],\quad S_n=\frac h3[f_0+4f_1+2f_2+\cdots+f_n]
Calculate and explain

Apply the idea to a new scenario

Use 10 trapezoid panels to integrate exp(−x²) from 0 to 2.

Checked quantity: quadrature estimate · dimensionless. Follow the definition for finite-cutoff and numerical-model questions.

Hint

Trapezoid weights are one half at endpoints and one inside. Simpson weights alternate four and two between endpoint ones, and require an even number of panels. Error behavior depends on smoothness and derivatives of the integrand.

Explore the visual solution
Read the modelTn=h[f0+fn2+∑i=1n−1fi],Sn=h3[f0+4f1+2f2+⋯+fn]T_n=h\left[\frac{f_0+f_n}{2}+\sum_{i=1}^{n-1}f_i\right],\quad S_n=\frac h3[f_0+4f_1+2f_2+\cdots+f_n]

Integrate exp(−x²) on [0,2]. Simpson uses even n. A high-resolution Simpson value provides a numerical reference, not an elementary exact antiderivative.

Time (s) versus Measured rate. Sampled rate. Selected quadrature estimate: 0.88184 . Smoothness, panel width, and rule order affect accuracy. More panels are not a substitute for understanding discontinuities or singular endpoints.000.5112Measured rateTime (s)
Sampled rate

quadrature estimate
Set up before calculating

Symbolic relationship

Tn=h[f0+fn2+∑i=1n−1fi],Sn=h3[f0+4f1+2f2+⋯+fn]T_n=h\left[\frac{f_0+f_n}{2}+\sum_{i=1}^{n-1}f_i\right],\quad S_n=\frac h3[f_0+4f_1+2f_2+\cdots+f_n]

Dimensions and units

[R]=1,[q1]=1[q2]=1[R]=\mathrm{1},\qquad [q_{1}]=\mathrm{1}\quad [q_{2}]=\mathrm{1}

Keep the stated units on every input. Ratios, counts, angles in radians, interest factors, and exponents are dimensionless. Add or compare quantities only when their units and reference dates agree.

Even panel count nq1=(10 1)q_{1}=\left(10\,1\right)
Rule: 0 trapezoid, 1 Simpsonq2=(0 1)q_{2}=\left(0\,1\right)

The result is reported in dimensionless units. Convert inputs to the model’s unit system before evaluating.

h=210,T10=0.881839,Iref≈0.882081h=\frac2{10},\quad T_10=0.881839,\quad I_{ref}\approx0.882081

Smoothness, panel width, and rule order affect accuracy. More panels are not a substitute for understanding discontinuities or singular endpoints.

Assumptions, units, and limits

Integrate exp(−x²) on [0,2]. Simpson uses even n. A high-resolution Simpson value provides a numerical reference, not an elementary exact antiderivative.

The controls specify a new scenario. Curves are calculated from the equations; physical illustrations are schematic.

Walk through the assumptions

What we assumed: Integrate exp(−x²) on [0,2]. Simpson uses even n. A high-resolution Simpson value provides a numerical reference, not an elementary exact antiderivative.

What changes: Treat the domain, timing, and constraints as part of the model. If an input leaves the stated range or the governing relationship changes, the original result is no longer justified. Rebuild the equation with the changed condition, then compare predictions while holding the other inputs fixed.

The controls explore variations. These written steps retain the original question's inputs.

Trapezoid weights are one half at endpoints and one inside. Simpson weights alternate four and two between endpoint ones, and require an even number of panels. Error behavior depends on smoothness and derivatives of the integrand.

Tn=h[f0+fn2+∑i=1n−1fi],Sn=h3[f0+4f1+2f2+⋯+fn]T_n=h\left[\frac{f_0+f_n}{2}+\sum_{i=1}^{n-1}f_i\right],\quad S_n=\frac h3[f_0+4f_1+2f_2+\cdots+f_n]
Challenge the interpretation

Which explanation survives the model?

Choose the statement you can justify, then use the visual to explain why the others fail.

Test it with the visual
Read the modelTn=h[f0+fn2+∑i=1n−1fi],Sn=h3[f0+4f1+2f2+⋯+fn]T_n=h\left[\frac{f_0+f_n}{2}+\sum_{i=1}^{n-1}f_i\right],\quad S_n=\frac h3[f_0+4f_1+2f_2+\cdots+f_n]

Integrate exp(−x²) on [0,2]. Simpson uses even n. A high-resolution Simpson value provides a numerical reference, not an elementary exact antiderivative.

Time (s) versus Measured rate. Sampled rate. Selected quadrature estimate: 0.88203 . Smoothness, panel width, and rule order affect accuracy. More panels are not a substitute for understanding discontinuities or singular endpoints.000.5112Measured rateTime (s)
Sampled rate

quadrature estimate
Set up before calculating

Symbolic relationship

Tn=h[f0+fn2+∑i=1n−1fi],Sn=h3[f0+4f1+2f2+⋯+fn]T_n=h\left[\frac{f_0+f_n}{2}+\sum_{i=1}^{n-1}f_i\right],\quad S_n=\frac h3[f_0+4f_1+2f_2+\cdots+f_n]

Dimensions and units

[R]=1,[q1]=1[q2]=1[R]=\mathrm{1},\qquad [q_{1}]=\mathrm{1}\quad [q_{2}]=\mathrm{1}

Keep the stated units on every input. Ratios, counts, angles in radians, interest factors, and exponents are dimensionless. Add or compare quantities only when their units and reference dates agree.

Even panel count nq1=(6 1)q_{1}=\left(6\,1\right)
Rule: 0 trapezoid, 1 Simpsonq2=(1 1)q_{2}=\left(1\,1\right)

The result is reported in dimensionless units. Convert inputs to the model’s unit system before evaluating.

h=26,S6=0.882032,Iref≈0.882081h=\frac2{6},\quad S_6=0.882032,\quad I_{ref}\approx0.882081

Smoothness, panel width, and rule order affect accuracy. More panels are not a substitute for understanding discontinuities or singular endpoints.

Assumptions, units, and limits

Integrate exp(−x²) on [0,2]. Simpson uses even n. A high-resolution Simpson value provides a numerical reference, not an elementary exact antiderivative.

The controls specify a new scenario. Curves are calculated from the equations; physical illustrations are schematic.

The reasoning. Trapezoid weights are one half at endpoints and one inside. Simpson weights alternate four and two between endpoint ones, and require an even number of panels. Error behavior depends on smoothness and derivatives of the integrand.

Synthesis challenge

Compare two scenarios and defend the difference

First calculate scenario A. Then change only even panel count n from 6 to 14 . Predict the direction, calculate scenario B, and find the signed difference B − A in the model’s reported quantity (dimensionless). Explain whether a proportionate change in the input produces a proportionate change in the output.

Other inputs: Rule: 0 trapezoid, 1 Simpson: 1 . The difference concerns the model’s displayed answer, not necessarily the graph’s vertical coordinate.

Explore the comparison and worked solution
Read the modelTn=h[f0+fn2+∑i=1n−1fi],Sn=h3[f0+4f1+2f2+⋯+fn]T_n=h\left[\frac{f_0+f_n}{2}+\sum_{i=1}^{n-1}f_i\right],\quad S_n=\frac h3[f_0+4f_1+2f_2+\cdots+f_n]

Integrate exp(−x²) on [0,2]. Simpson uses even n. A high-resolution Simpson value provides a numerical reference, not an elementary exact antiderivative.

Time (s) versus Measured rate. Sampled rate. Selected quadrature estimate: 0.88203 . Smoothness, panel width, and rule order affect accuracy. More panels are not a substitute for understanding discontinuities or singular endpoints.000.5112Measured rateTime (s)
Sampled rate

quadrature estimate
Set up before calculating

Symbolic relationship

Tn=h[f0+fn2+∑i=1n−1fi],Sn=h3[f0+4f1+2f2+⋯+fn]T_n=h\left[\frac{f_0+f_n}{2}+\sum_{i=1}^{n-1}f_i\right],\quad S_n=\frac h3[f_0+4f_1+2f_2+\cdots+f_n]

Dimensions and units

[R]=1,[q1]=1[q2]=1[R]=\mathrm{1},\qquad [q_{1}]=\mathrm{1}\quad [q_{2}]=\mathrm{1}

Keep the stated units on every input. Ratios, counts, angles in radians, interest factors, and exponents are dimensionless. Add or compare quantities only when their units and reference dates agree.

Even panel count nq1=(6 1)q_{1}=\left(6\,1\right)
Rule: 0 trapezoid, 1 Simpsonq2=(1 1)q_{2}=\left(1\,1\right)

The result is reported in dimensionless units. Convert inputs to the model’s unit system before evaluating.

h=26,S6=0.882032,Iref≈0.882081h=\frac2{6},\quad S_6=0.882032,\quad I_{ref}\approx0.882081

Smoothness, panel width, and rule order affect accuracy. More panels are not a substitute for understanding discontinuities or singular endpoints.

Assumptions, units, and limits

Integrate exp(−x²) on [0,2]. Simpson uses even n. A high-resolution Simpson value provides a numerical reference, not an elementary exact antiderivative.

The controls specify a new scenario. Curves are calculated from the equations; physical illustrations are schematic.

Set up before calculating

Symbolic relationship

Tn=h[f0+fn2+∑i=1n−1fi],Sn=h3[f0+4f1+2f2+⋯+fn]T_n=h\left[\frac{f_0+f_n}{2}+\sum_{i=1}^{n-1}f_i\right],\quad S_n=\frac h3[f_0+4f_1+2f_2+\cdots+f_n]

Dimensions and units

[R]=1,[q1]=1[q2]=1[R]=\mathrm{1},\qquad [q_{1}]=\mathrm{1}\quad [q_{2}]=\mathrm{1}

Keep the stated units on every input. Ratios, counts, angles in radians, interest factors, and exponents are dimensionless. Add or compare quantities only when their units and reference dates agree.

Even panel count nq1=(6 1)q_{1}=\left(6\,1\right)
Rule: 0 trapezoid, 1 Simpsonq2=(1 1)q_{2}=\left(1\,1\right)

The result is reported in dimensionless units. Convert inputs to the model’s unit system before evaluating.

  1. Evaluate the symbolic relationship using scenario A, keeping the displayed units on its inputs.h=26,S6=0.882032,Iref≈0.882081h=\frac2{6},\quad S_6=0.882032,\quad I_{ref}\approx0.882081
  2. Change only the selected input and recompute scenario B.h=214,S14=0.88208,Iref≈0.882081h=\frac2{14},\quad S_14=0.88208,\quad I_{ref}\approx0.882081
  3. Subtract like quantities.ΔR=RB−RA=(0.88208 1)−(0.882032 1)=(0.0000481197 1)\Delta R=R_B-R_A=\left(0.88208\,1\right)-\left(0.882032\,1\right)=\left(0.0000481197\,1\right)

Smoothness, panel width, and rule order affect accuracy. More panels are not a substitute for understanding discontinuities or singular endpoints.

Walk through the assumptions

What we assumed: Integrate exp(−x²) on [0,2]. Simpson uses even n. A high-resolution Simpson value provides a numerical reference, not an elementary exact antiderivative.

What changes: Treat the domain, timing, and constraints as part of the model. If an input leaves the stated range or the governing relationship changes, the original result is no longer justified. Rebuild the equation with the changed condition, then compare predictions while holding the other inputs fixed.

Walk through the assumptions

What we assumed: Integrate exp(−x²) on [0,2]. Simpson uses even n. A high-resolution Simpson value provides a numerical reference, not an elementary exact antiderivative.

What changes: Treat the domain, timing, and constraints as part of the model. If an input leaves the stated range or the governing relationship changes, the original result is no longer justified. Rebuild the equation with the changed condition, then compare predictions while holding the other inputs fixed.

Your learning path

Can you explain the connection?

Mark complete when you can set up the calculation and explain what the visual is showing. Opening a page never completes it automatically.

Completion is saved on this browser. This is separate from account practice progress.