5 Chapter 4: Numerical Methods - I
5.1 Module 4: Numerical Methods - I
5.1.1 Topic Summary
This module introduces numerical methods for root-finding and approximation. Newton-Raphson iteratively refines roots using \(x_{n+1} = x_n - f(x_n)/f'(x_n)\), applied to equations like cubics or square roots. Finite differences compute derivatives or interpolations, with forward differences \(\Delta y_0 = y_1 - y_0\) for initial slopes. Lagrange interpolation constructs polynomials through given points for estimating unknown values, while Newton forward/backward uses difference tables for uniform grids. Numerical integration approximates areas under curves: Trapezoidal rule \(\frac{h}{2}(y_0 + 2y_1 + y_2)\) for linear approximation, and Simpson’s 1/3 rule \(\frac{h}{3}(y_0 + 4y_1 + 2y_2 + y_4)\) for quadratic, used for integrals like \(e^{-x^2}\) or \(1/x\) (Burden and Faires 2015).
Newton-Raphson: Iterative: \(x_{\text{new}} = x - \frac{f(x)}{f'(x)}\). Stop when \(|x_{\text{new}} - x|\) is small. Needs good initial guess.
Finite Differences: Forward \(\Delta y_i = y_{i+1} - y_i\). For interpolation, use tables to build polynomials.
Lagrange: \(L_i(x) = \prod_{j \neq i} \frac{x - x_j}{x_i - x_j}\). Then \(f(x) \approx \sum y_i L_i(x)\).
Newton Interpolation: Build difference table, use for uniform points. Forward for start, backward for end.
Integration: Trapezoidal for straight lines, Simpson for curves. More points = better accuracy.
Common Mistakes: Wrong sign in NR, off-by-one in differences, forgetting denominators in Lagrange.
Practice: Start with simple functions, plot to visualize roots/interpolations.
5.1.2 Solved Problems
Newton-Raphson Application: Use the Newton-Raphson method to find a root of \(x^3 - x - 1 = 0\) starting with \(x_0 = 1.5\).
- Solution: Using \(f(x) = x^3 - x - 1\) and derivative \(f'(x) = 3x^2 - 1\). Iteration 1 gives \(x_1 = 1.5 - \frac{0.875}{5.75} \approx 1.3478\). Repeating the formula converges quickly to the root \(1.3247\).
Forward Differences: Find the first-order forward difference \(\Delta y_0\) for the data: (1, 5), (2, 10), (3, 17).
- Solution: The forward difference formula is simply \(\Delta y_0 = y_1 - y_0\). Plugging in the values, \(\Delta y_0 = 10 - 5 = 5\).
Lagrange’s Interpolation: Using Lagrange’s interpolating polynomial, estimate \(f(1.5)\) for the data: (0, 0), (1, 1), (2, 4), (3, 9).
- Solution: Substitute \(x=1.5\) into the standard Lagrange formula using all four coordinate pairs. Computing the weighted basis polynomials evaluates precisely to \(f(1.5) = 2.25\).
Trapezoidal Rule: Use the Trapezoidal rule to approximate \(\int_0^1 x^2 dx\) with step \(h=0.5\).
- Solution: Data points \(x = 0, 0.5, 1.0\) yield \(y = 0, 0.25, 1.0\). The Trapezoidal formula is \(\frac{h}{2} [y_0 + 2y_1 + y_2] = \frac{0.5}{2} [0 + 2(0.25) + 1] = 0.375\).
Simpson’s 1/3rd Rule: Evaluate \(\int_0^1 e^{-x^2} dx\) using Simpson’s 1/3rd rule with \(n=4\) sub-intervals.
- Solution: Step size \(h = 0.25\). Calculate \(y_i = e^{-x_i^2}\) for \(x_i = 0, 0.25, 0.5, 0.75, 1.0\). Apply Simpson’s rule: \(\frac{h}{3}[(y_0 + y_4) + 4(y_1 + y_3) + 2(y_2)] \approx 0.7469\).
Lagrange Interpolation Example: Using Lagrange’s interpolation, find \(y(3)\) for the data: \((0, 2), (1, 3), (2, 12), (5, 147)\).
- Solution: Evaluating the polynomial terms gives \(y(3) = 33\).
Newton Forward Interpolation: Find \(f(2.5)\) using Newton’s forward interpolation formula for the data: \((1, 1), (2, 8), (3, 27), (4, 64)\).
- Solution: Constructing the forward difference table and applying the formula yields \(f(2.5) = 15.625\).
Trapezoidal Rule Example: Use the Trapezoidal rule to evaluate \(\int_1^2 \frac{1}{x} dx\) taking \(h = 0.5\).
- Solution: Points are \(1.0, 1.5, 2.0\) with corresponding \(y\) values of \(1.0, 0.6667, 0.5\). Applying the formula gives approximately \(0.70835\).
Simpson’s 1/3rd Rule Example: Evaluate \(\int_0^1 \frac{1}{1+x} dx\) using Simpson’s 1/3rd rule with \(h=0.25\).
- Solution: Setting up function table for \(x=0, 0.25, 0.5, 0.75, 1.0\) and applying formula yields approximately \(0.6931\).
- Solution: Setting up function table for \(x=0, 0.25, 0.5, 0.75, 1.0\) and applying formula yields approximately \(0.6931\).
Newton-Raphson for Square Root: Use Newton-Raphson method to find \(\sqrt{5}\) starting with \(x_0 = 2\).
- Solution: Define \(f(x) = x^2 - 5\) and \(f'(x) = 2x\). Iterating gives \(x_1 = 2.25\), \(x_2 \approx 2.2361\), converging to \(\sqrt{5} \approx 2.2361\).
5.1.3 Practice Problems
Construct a Newton’s forward difference table for the following data: (0, 1), (1, 3), (2, 7), (3, 13).
Use Newton-Raphson method to find the square root of 5 starting with \(x_0 = 2\).
Estimate \(f(1.8)\) using Lagrange’s interpolation for the data: (1, 2), (2, 4), (3, 6).
Use Newton’s backward interpolation to estimate \(f(0.5)\) for the data: (0, 1), (0.5, 1.5), (1, 2), (1.5, 2.5).
Evaluate \(\int_0^2 e^x \, dx\) using Simpson’s 3/8 rule with \(n=3\) (adjust for 4 points).
Estimate \(f(1.8)\) using Newton’s backward interpolation formula from the following data: x: 0, 0.5, 1.0, 1.5, 2.0; f(x): 1.0, 1.05, 1.10, 1.16, 1.22.
NR: Choose x0 close to root, iterate until convergence.
Finite differences: Use tables to avoid mistakes, check for uniform spacing.
Lagrange: Write out basis polynomials, check denominators.
Interpolation: Lagrange for any points, Newton for equal spacing.
Integration: Trapezoidal simple, Simpson more accurate with even intervals.
Memorize formulas: Don’t derive every time, but understand derivation.
Practice: Use small h for accuracy, check with known integrals.