PracticeVideosBlogFlashcards

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)<0f(a)f(b) < 0.

  • Newton-Raphson method achieves rapid quadratic convergence using xn+1=xn−f(xn)f′(xn)x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)}, but fails if f′(xn)=0f'(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(h2)O(h^2).

  • Simpson's 1/3 Rule uses parabolic interpolations over an even number of subintervals nn, achieving higher accuracy with error O(h4)O(h^4).

  • Euler's method provides a simple first-order numerical solution for ODE initial value problems yn+1=yn+hf(xn,yn)y_{n+1} = y_n + h f(x_n, y_n) with cumulative global error O(h)O(h).

Last updated: August 2026

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 xx for which f(x)=0f(x) = 0.

Bisection Method (Bracketing Method)

Requires an initial interval [a0,b0][a_0, b_0] where f(a0)f(a_0) and f(b0)f(b_0) have opposite signs (f(a0)⋅f(b0)<0f(a_0) \cdot f(b_0) < 0). By the Intermediate Value Theorem, a root exists in [a0,b0][a_0, b_0].

  1. Midpoint calculation: ck=ak+bk2c_k = \frac{a_k + b_k}{2}.
  2. Evaluate f(ck)f(c_k):
    • If f(ak)⋅f(ck)<0f(a_k) \cdot f(c_k) < 0, the root lies in [ak,ck]  ⟹  bk+1=ck,ak+1=ak[a_k, c_k] \implies b_{k+1} = c_k, a_{k+1} = a_k.
    • If f(ck)⋅f(bk)<0f(c_k) \cdot f(b_k) < 0, the root lies in [ck,bk]  ⟹  ak+1=ck,bk+1=bk[c_k, b_k] \implies a_{k+1} = c_k, b_{k+1} = b_k.
  3. Maximum absolute error bound after nn iterations: En≤b0−a02nE_n \le \frac{b_0 - a_0}{2^n}

Newton-Raphson Method (Open Method)

Uses the tangent line at current guess xnx_n to find the next approximation xn+1x_{n+1}:

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

Convergence & Limitations

  • Convergence Rate: Quadratic convergence (En+1∝En2E_{n+1} \propto E_n^2) near simple roots.
  • Failure Modes: Fails if f′(xn)=0f'(x_n) = 0 (horizontal tangent), oscillates near local extrema, or diverges if initial guess x0x_0 is too far from the root.

Secant Method

Replaces derivative f′(xn)f'(x_n) in Newton-Raphson with a backward finite difference approximation using two points xnx_n and xn−1x_{n-1}:

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})}

2. Numerical Integration (Quadrature)

Numerical integration estimates definite integrals I=∫abf(x)dxI = \int_a^b f(x) dx over nn subintervals of equal width h=b−anh = \frac{b - a}{n} with grid points xi=a+ihx_i = a + i h.

Trapezoidal Rule

Approximates f(x)f(x) as linear segments between grid points:

Itrap=h2[f(x0)+2f(x1)+2f(x2)+⋯+2f(xn−1)+f(xn)]I_{trap} = \frac{h}{2} \left[ f(x_0) + 2 f(x_1) + 2 f(x_2) + \cdots + 2 f(x_{n-1}) + f(x_n) \right] Itrap=h2[f(x0)+2∑i=1n−1f(xi)+f(xn)]I_{trap} = \frac{h}{2} \left[ f(x_0) + 2 \sum_{i=1}^{n-1} f(x_i) + f(x_n) \right]
  • Global Truncation Error: ET=−(b−a)h212f′′(ξ)E_T = -\frac{(b - a) h^2}{12} f''(\xi), where a≤ξ≤ba \le \xi \le b. Error is O(h2)O(h^2).

Simpson's 1/3 Rule

Approximates f(x)f(x) using parabolic arcs across pairs of subintervals. Strict Requirement: The number of subintervals nn must be an even integer.

Isimp=h3[f(x0)+4f(x1)+2f(x2)+4f(x3)+2f(x4)+⋯+4f(xn−1)+f(xn)]I_{simp} = \frac{h}{3} \left[ f(x_0) + 4 f(x_1) + 2 f(x_2) + 4 f(x_3) + 2 f(x_4) + \cdots + 4 f(x_{n-1}) + f(x_n) \right] Isimp=h3[f(x0)+4∑i oddf(xi)+2∑i evenf(xi)+f(xn)]I_{simp} = \frac{h}{3} \left[ f(x_0) + 4 \sum_{i \text{ odd}} f(x_i) + 2 \sum_{i \text{ even}} f(x_i) + f(x_n) \right]
  • Global Truncation Error: ES=−(b−a)h4180f(4)(ξ)E_S = -\frac{(b - a) h^4}{180} f^{(4)}(\xi). Error is O(h4)O(h^4).
  • Exact for polynomials up to degree 3!

3. Numerical Solution of Initial Value ODEs

For first-order initial value problem dydx=f(x,y)\frac{dy}{dx} = f(x,y) with y(x0)=y0y(x_0) = y_0 and step size hh:

Euler's Method (Explicit First-Order)

yn+1=yn+h⋅f(xn,yn)y_{n+1} = y_n + h \cdot f(x_n, y_n)
  • Local Error: O(h2)O(h^2), Global Error: O(h)O(h) (First-order accurate).

Improved Euler Method (Heun's Method - Predictor-Corrector)

  1. Predictor: yn+1∗=yn+h⋅f(xn,yn)y_{n+1}^* = y_n + h \cdot f(x_n, y_n)
  2. Corrector: 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]
  • Global Error: O(h2)O(h^2) (Second-order accurate).

4. Linear Interpolation Formula

For a tabular dataset where y1=f(x1)y_1 = f(x_1) and y2=f(x2)y_2 = f(x_2), the interpolated value yy at xx (x1≤x≤x2x_1 \le x \le x_2) is:

y=y1+(y2−y1x2−x1)(x−x1)y = y_1 + \left( \frac{y_2 - y_1}{x_2 - x_1} \right) (x - x_1)

5. Worked Engineering Problems

Worked Example 1: Newton-Raphson Iteration

Problem: Solve f(x)=x3−2x−5=0f(x) = x^3 - 2x - 5 = 0 using two iterations of Newton-Raphson starting with x0=2.0x_0 = 2.0.

Solution:

Step 1: Compute derivative f′(x)f'(x).

f′(x)=3x2−2f'(x) = 3x^2 - 2

Step 2: First Iteration (n=0n=0).

f(x0)=f(2.0)=23−2(2)−5=8−4−5=−1.0f(x_0) = f(2.0) = 2^3 - 2(2) - 5 = 8 - 4 - 5 = -1.0 f′(x0)=f′(2.0)=3(2.0)2−2=12−2=10.0f'(x_0) = f'(2.0) = 3(2.0)^2 - 2 = 12 - 2 = 10.0 x1=x0−f(x0)f′(x0)=2.0−−1.010.0=2.0+0.1=2.10x_1 = x_0 - \frac{f(x_0)}{f'(x_0)} = 2.0 - \frac{-1.0}{10.0} = 2.0 + 0.1 = 2.10

Step 3: Second Iteration (n=1n=1).

f(x1)=f(2.10)=(2.10)3−2(2.10)−5=9.261−4.20−5=0.061f(x_1) = f(2.10) = (2.10)^3 - 2(2.10) - 5 = 9.261 - 4.20 - 5 = 0.061 f′(x1)=f′(2.10)=3(2.10)2−2=3(4.41)−2=13.23−2=11.23f'(x_1) = f'(2.10) = 3(2.10)^2 - 2 = 3(4.41) - 2 = 13.23 - 2 = 11.23 x2=2.10−0.06111.23=2.10−0.00543=2.09457x_2 = 2.10 - \frac{0.061}{11.23} = 2.10 - 0.00543 = 2.09457

Worked Example 2: Numerical Integration Comparison

Problem: Estimate I=∫04(x3+2)dxI = \int_0^4 (x^3 + 2) dx using (a) Trapezoidal Rule with n=4n=4 subintervals (h=1h=1) and (b) Simpson's 1/3 Rule with n=4n=4 (h=1h=1). Compare both against the exact analytical solution.

Solution:

Grid points & Function evaluations (h=1h = 1):

  • x0=0  ⟹  f(0)=03+2=2x_0 = 0 \implies f(0) = 0^3 + 2 = 2
  • x1=1  ⟹  f(1)=13+2=3x_1 = 1 \implies f(1) = 1^3 + 2 = 3
  • x2=2  ⟹  f(2)=23+2=10x_2 = 2 \implies f(2) = 2^3 + 2 = 10
  • x3=3  ⟹  f(3)=33+2=29x_3 = 3 \implies f(3) = 3^3 + 2 = 29
  • x4=4  ⟹  f(4)=43+2=66x_4 = 4 \implies f(4) = 4^3 + 2 = 66

(a) Trapezoidal Rule:

Itrap=12[f(0)+2(f(1)+f(2)+f(3))+f(4)]I_{trap} = \frac{1}{2} \left[ f(0) + 2(f(1) + f(2) + f(3)) + f(4) \right] Itrap=12[2+2(3+10+29)+66]=12[2+2(42)+66]=12[2+84+66]=1522=76.0I_{trap} = \frac{1}{2} \left[ 2 + 2(3 + 10 + 29) + 66 \right] = \frac{1}{2} \left[ 2 + 2(42) + 66 \right] = \frac{1}{2} [2 + 84 + 66] = \frac{152}{2} = 76.0

(b) Simpson's 1/3 Rule:

Isimp=13[f(0)+4(f(1)+f(3))+2(f(2))+f(4)]I_{simp} = \frac{1}{3} \left[ f(0) + 4(f(1) + f(3)) + 2(f(2)) + f(4) \right] Isimp=13[2+4(3+29)+2(10)+66]=13[2+4(32)+20+66]=13[2+128+20+66]=2163=72.0I_{simp} = \frac{1}{3} \left[ 2 + 4(3 + 29) + 2(10) + 66 \right] = \frac{1}{3} \left[ 2 + 4(32) + 20 + 66 \right] = \frac{1}{3} [2 + 128 + 20 + 66] = \frac{216}{3} = 72.0

(c) Exact Analytical Integral:

Iexact=[x44+2x]04=(2564+8)−0=64+8=72.0I_{exact} = \left[ \frac{x^4}{4} + 2x \right]_0^4 = \left(\frac{256}{4} + 8\right) - 0 = 64 + 8 = 72.0

Notice: Simpson's 1/3 Rule yields the exact value (72.0) because its truncation error is zero for cubic polynomials!

Loading diagram...
Numerical Method Selection & Convergence Comparison
Test Your Knowledge

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?

A

2.15

B

2.25

C

2.35

D

2.45

Test Your Knowledge

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

A

2.33

B

2.67

C

2.85

D

3.00

Test Your Knowledge

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.

A

1.220

B

1.110

C

1.340

D

1.250

Test Your Knowledge

Which of the following conditions is strictly required to apply Simpson's 1/3 Rule for numerical integration?

A

The function f(x) must be a second-order polynomial

B

The step size h must approach zero

C

The number of subintervals n must be an even integer

D

The integration domain [a, b] must be symmetric about the origin

Sections you finish are checked off in the contents.