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
Forward Difference
- Error:
- Use case: Simple, but less accurate for small .
Backward Difference
- Error:
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 SamplingNewton-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:
- Start with trapezoidal rule .
- Compute by halving and applying trapezoidal rule.
- 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:
- Transform to : Let , .
- Evaluate:
- Apply Gauss-Legendre (3 points):
Error Analysis & Convergence
Error Sources
- Truncation Error: Due to approximating the integrand with polynomials.
- Round-off Error: Accumulated in floating-point arithmetic.
- 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
- Physics/Engineering:
- Calculating work done ().
- Solving ODEs via numerical integration (e.g., Runge-Kutta).
- Data Science:
- Estimating probabilities from empirical distributions.
- Economics:
- Computing consumer surplus ().
- Computer Graphics:
- Rendering curves and surfaces.
A 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
Unit Transformation:
- Always transform integrals to for Gaussian quadrature.
- Example: .
Error Calculation:
- Memorize error bounds for Trapezoidal and Simpson’s rules.
- For Romberg, recognize that converges faster than .
Numerical Differentiation:
- Use central differences for interior points to minimize error.
- For boundary points, use forward/backward differences with adjusted .
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").
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:
- Step 1 (2 marks): Write the trapezoidal rule for and .
- Step 2 (3 marks): Compute and .
- Step 3 (3 marks): Apply Richardson extrapolation to get .
- Step 4 (2 marks): Discuss convergence or compare with exact value.
Practice Problems
- Use Simpson’s 1/3 rule with to evaluate .
- Derive the error bound for the trapezoidal rule applied to with .
- Implement a 2-point Gaussian quadrature to approximate .
- 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…