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.

Last updated: August 2026

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 f(a)f(a) and f(b)f(b) have opposite signs, a root lies between them. Repeatedly halve the interval, keeping the half in which the sign change persists:

xmid=a+b2x_{\text{mid}} = \frac{a + b}{2}

Bisection is always convergent but only linearly so: each iteration gains exactly one bit of accuracy, and after nn steps the error bound is (b−a)/2n(b-a)/2^{n}. 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:

xn+1=xn−f(xn)f′(xn)x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)}

Convergence is quadratic near a simple root — the number of correct digits roughly doubles each iteration. The failure modes are equally examinable:

  • f′(xn)≈0f'(x_n) \approx 0 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 10\sqrt{10} by solving f(x)=x2−10=0f(x) = x^2 - 10 = 0 with x0=3x_0 = 3.

x1=3−9−106=3+0.16667=3.16667x_1 = 3 - \frac{9 - 10}{6} = 3 + 0.16667 = 3.16667 x2=3.16667−10.0278−106.33333=3.16667−0.00439=3.16228x_2 = 3.16667 - \frac{10.0278 - 10}{6.33333} = 3.16667 - 0.00439 = 3.16228

Two iterations already give six-figure accuracy against the true value 3.162278. Note the special case: applying Newton-Raphson to x2−Nx^2 - N gives the classical square-root iteration xn+1=12(xn+N/xn)x_{n+1} = \tfrac{1}{2}\left(x_n + N/x_n\right).

Root Finding: Secant and Regula Falsi

The secant method replaces the derivative by a finite difference:

xn+1=xn−f(xn)xn−xn−1f(xn)−f(xn−1)x_{n+1} = x_n - f(x_n)\frac{x_n - x_{n-1}}{f(x_n) - f(x_{n-1})}

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 [a,b][a,b] into nn strips of width h=(b−a)/nh = (b-a)/n with ordinates y0,y1,…,yny_0, y_1, \ldots, y_n.

Trapezoidal rule

∫aby dx≈h2[(y0+yn)+2(y1+y2+⋯+yn−1)]\int_a^b y\,dx \approx \frac{h}{2}\Big[(y_0 + y_n) + 2(y_1 + y_2 + \cdots + y_{n-1})\Big]

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 h2h^2.

Simpson's one-third rule

∫aby dx≈h3[(y0+yn)+4(y1+y3+⋯ )+2(y2+y4+⋯ )]\int_a^b y\,dx \approx \frac{h}{3}\Big[(y_0 + y_n) + 4(y_1 + y_3 + \cdots) + 2(y_2 + y_4 + \cdots)\Big]

The weighting pattern is 1,4,2,4,2,…,4,11, 4, 2, 4, 2, \ldots, 4, 1 — 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 h4h^4.

Simpson's three-eighths rule

∫aby dx≈3h8[(y0+yn)+3(y1+y2+y4+y5+⋯ )+2(y3+y6+⋯ )]\int_a^b y\,dx \approx \frac{3h}{8}\Big[(y_0 + y_n) + 3(y_1 + y_2 + y_4 + y_5 + \cdots) + 2(y_3 + y_6 + \cdots)\Big]

This requires the number of intervals to be a multiple of 3.

RuleIntervals requiredExact forError order
TrapezoidalAny nnDegree 1h2h^2
Simpson 1/3Even nnDegree 3h4h^4
Simpson 3/8Multiple of 3Degree 3h4h^4

Worked example. Evaluate ∫02x3dx\int_0^2 x^3 dx with n=2n = 2, so h=1h = 1 and ordinates y0=0y_0 = 0, y1=1y_1 = 1, y2=8y_2 = 8.

Simpson: 13[(0+8)+4(1)]=123=4\dfrac{1}{3}\left[(0 + 8) + 4(1)\right] = \dfrac{12}{3} = 4 — the exact answer, since Simpson is exact for cubics.

Trapezoidal: 12[(0+8)+2(1)]=5\dfrac{1}{2}\left[(0+8) + 2(1)\right] = 5, an error of 25%. This contrast is a favourite examination point.

Numerical Solution of Differential Equations

For dydx=f(x,y)\dfrac{dy}{dx} = f(x,y) with y(x0)=y0y(x_0) = y_0:

Euler's method (single-step, first order):

yn+1=yn+h f(xn,yn)y_{n+1} = y_n + h\,f(x_n, y_n)

Simple but crude; the error per step is proportional to h2h^2 and accumulates.

Modified Euler / Heun (predictor-corrector, second order):

yn+1=yn+h2[f(xn,yn)+f(xn+1,yn+1∗)]y_{n+1} = y_n + \frac{h}{2}\left[f(x_n,y_n) + f(x_{n+1}, y^{*}_{n+1})\right]

Fourth-order Runge-Kutta, the standard multi-stage method:

k1=hf(xn,yn),k2=hf ⁣(xn+h2,yn+k12)k_1 = hf(x_n,y_n), \quad k_2 = hf\!\left(x_n + \tfrac{h}{2}, y_n + \tfrac{k_1}{2}\right) k3=hf ⁣(xn+h2,yn+k22),k4=hf(xn+h,yn+k3)k_3 = hf\!\left(x_n + \tfrac{h}{2}, y_n + \tfrac{k_2}{2}\right), \quad k_4 = hf(x_n + h, y_n + k_3) yn+1=yn+16(k1+2k2+2k3+k4)y_{n+1} = y_n + \frac{1}{6}\left(k_1 + 2k_2 + 2k_3 + k_4\right)

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 k1k_1.

Test Your Knowledge

Simpson's one-third rule requires that the number of sub-intervals be:

A

Even

B

Odd

C

A multiple of three

D

Any positive integer

Test Your Knowledge

The Newton-Raphson method may fail to converge when:

A

The function is continuous

B

The derivative at the current estimate is close to zero

C

The initial guess is very close to the root

D

The root is simple rather than repeated

Test Your Knowledge

Using Simpson's one-third rule with two sub-intervals to evaluate the integral of x^3 from 0 to 2 gives:

A

6

B

5, with a 25% error

C

4, which is exact

D

3.5

Test Your Knowledge

Compared with Euler's method, the fourth-order Runge-Kutta method for solving an ordinary differential equation:

A

Requires the equation to be linear

B

Cannot be used with a fixed step size

C

Uses one function evaluation per step and is less accurate

D

Uses four function evaluations per step and is far more accurate

Sections you finish are checked off in the contents.