Mathematics IIUnit 415 min read

Definite Integrals & Numerical Methods: Trapezoidal Rule, Simpson’s Rule, Error Analysis

Unit 4 of Mathematics II covers exact and approximate evaluation of definite integrals, numerical integration methods (trapezoidal rule, Simpson’s 1/3 rule), error formulas, and their applications in engineering, finance, and real-world data analysis.

TAKEAWAYS:

  • Understand the exact vs. approximate evaluation of definite integrals and when numerical methods are necessary.
  • Master the trapezoidal rule and Simpson’s 1/3 rule for approximating integrals with given precision.
  • Learn the error formulas for these methods and how to estimate them.
  • Apply numerical integration to real-world problems like calculating areas under curves, average values, and optimization.
  • Compare analytical vs. numerical solutions and their trade-offs in computational efficiency and accuracy.
  • Recognize when to use each method based on the function’s behavior and required precision.


1. Definite Integrals: Exact vs. Approximate Evaluation

Definite integrals represent the signed area under a curve between two limits. While some integrals can be evaluated exactly using antiderivatives, others (especially those involving complex functions) require numerical approximation.

When is Numerical Integration Needed?

  • The antiderivative cannot be expressed in elementary functions (e.g., ).
  • The function is given in tabular or experimental form (e.g., sensor data, stock prices).
  • High precision is required, and exact methods are computationally expensive.

Example 1: Exact vs. Approximate Evaluation

Consider evaluating :

  • Exact solution: .
  • Numerical approximation: We will compute this using the trapezoidal rule and compare.

2. Numerical Integration Methods

(A) Trapezoidal Rule

The trapezoidal rule approximates the area under a curve by dividing it into trapezoids rather than rectangles (as in Riemann sums).

Formula: For subintervals of equal width , where .

Worked Example 2: Trapezoidal Rule with 3 Points

Evaluate using the composite trapezoidal rule with .

Step 1: Divide the interval

  • , , → .
  • Points: , , , .

Step 2: Compute function values

Step 3: Apply the trapezoidal rule Exact value: . Error: (very small for ).

(B) Simpson’s 1/3 Rule

Simpson’s rule provides a higher accuracy by fitting parabolic arcs to subintervals. It requires an even number of subintervals ( must be even).

Formula: where .

Worked Example 3: Simpson’s Rule with 4 Points

Evaluate the same integral using Simpson’s rule with .

Step 1: Divide the interval

  • .
  • Points: , , , , .

Step 2: Compute function values

Step 3: Apply Simpson’s rule Exact value: . Error: (exact for this case due to polynomial nature).


3. Error Analysis in Numerical Integration

The error in numerical integration depends on:

  1. The method used (trapezoidal vs. Simpson’s).
  2. The number of subintervals ().
  3. The smoothness of the function (higher derivatives).
-5-4-3-2-1123450.20.40.60.81xyError (|Exact - Approx|)1/n² (Theoretical)
Error decreases as O(h²) = O(1/n²) for smooth functions like f(x)=x².

Error Formulas

Method Error Formula Order of Error
Trapezoidal Rule for some
Simpson’s 1/3 Rule for some

Worked Example 4: Error Estimation for Trapezoidal Rule

For with :

  • .
  • Maximum of on occurs at : .
  • Error bound:
  • Actual error: (much smaller than the bound).

4. Comparison of Numerical Methods

Feature Trapezoidal Rule Simpson’s 1/3 Rule
Accuracy Lower () Higher ()
Number of Points Any Must be even ( even)
Computational Cost Lower (fewer evaluations) Higher (more evaluations)
Best For Smooth functions, quick estimates High-precision requirements

5. Real-World Applications

(A) eSewa and Khalti: Transaction Processing

  • Problem: When processing thousands of transactions per second, eSewa and Khalti must approximate the total transaction volume over time.
  • Solution: Numerical integration (e.g., trapezoidal rule) is used to estimate total revenue from transaction logs when exact summation is computationally expensive.
  • Example: If transaction amounts are recorded at discrete time intervals, the total revenue over an hour can be approximated using:

(B) Pathao and Ncell: Traffic and Demand Prediction

  • Problem: Ride-hailing apps like Pathao need to predict demand in different city zones to optimize driver allocation.
  • Solution: Demand data is often sampled at discrete time points. Numerical integration helps estimate the total demand over a time period.
  • Example: If demand is recorded every 15 minutes, the total demand from 6 AM to 10 AM can be approximated as:

(C) NTC and NEPSE: Energy and Stock Price Analysis

  • Problem: The Nepal Stock Exchange (NEPSE) and Nepal Telecommunications Corporation (NTC) analyze trends in stock prices and energy consumption.
  • Solution: Numerical integration is used to compute:
    1. Total energy consumption over a month from hourly data.
    2. Area under stock price curves to estimate cumulative gains/losses.
  • Example: If NEPSE index is recorded daily, the total change over a year can be approximated using:

(D) Daraz and Amazon: Inventory Optimization

  • Problem: E-commerce platforms like Daraz must predict total sales to manage inventory.
  • Solution: Sales data (recorded per hour/day) is integrated numerically to forecast monthly revenue.
  • Example: If sales are recorded every 2 hours, the total sales for a day are:

6. Worked Example: Real-World Scenario (Bank Loan Interest)

Problem: A bank offers a loan with an interest rate that varies continuously over time. The interest rate at time (in years) is given by: If the principal amount is Rs. 1,00,000, compute the total interest paid over 5 years using:

  1. Exact integration (if possible).
  2. Trapezoidal rule with .

Solution

  1. Exact Integration:

  2. Trapezoidal Rule ():

    • .
    • Points: , , , , , .
    • :
    • Trapezoidal approximation:
    • Error: (small for ).
-5-4-3-2-1123450.050.10.150.20.250.3yr(0)=0.05r(1)=0.06r(2)=0.09r(3)=0.14r(4)=0.21r(5)=0.30
Trapezoidal Rule approximation of ∫₀⁵ r(t) dt with n=5 intervals (h=1). Exact integral = 66,667; Approximation = 66,500.

7. Choosing the Right Method

Scenario Recommended Method Reason
Quick estimate, few data points Trapezoidal Rule Simpler, faster
High precision required Simpson’s 1/3 Rule Higher accuracy ()
Function has sharp peaks/valleys Simpson’s Rule Better handles curvature
Large dataset, computational cost Trapezoidal Rule Fewer evaluations needed

8. Common Mistakes to Avoid

  1. Forgetting to check if is even for Simpson’s rule.
  2. Incorrectly applying the weights (e.g., using for the first and last points in Simpson’s rule).
  3. Ignoring error bounds—always estimate the error when precision is critical.
  4. Miscounting the number of subintervals ( vs. number of points).
  5. Assuming Simpson’s rule is always better—it requires more computations and an even .

9. Exam Tip

What Examiners Look For

  1. Correct Formula Application:

    • Ensure you use the right weights (1, 2, 4 in Simpson’s rule).
    • Do not mix up (subintervals) with the number of points ().
  2. Error Analysis:

    • Always state the error formula and compute the error bound.
    • Example: For the trapezoidal rule, write:
  3. Real-World Connection:

    • In exam questions, relate numerical integration to a real scenario (e.g., "This could represent the total revenue for a company over a year").
    • Example answer starter:

      "The trapezoidal rule approximates the total transaction volume for eSewa over a month, where transactions are recorded at discrete time intervals."

  4. Comparison Questions:

    • If asked to compare methods, create a table like the one above and highlight accuracy vs. computational cost.
  5. Units and Interpretation:

    • Always interpret the result in the context of the problem.
    • Example: If integrating a rate function, the result is a total quantity (e.g., total distance, total revenue).

Model Answer Structure for Exam Questions

Question: Evaluate using the trapezoidal rule with . Estimate the error.

Model Answer:

  1. Step 1: Define .
  2. Step 2: Compute for .
  3. Step 3: Apply the trapezoidal formula:
  4. Step 4: Calculate the numerical value (show computations).
  5. Step 5: Estimate the error using:
    • Compute and find its maximum on .
    • Substitute to get the error bound.

10. Summary Table for Quick Revision

Concept Key Points Formula
Definite Integral Exact area under a curve; may require numerical methods if antiderivative is unknown.
Trapezoidal Rule Approximates area using trapezoids; error .
Simpson’s Rule Uses parabolic fits; error ; requires even .
Error Bound Trapezoidal: .
When to Use Trapezoidal: Quick estimates. Simpson’s: High precision.

-5-4-3-2-1123450.50.60.70.80.91yf(0)=1f(0.5)=0.8f(1)=0.5
Simpson’s Rule divides the interval into 2 subintervals (n=4), fitting parabolas to each pair of points.

Based on the TU BCA syllabus for Mathematics II (CAMT154), unit 4.

Discussion

Loading…