CSC212 Numerical Method

Numerical MethodUnit 69 min read

Numerical Differentiation & Integration: Rules, Errors & Applications

Unit 6 of Numerical Method covers numerical differentiation (finite differences, error analysis) and integration (Newton-Cotes, Romberg, Gaussian quadrature, Simpson’s 3/8 rule), with applications in physics, engineering, and data science, including error bounds and computational efficiency comparisons.

Core Concepts & Methods

Numerical Differentiation

Definition: Approximating derivatives of functions using discrete data points (finite differences) when analytical solutions are unavailable or impractical.

Finite Difference Methods

  1. Forward Difference

    • Error:
    • Use case: Simple, but less accurate for small .
  2. Backward Difference

    • Error:
  3. Central Difference

    • Error: (more accurate)
    • Use case: Preferred for interior points.

Worked Example: Velocity & Acceleration

Given the table:

Time (x) 1 2 4 8 10
Distance (y) 0 1 5 21 27

Step 1: Compute velocity () at using central difference: Correction: For , use (adjacent points): Better: Use central difference with :

Step 2: Compute acceleration () at : Use velocity values at (approximate ):


Numerical Integration

Definition: Approximating definite integrals using weighted sums of function values at discrete points.

Classification of Methods

mindmap
  root((Numerical Integration))
    Newton-Cotes
      Open: 1st, 2nd, 3rd order
      Closed: Trapezoidal, Simpson's 1/3, 3/8
    Romberg Integration
      Richardson Extrapolation
    Gaussian Quadrature
      Gauss-Legendre, Gauss-Chebyshev
    Monte Carlo
      Random Sampling

Newton-Cotes Formulas

Method Formula Error Order # Points Use Case
Trapezoidal Rule Simple, low accuracy
Simpson’s 1/3 Rule Even High accuracy
Simpson’s 3/8 Rule Uneven intervals

Worked Example: Simpson’s 3/8 Rule Evaluate with (7 points).

  • Step 1: Divide into 6 subintervals: .
  • Step 2: Compute and :
  • Step 3: Apply Simpson’s 3/8 rule: Exact value: (matches).

Romberg Integration

Definition: Combines trapezoidal rule with Richardson extrapolation to achieve higher accuracy iteratively.

Algorithm Steps:

  1. Start with trapezoidal rule .
  2. Compute by halving and applying trapezoidal rule.
  3. Extrapolate using: until convergence.

Worked Example: Romberg Integration for

Iteration (Trapezoidal)
1 1.0 0.9093 - -
2 0.5 0.9461 0.9589 -
3 0.25 0.9516 0.9594 0.9595
4 0.125 0.9550 0.9595 0.9595

Final Result: (converged).

Gaussian Quadrature

Definition: Uses weighted function evaluations at specific points (roots of orthogonal polynomials) for higher accuracy with fewer points.

Gauss-Legendre Formula (3 points): where:

  • , ,
  • ,

Worked Example:

  1. Transform to : Let , .
  2. Evaluate:
  3. Apply Gauss-Legendre (3 points):

Error Analysis & Convergence

Error Sources

  1. Truncation Error: Due to approximating the integrand with polynomials.
  2. Round-off Error: Accumulated in floating-point arithmetic.
  3. Discretization Error: Reduces as (for consistent methods).

Error Bounds

Method Error Bound Notes
Trapezoidal Rule Depends on .
Simpson’s Rule Higher accuracy.
Romberg Integration Exponential convergence Requires smooth .

Example: For , Simpson’s rule with gives error:


Applications

  1. Physics/Engineering:
    • Calculating work done ().
    • Solving ODEs via numerical integration (e.g., Runge-Kutta).
  2. Data Science:
    • Estimating probabilities from empirical distributions.
  3. Economics:
    • Computing consumer surplus ().
  4. Computer Graphics:
    • Rendering curves and surfaces.

Numerical integration methods comparisonA flowchart comparing Trapezoidal, Simpson, and Gaussian quadrature rules. (Image: png image Svchb; svg image tobi; English translation by Prof, CC BY-SA 3.0, via Wikimedia Commons)


Comparative Analysis

table
  | Method               | Pros                                  | Cons                                  | Best For                          |
  |----------------------|---------------------------------------|---------------------------------------|-----------------------------------|
  | Trapezoidal Rule     | Simple, low computation               | Low accuracy ()             | Quick estimates                   |
  | Simpson’s Rule       | High accuracy ()             | Requires even                    | Smooth functions                  |
  | Romberg Integration  | High precision with few points        | Complex implementation                | High-accuracy needs               |
  | Gaussian Quadrature  | Optimal for given points              | Limited to specific intervals         | Polynomial integrands             |

Exam Tip

Common Pitfalls & Strategies

  1. Unit Transformation:

    • Always transform integrals to for Gaussian quadrature.
    • Example: .
  2. Error Calculation:

    • Memorize error bounds for Trapezoidal and Simpson’s rules.
    • For Romberg, recognize that converges faster than .
  3. Numerical Differentiation:

    • Use central differences for interior points to minimize error.
    • For boundary points, use forward/backward differences with adjusted .
  4. Exam Questions:

    • Direct Evaluation: Expect 3-4 marks for applying Simpson’s 3/8 or Romberg.
    • Error Analysis: 2 marks for deriving error bounds.
    • Applications: 1 mark for naming a real-world use (e.g., "calculating arc length").
  5. Gaussian Quadrature:

    • Know the weights and nodes for 2-point and 3-point formulas.
    • Transform non-standard intervals carefully.

Model Answer Structure

For a 10-mark question on Romberg integration:

  1. Step 1 (2 marks): Write the trapezoidal rule for and .
  2. Step 2 (3 marks): Compute and .
  3. Step 3 (3 marks): Apply Richardson extrapolation to get .
  4. Step 4 (2 marks): Discuss convergence or compare with exact value.

Practice Problems

  1. Use Simpson’s 1/3 rule with to evaluate .
  2. Derive the error bound for the trapezoidal rule applied to with .
  3. Implement a 2-point Gaussian quadrature to approximate .
  4. Given , estimate using central difference with and , then analyze the error.

Based on the TU BSc CSIT syllabus for Numerical Method (CSC212), unit 6.

Discussion

Loading…