6.12 Numerical Methods: Root Finding, Integration & ODE Solvers
Key Takeaways
The Newton-Raphson method converges quadratically but fails when the derivative at the current estimate is near zero, whereas bisection always converges though only linearly.
The trapezoidal rule needs any number of intervals and is exact for linear functions, while Simpson's one-third rule requires an even number of intervals and is exact up to cubics.
Simpson's one-third rule weights ordinates in the pattern 1, 4, 2, 4, ..., 4, 1 and the multiplier outside the bracket is h divided by 3.
Euler's method is a single-step first-order ODE solver, while the fourth-order Runge-Kutta method achieves far higher accuracy for the same step size at the cost of four function evaluations.
Why Numerical Methods Appear on a PSU Paper
Closed-form solutions run out quickly in engineering practice: the Colebrook equation for pipe friction, the transcendental frequency equation for a continuous beam, and most fin and radiation problems admit no algebraic solution. The syllabus therefore lists three numerical topics, and objective items on them are highly formulaic — recall the iteration formula, do two rounds of arithmetic.
Root Finding: Bisection Method
If and have opposite signs, a root lies between them. Repeatedly halve the interval, keeping the half in which the sign change persists:
Bisection is always convergent but only linearly so: each iteration gains exactly one bit of accuracy, and after steps the error bound is . It cannot find roots of even multiplicity, where the function touches but does not cross the axis.
Root Finding: Newton-Raphson Method
The workhorse method, derived from a first-order Taylor expansion:
Convergence is quadratic near a simple root — the number of correct digits roughly doubles each iteration. The failure modes are equally examinable:
- sends the next iterate far away (a near-horizontal tangent).
- A poor initial guess can diverge or cycle between two values.
- At a root of multiplicity greater than one, convergence degrades to linear.
Worked example. Find by solving with .
Two iterations already give six-figure accuracy against the true value 3.162278. Note the special case: applying Newton-Raphson to gives the classical square-root iteration .
Root Finding: Secant and Regula Falsi
The secant method replaces the derivative by a finite difference:
It needs two starting points and no derivative, converging at order about 1.618. Regula falsi (false position) uses the same formula but always retains a bracketing pair, trading some speed for guaranteed convergence.
Numerical Integration
Both rules divide into strips of width with ordinates .
Trapezoidal rule
Any number of intervals is allowed. The rule fits straight lines between points, so it is exact for linear integrands and its error is proportional to .
Simpson's one-third rule
The weighting pattern is — odd-indexed ordinates get 4, even-indexed interior ordinates get 2. It requires an even number of intervals (an odd number of ordinates) because it fits a parabola through each group of three points. It is exact up to cubic integrands and its error goes as .
Simpson's three-eighths rule
This requires the number of intervals to be a multiple of 3.
| Rule | Intervals required | Exact for | Error order |
|---|---|---|---|
| Trapezoidal | Any | Degree 1 | |
| Simpson 1/3 | Even | Degree 3 | |
| Simpson 3/8 | Multiple of 3 | Degree 3 |
Worked example. Evaluate with , so and ordinates , , .
Simpson: — the exact answer, since Simpson is exact for cubics.
Trapezoidal: , an error of 25%. This contrast is a favourite examination point.
Numerical Solution of Differential Equations
For with :
Euler's method (single-step, first order):
Simple but crude; the error per step is proportional to and accumulates.
Modified Euler / Heun (predictor-corrector, second order):
Fourth-order Runge-Kutta, the standard multi-stage method:
Four function evaluations per step buy fourth-order accuracy, which is why RK4 is the default in almost every engineering solver. Euler's method is the special case obtained by keeping only .
Simpson's one-third rule requires that the number of sub-intervals be:
Even
Odd
A multiple of three
Any positive integer
The Newton-Raphson method may fail to converge when:
The function is continuous
The derivative at the current estimate is close to zero
The initial guess is very close to the root
The root is simple rather than repeated
Using Simpson's one-third rule with two sub-intervals to evaluate the integral of x^3 from 0 to 2 gives:
6
5, with a 25% error
4, which is exact
3.5
Compared with Euler's method, the fourth-order Runge-Kutta method for solving an ordinary differential equation:
Requires the equation to be linear
Cannot be used with a fixed step size
Uses one function evaluation per step and is less accurate
Uses four function evaluations per step and is far more accurate
Sections you finish are checked off in the contents.