1.5 Numerical Methods, Root-Finding, and Numerical Integration
Key Takeaways
- The Bisection method is a guaranteed bracketing algorithm that halves the interval size each iteration, requiring $f(a)f(b) < 0$.
- Newton-Raphson method achieves rapid quadratic convergence using $x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)}$, but fails if $f'(x_n) = 0$ or near inflection points.
- Trapezoidal Rule approximates definite integrals using linear interpolations with global truncation error proportional to step size squared $O(h^2)$.
- Simpson's 1/3 Rule uses parabolic interpolations over an even number of subintervals $n$, achieving higher accuracy with error $O(h^4)$.
- Euler's method provides a simple first-order numerical solution for ODE initial value problems $y_{n+1} = y_n + h f(x_n, y_n)$ with cumulative global error $O(h)$.
1.5 Numerical Methods, Root-Finding, and Numerical Integration
Engineering systems frequently involve non-linear equations, complicated experimental datasets, or differential equations lacking analytical closed-form solutions. Numerical methods provide approximate algorithms to solve such mathematical models within specified tolerances.
1. Numerical Root-Finding Algorithms
Root-finding algorithms locate values of $x$ for which $f(x) = 0$.
Bisection Method (Bracketing Method)
Requires an initial interval $[a_0, b_0]$ where $f(a_0)$ and $f(b_0)$ have opposite signs ($f(a_0) \cdot f(b_0) < 0$). By the Intermediate Value Theorem, a root exists in $[a_0, b_0]$.
- Midpoint calculation: $c_k = \frac{a_k + b_k}{2}$.
- Evaluate $f(c_k)$:
- If $f(a_k) \cdot f(c_k) < 0$, the root lies in $[a_k, c_k] \implies b_{k+1} = c_k, a_{k+1} = a_k$.
- If $f(c_k) \cdot f(b_k) < 0$, the root lies in $[c_k, b_k] \implies a_{k+1} = c_k, b_{k+1} = b_k$.
- Maximum absolute error bound after $n$ iterations:
Newton-Raphson Method (Open Method)
Uses the tangent line at current guess $x_n$ to find the next approximation $x_{n+1}$:
Convergence & Limitations
- Convergence Rate: Quadratic convergence ($E_{n+1} \propto E_n^2$) near simple roots.
- Failure Modes: Fails if $f'(x_n) = 0$ (horizontal tangent), oscillates near local extrema, or diverges if initial guess $x_0$ is too far from the root.
Secant Method
Replaces derivative $f'(x_n)$ in Newton-Raphson with a backward finite difference approximation using two points $x_n$ and $x_{n-1}$:
2. Numerical Integration (Quadrature)
Numerical integration estimates definite integrals $I = \int_a^b f(x) dx$ over $n$ subintervals of equal width $h = \frac{b - a}{n}$ with grid points $x_i = a + i h$.
Trapezoidal Rule
Approximates $f(x)$ as linear segments between grid points:
- Global Truncation Error: $E_T = -\frac{(b - a) h^2}{12} f''(\xi)$, where $a \le \xi \le b$. Error is $O(h^2)$.
Simpson's 1/3 Rule
Approximates $f(x)$ using parabolic arcs across pairs of subintervals. Strict Requirement: The number of subintervals $n$ must be an even integer.
- Global Truncation Error: $E_S = -\frac{(b - a) h^4}{180} f^{(4)}(\xi)$. Error is $O(h^4)$.
- Exact for polynomials up to degree 3!
3. Numerical Solution of Initial Value ODEs
For first-order initial value problem $\frac{dy}{dx} = f(x,y)$ with $y(x_0) = y_0$ and step size $h$:
Euler's Method (Explicit First-Order)
- Local Error: $O(h^2)$, Global Error: $O(h)$ (First-order accurate).
Improved Euler Method (Heun's Method - Predictor-Corrector)
- Predictor: $y_{n+1}^* = y_n + h \cdot f(x_n, y_n)$
- Corrector: $y_{n+1} = y_n + \frac{h}{2} \left[ f(x_n, y_n) + f(x_{n+1}, y_{n+1}^*) \right]$
- Global Error: $O(h^2)$ (Second-order accurate).
4. Linear Interpolation Formula
For a tabular dataset where $y_1 = f(x_1)$ and $y_2 = f(x_2)$, the interpolated value $y$ at $x$ ($x_1 \le x \le x_2$) is:
5. Worked Engineering Problems
Worked Example 1: Newton-Raphson Iteration
Problem: Solve $f(x) = x^3 - 2x - 5 = 0$ using two iterations of Newton-Raphson starting with $x_0 = 2.0$.
Solution:
Step 1: Compute derivative $f'(x)$.
Step 2: First Iteration ($n=0$).
Step 3: Second Iteration ($n=1$).
Worked Example 2: Numerical Integration Comparison
Problem: Estimate $I = \int_0^4 (x^3 + 2) dx$ using (a) Trapezoidal Rule with $n=4$ subintervals ($h=1$) and (b) Simpson's 1/3 Rule with $n=4$ ($h=1$). Compare both against the exact analytical solution.
Solution:
**Grid points & Function evaluations ($h = 1$):
- $x_0 = 0 \implies f(0) = 0^3 + 2 = 2$
- $x_1 = 1 \implies f(1) = 1^3 + 2 = 3$
- $x_2 = 2 \implies f(2) = 2^3 + 2 = 10$
- $x_3 = 3 \implies f(3) = 3^3 + 2 = 29$
- $x_4 = 4 \implies f(4) = 4^3 + 2 = 66$
(a) Trapezoidal Rule:
(b) Simpson's 1/3 Rule:
(c) Exact Analytical Integral:
Notice: Simpson's 1/3 Rule yields the exact value (72.0) because its truncation error is zero for cubic polynomials!
Perform one iteration of the Newton-Raphson method for f(x) = x^2 - 5 with an initial guess of x0 = 2.0. What is the updated estimate x1?
Estimate the integral integral from 0 to 2 of x^2 dx using the Trapezoidal Rule with n = 2 subintervals (step size h = 1.0).
Using Euler's method with step size h = 0.1, estimate y(0.2) for the initial value problem dy/dx = x + y with y(0) = 1.0.
Which of the following conditions is strictly required to apply Simpson's 1/3 Rule for numerical integration?