Skip to content

Computational Techniques: Roots, Interpolation, Quadrature and Runge–Kutta

CSIR NET Physical Sciences: bisection, Newton–Raphson, secant, interpolation, trapezoid and Simpson's rules, Euler and Runge–Kutta, finite differences.

  • 23 min read
  • Updated
On this page · 15 sections
  1. Prerequisites
  2. The Hook: The Calculator Inside Your Calculator
  3. Error Vocabulary
  4. Roots of Equations
  5. Interpolation
  6. Numerical Integration (Quadrature)
  7. Ordinary Differential Equations: Euler to Runge–Kutta
  8. Finite Differences
  9. Memory Tricks
  10. Don’t Confuse
  11. Common Mistakes
  12. Practice
  13. Quick Revision Table
  14. Key Takeaways
  15. What’s Next

Prerequisites

The Hook: The Calculator Inside Your Calculator

Error Vocabulary

TermMeaning
Truncation errorerror from replacing an infinite process (Taylor series, limit) by a finite one; shrinks as \( h \to 0 \)
Round-off errorerror from finite-precision arithmetic; grows as \( h \to 0 \) when you subtract nearly equal numbers
Order \( p \) of a method (step size \( h \))global error \( \propto h^p \): halving \( h \) cuts the error by \( 2^p \)
Order \( p \) of an iteration\( \lvert e_{n+1}\rvert \approx C\lvert e_n\rvert^p \): \( p = 1 \) linear, \( p = 2 \) quadratic
Local vs global error (ODE)local error per step \( O(h^{p+1}) \); over \( N \propto 1/h \) steps it accumulates to \( O(h^p) \)

Because truncation error falls with \( h \) and round-off error rises, a numerical derivative has an optimum step size; making \( h \) ever smaller eventually makes the answer worse.

Roots of Equations

Bisection

If \( f \) is continuous and \( f(a)f(b) < 0 \), there is a root in \( (a, b) \). Evaluate \( f \) at the midpoint \( c \) and keep the half where the sign changes. After \( n \) steps the bracket has width \( (b - a)/2^n \), so to reach accuracy \( \varepsilon \) you need

$$\boxed{n \geq \log_2\frac{b - a}{\varepsilon}}$$

Bisection always converges (linearly, with factor \( 1/2 \)) but is slow: about 3.3 steps per decimal digit.

Newton–Raphson

Replace \( f \) by its tangent at \( x_n \) and take the tangent’s zero:

$$\boxed{x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)}}$$

Near a simple root \( \alpha \), \( e_{n+1} \approx \frac{f''(\alpha)}{2f'(\alpha)}e_n^2 \): quadratic convergence, so the number of correct digits roughly doubles each step.

Failure modes:

  • \( f'(x_n) \approx 0 \): the tangent is nearly flat and the next iterate shoots off.
  • Poor starting point: the iteration can cycle or converge to a different root.
  • Multiple root of multiplicity \( m \): convergence becomes linear with ratio \( (m - 1)/m \). For \( f = (x - 1)^2 \) from \( x_0 = 2 \): 1.5, 1.25, 1.125, … (the error halves). The fix is \( x_{n+1} = x_n - mf/f' \).

Useful Newton iterations:

To computeUse \( f(x) = \)Iteration
\( \sqrt a \)\( x^2 - a \)\( x_{n+1} = \tfrac{1}{2}\left(x_n + a/x_n\right) \)
\( a^{1/k} \)\( x^k - a \)\( x_{n+1} = \frac{1}{k}\left[(k - 1)x_n + a/x_n^{k-1}\right] \)
\( 1/a \) (no division)\( 1/x - a \)\( x_{n+1} = x_n(2 - ax_n) \)

For \( 1/3 \) from \( x_0 = 0.3 \): 0.33, 0.3333, 0.33333333. The number of correct digits doubles each time.

Secant and regula falsi

Replace \( f' \) in Newton’s formula by a difference quotient through the last two points:

$$x_{n+1} = x_n - f(x_n)\frac{x_n - x_{n-1}}{f(x_n) - f(x_{n-1})}$$
  • Secant: uses the last two iterates; order \( (1 + \sqrt5)/2 \approx 1.618 \); no derivative needed; not guaranteed to converge.
  • Regula falsi (false position): same formula, but keeps the two points that bracket the root, like bisection. Always converges, but typically linearly, because one end point can get stuck.

Fixed-point iteration

Rewrite \( f(x) = 0 \) as \( x = g(x) \) and iterate \( x_{n+1} = g(x_n) \). It converges near the fixed point \( \alpha \) if \( \lvert g'(\alpha)\rvert < 1 \), linearly with ratio \( \lvert g'(\alpha)\rvert \). Newton’s method is the special choice \( g = x - f/f' \), for which \( g'(\alpha) = 0 \): that is why it converges quadratically.

MethodOrderNeedsGuaranteed?
Bisection1 (factor 1/2)sign changeyes
Regula falsi1 (usually)sign changeyes
Fixed point1 (factor \( \lvert g'\rvert \))\( \lvert g'\rvert < 1 \)locally
Secant1.618two starting pointsno
Newton–Raphson2 (simple root)\( f' \)locally

Interpolation

Given \( n + 1 \) points \( (x_i, f_i) \) with distinct \( x_i \), there is exactly one polynomial of degree at most \( n \) through them. Lagrange and Newton formulas are two ways of writing the same polynomial.

Lagrange form

$$P_n(x) = \sum_{i = 0}^nf_i\,\ell_i(x), \qquad \ell_i(x) = \prod_{j\neq i}\frac{x - x_j}{x_i - x_j}$$

Each \( \ell_i \) is 1 at \( x_i \) and 0 at the other nodes, and \( \sum_i\ell_i(x) = 1 \) identically.

Error term

$$\boxed{f(x) - P_n(x) = \frac{f^{(n+1)}(\xi)}{(n + 1)!}\prod_{i = 0}^n(x - x_i)}$$

for some \( \xi \) in the span of the nodes and \( x \). Interpolation is exact for polynomials of degree \( \leq n \). Using many equally spaced nodes on a function like \( 1/(1 + 25x^2) \) makes the product term blow up near the ends (the Runge phenomenon); remedies are piecewise (spline) interpolation or nodes clustered at the ends (Chebyshev nodes).

Finite differences and Newton’s forward formula

For equally spaced nodes \( x_i = x_0 + ih \), define the forward difference \( \Delta f_i = f_{i+1} - f_i \), and the shift operator \( Ef(x) = f(x + h) \), so \( E = 1 + \Delta \). With \( s = (x - x_0)/h \),

$$P(x) = f_0 + s\,\Delta f_0 + \frac{s(s - 1)}{2!}\Delta^2f_0 + \frac{s(s - 1)(s - 2)}{3!}\Delta^3f_0 + \cdots$$

A key fact: for a polynomial of degree \( n \) with leading coefficient \( a \), the \( n \)th difference is constant,

$$\boxed{\Delta^nf = a\,n!\,h^n}$$

and all higher differences vanish. For \( f = x^3 \) at \( x = 0, 1, 2, 3, 4 \): values 0, 1, 8, 27, 64; first differences 1, 7, 19, 37; second 6, 12, 18; third 6, 6 (\( = 3! \)); fourth 0. A table whose \( k \)th differences are constant comes from a degree-\( k \) polynomial; a single odd entry in the difference table reveals a copying error.

Extrapolation

Evaluating the interpolating polynomial outside the span of the nodes is extrapolation. The error formula still holds, but the product \( \prod(x - x_i) \) now grows rapidly with distance from the table, so extrapolation is far less reliable than interpolation; use Newton’s backward-difference form (built on \( \nabla \)) to extrapolate just beyond the end of a table. The controlled use of extrapolation is Richardson extrapolation: if an estimate \( A(h) \) has error \( ch^p \), then

$$A \approx A(h/2) + \frac{A(h/2) - A(h)}{2^p - 1}$$

cancels the leading error term. It appears again below, where it turns the trapezoid rule into Simpson’s rule.

Other operators: backward difference \( \nabla f_i = f_i - f_{i-1} \), central difference \( \delta f_i = f_{i+1/2} - f_{i-1/2} \), and \( hD = \ln E \) (with \( D = d/dx \)), which is the origin of all the finite-difference derivative formulas below.

Numerical Integration (Quadrature)

Divide \( [a, b] \) into \( n \) intervals of width \( h = (b - a)/n \), with \( f_i = f(a + ih) \).

Trapezoidal rule

Join the points by straight lines:

$$\boxed{\int_a^bf\,dx \approx \frac{h}{2}\left[f_0 + 2(f_1 + f_2 + \cdots + f_{n-1}) + f_n\right]}$$$$\text{Error: } \int_a^bf\,dx - T = -\frac{(b - a)h^2}{12}f''(\xi)$$

Exact for straight lines; second order in \( h \). It overestimates the integral of a convex function (\( f'' > 0 \)), since chords lie above the curve. (For smooth periodic functions integrated over a full period it is spectacularly accurate, because the error terms cancel.)

Simpson’s 1/3 rule

Fit parabolas through successive triples of points (so \( n \) must be even):

$$\boxed{\int_a^bf\,dx \approx \frac{h}{3}\left[f_0 + 4(f_1 + f_3 + \cdots + f_{n-1}) + 2(f_2 + f_4 + \cdots + f_{n-2}) + f_n\right]}$$$$\text{Error: } \int_a^bf\,dx - S = -\frac{(b - a)h^4}{180}f^{(4)}(\xi)$$

Built from parabolas, yet exact for cubics: the cubic error cancels by symmetry, giving a bonus order. Fourth order in \( h \).

RuleWeights (one panel)Points per panelExact up to degreeGlobal error
Trapezoid\( \frac{h}{2}(1, 1) \)21\( O(h^2) \)
Simpson 1/3\( \frac{h}{3}(1, 4, 1) \)33\( O(h^4) \)
Simpson 3/8\( \frac{3h}{8}(1, 3, 3, 1) \)43\( O(h^4) \)
Gauss–Legendre, \( N \) pointsoptimal nodes and weights\( N \)\( 2N - 1 \)—

Richardson extrapolation turns two trapezoid estimates into a better one: \( S = T(h/2) + \frac{T(h/2) - T(h)}{3} \) is exactly Simpson’s rule. Repeating the trick is Romberg integration.

Ordinary Differential Equations: Euler to Runge–Kutta

Solve \( y' = f(x, y) \), \( y(x_0) = y_0 \), with steps \( h \).

Euler’s method

$$\boxed{y_{n+1} = y_n + hf(x_n, y_n)}$$

Follow the tangent for one step. Local error \( O(h^2) \), global error \( O(h) \): first order.

Stability. For the test equation \( y' = -\lambda y \) (\( \lambda > 0 \)), Euler gives \( y_{n+1} = (1 - h\lambda)y_n \). The numerical solution decays only if \( \lvert1 - h\lambda\rvert < 1 \), i.e.

$$h < \frac{2}{\lambda}$$

Beyond that it oscillates with growing amplitude, even though the true solution decays. Backward (implicit) Euler, \( y_{n+1} = y_n + hf(x_{n+1}, y_{n+1}) \), gives \( y_{n+1} = y_n/(1 + h\lambda) \): stable for every \( h \). Stiff equations (widely separated time scales) need implicit methods.

Second-order Runge–Kutta

Use a slope averaged over the step:

  • Heun (improved Euler): \( k_1 = f(x_n, y_n) \), \( k_2 = f(x_n + h, y_n + hk_1) \), \( y_{n+1} = y_n + \frac{h}{2}(k_1 + k_2) \).
  • Midpoint (modified Euler): \( k_1 = f(x_n, y_n) \), \( k_2 = f\left(x_n + \frac{h}{2}, y_n + \frac{h}{2}k_1\right) \), \( y_{n+1} = y_n + hk_2 \).

Both match the Taylor series through \( h^2 \): global error \( O(h^2) \).

Classical fourth-order Runge–Kutta (RK4)

$$\begin{aligned} k_1 &= f(x_n, y_n)\\ k_2 &= f\left(x_n + \tfrac{h}{2},\ y_n + \tfrac{h}{2}k_1\right)\\ k_3 &= f\left(x_n + \tfrac{h}{2},\ y_n + \tfrac{h}{2}k_2\right)\\ k_4 &= f(x_n + h,\ y_n + hk_3) \end{aligned} \qquad \boxed{y_{n+1} = y_n + \frac{h}{6}(k_1 + 2k_2 + 2k_3 + k_4)}$$

Local error \( O(h^5) \), global \( O(h^4) \). If \( f \) depends on \( x \) only, RK4 reduces to Simpson’s rule on each step (weights 1, 4, 1 with \( k_2 = k_3 \)).

For \( y' = y \), one step of each method reproduces the Taylor series of \( e^h \) to its order:

Method\( y_1 \) for \( y' = y \), \( y_0 = 1 \), \( h = 0.1 \)Error
Euler\( 1 + h = 1.1 \)\( 5.2\times10^{-3} \)
Heun / midpoint\( 1 + h + h^2/2 = 1.105 \)\( 1.7\times10^{-4} \)
RK4\( 1 + h + \frac{h^2}{2} + \frac{h^3}{6} + \frac{h^4}{24} = 1.1051708 \)\( 8.5\times10^{-8} \)
Exact\( e^{0.1} = 1.1051709 \)—

Higher-order ODEs are handled by turning them into first-order systems: \( \ddot x = F(x, \dot x, t) \) becomes \( (x, v)' = (v, F) \), and RK4 is applied to the vector.

Finite Differences

Derivatives from Taylor series

Expanding \( f(x \pm h) \) gives the standard stencils:

FormulaApproximatesLeading error
\( \dfrac{f(x + h) - f(x)}{h} \) (forward)\( f'(x) \)\( \frac{h}{2}f'' \): \( O(h) \)
\( \dfrac{f(x) - f(x - h)}{h} \) (backward)\( f'(x) \)\( -\frac{h}{2}f'' \): \( O(h) \)
\( \dfrac{f(x + h) - f(x - h)}{2h} \) (central)\( f'(x) \)\( \frac{h^2}{6}f''' \): \( O(h^2) \)
\( \dfrac{f(x + h) - 2f(x) + f(x - h)}{h^2} \)\( f''(x) \)\( \frac{h^2}{12}f^{(4)} \): \( O(h^2) \)

(Errors are written as approximation minus exact.) For \( f = e^x \) at \( x = 0 \), \( h = 0.1 \): forward 1.05171 (error 0.052, close to \( h/2 = 0.05 \)), central 1.001668 (error close to \( h^2/6 = 0.00167 \)), second difference 1.000834 (error close to \( h^2/12 = 0.00083 \)).

Boundary value problems on a grid

\( y'' = g(x) \) with \( y(a) \), \( y(b) \) given becomes, at interior nodes,

$$y_{i+1} - 2y_i + y_{i-1} = h^2g_i,$$

a tridiagonal linear system, solved directly (Thomas algorithm) in \( O(N) \) operations.

PDEs on a grid

EquationSchemeUpdateCondition
Laplace \( \nabla^2u = 0 \) (2D, \( \Delta x = \Delta y \))five-point stencil\( u_{i,j} = \tfrac{1}{4}(u_{i+1,j} + u_{i-1,j} + u_{i,j+1} + u_{i,j-1}) \)solve by Jacobi, Gauss–Seidel or over-relaxation
Heat \( u_t = Du_{xx} \)explicit FTCS\( u_i^{n+1} = u_i^n + r(u_{i+1}^n - 2u_i^n + u_{i-1}^n) \), \( r = \frac{D\Delta t}{\Delta x^2} \)stable iff \( r \leq \tfrac{1}{2} \)
HeatCrank–Nicolson (implicit)average of explicit and implicitunconditionally stable, \( O(\Delta t^2, \Delta x^2) \)
Wave \( u_{tt} = c^2u_{xx} \)central in \( t \) and \( x \)leapfrogCourant (CFL): \( \frac{c\Delta t}{\Delta x} \leq 1 \)

The five-point formula is the discrete mean-value property: each interior value is the average of its four neighbours. The FTCS heat scheme has truncation error \( O(\Delta t, \Delta x^2) \), and its stability limit means halving \( \Delta x \) forces a quarter of the time step: this is why explicit diffusion codes are slow on fine grids. The CFL condition says the numerical domain of dependence must contain the physical one: information cannot travel more than one cell per step.

Memory Tricks

Don’t Confuse

ThisvsThat
Bisection: guaranteed, linearNewton: fast (quadratic), may diverge
Secant: last two iterates, order 1.618Regula falsi: keeps a bracket, usually linear
Trapezoid: exact to degree 1, \( O(h^2) \)Simpson: exact to degree 3, \( O(h^4) \), needs even \( n \)
Local error of RK4: \( O(h^5) \)Global error of RK4: \( O(h^4) \)
Forward difference: \( O(h) \)Central difference: \( O(h^2) \)
Explicit FTCS: \( r \leq 1/2 \)Crank–Nicolson, backward Euler: no step-size limit for stability
Interpolation error \( \propto f^{(n+1)}/(n + 1)! \)Quadrature error (Simpson) \( \propto f^{(4)}/180 \)

Common Mistakes

Practice

All questions below are original practice questions written for this page. They are not from any CSIR NET paper.

Level 1: Foundation

  1. What is the order of convergence of Newton–Raphson at a simple root?
  2. For polynomials of what degree is Simpson’s 1/3 rule exact?
  3. What is the stability condition for the explicit (FTCS) scheme for \( u_t = Du_{xx} \)?
Answers
  1. 2 (quadratic).
  2. Up to degree 3 (cubics).
  3. \( r = D\Delta t/\Delta x^2 \leq \tfrac{1}{2} \).

Level 2: Part B Style

Practice Q1. Newton–Raphson is applied to \( f(x) = x^2 - 2 \) starting from \( x_0 = 1 \). The value of \( x_2 \) is:

(a) 1.5 (b) 17/12 (c) 577/408 (d) 4/3

Answer: (b) 17/12

\( x_{n+1} = \tfrac{1}{2}(x_n + 2/x_n) \). \( x_1 = \tfrac{1}{2}(1 + 2) = 3/2 \); \( x_2 = \tfrac{1}{2}\left(\tfrac{3}{2} + \tfrac{4}{3}\right) = \tfrac{17}{12} = 1.41667 \). Option (a) is \( x_1 \) and (c) is \( x_3 = 1.4142157 \).

Practice Q2. Simpson’s 1/3 rule with \( h = 0.25 \) is applied to \( \int_0^1\frac{4\,dx}{1 + x^2} \). The estimate is closest to:

(a) 3.1312 (b) 3.1416 (c) 3.1452 (d) 3.1200

Answer: (b) 3.1416

\( f = 4/(1 + x^2) \) at 0, 0.25, 0.5, 0.75, 1: 4, 3.764706, 3.2, 2.56, 2. \( S = \frac{0.25}{3}[4 + 4(3.764706 + 2.56) + 2(3.2) + 2] = \frac{0.25}{3}(37.69882) = 3.14157 \). Option (a) is the trapezoidal value (3.13118) for the same table.

Practice Q3. For \( y' = x + y \), \( y(0) = 1 \), one step of the classical fourth-order Runge–Kutta method with \( h = 0.1 \) gives \( y(0.1) \) approximately:

(a) 1.1000 (b) 1.1100 (c) 1.1103 (d) 1.1052

Answer: (c) 1.1103

\( k_1 = 1 \), \( k_2 = 1.1 \), \( k_3 = 1.105 \), \( k_4 = 1.2105 \); \( y_1 = 1 + \frac{0.1}{6}(1 + 2.2 + 2.21 + 1.2105) = 1.110342 \). (a) is Euler; (b) is Heun; (d) is \( e^{0.1} \), the answer to a different equation (\( y' = y \)).

Practice Q4. A table of \( f(x) = 2x^3 - x \) is made at equally spaced points with spacing \( h = 0.5 \). The third forward differences are all equal to:

(a) 12 (b) 1.5 (c) 0.75 (d) 6

Answer: (b) 1.5

\( \Delta^3f = a\,3!\,h^3 = 2\times6\times0.125 = 1.5 \). The linear term \( -x \) contributes nothing to third differences. (a) is \( a\cdot3! \), as if \( h = 1 \); (c) drops the leading coefficient \( a = 2 \); (d) drops both \( a \) and \( h \).

Level 3: Part C Style

Practice Q5. The equation \( x^3 - x - 1 = 0 \) has a single real root near 1.3247. Consider:

  1. Three steps of bisection starting from \( [1, 2] \) leave the root bracketed in \( [1.25, 1.375] \).
  2. Newton–Raphson converges only linearly to this root.
  3. About 20 bisection steps from \( [1, 2] \) are needed to bracket the root within \( 10^{-6} \).
  4. The secant method with \( x_0 = 1 \), \( x_1 = 2 \) gives \( x_2 = 7/6 \).

Which are correct?

(a) 1, 3 and 4 only (b) 1 and 2 only (c) 2, 3 and 4 only (d) 1, 2, 3 and 4

Answer: (a) 1, 3 and 4 only
  1. \( f(1.5) = 0.875 > 0 \) gives \( [1, 1.5] \); \( f(1.25) = -0.297 \) gives \( [1.25, 1.5] \); \( f(1.375) = 0.225 \) gives \( [1.25, 1.375] \). True.
  2. The root is simple (\( f' = 3\alpha^2 - 1 \approx 4.26 \neq 0 \)), so convergence is quadratic. False.
  3. \( n \geq \log_2(1/10^{-6}) = 19.93 \), so 20 steps. True.
  4. \( x_2 = 2 - f(2)\frac{2 - 1}{f(2) - f(1)} = 2 - \frac{5}{6} = \frac{7}{6} \). True.

Practice Q6. The heat equation \( u_t = Du_{xx} \) with \( D = 1.0\times10^{-4} \) m²/s is solved by the explicit forward-time, centred-space scheme on a grid with \( \Delta x = 1 \) cm. Consider:

  1. The largest stable time step is 0.5 s.
  2. At \( r = D\Delta t/\Delta x^2 = 1/2 \), the update is \( u_i^{n+1} = \tfrac{1}{3}(u_{i+1}^n + u_i^n + u_{i-1}^n) \).
  3. If \( \Delta x \) is halved, the largest stable time step falls to a quarter.
  4. The Crank–Nicolson scheme for the same problem is subject to the same limit \( r \leq 1/2 \).

Which are correct?

(a) 1, 2 and 3 only (b) 1 and 3 only (c) 1, 3 and 4 only (d) 2 and 4 only

Answer: (b) 1 and 3 only
  1. \( \Delta t \leq 0.5\Delta x^2/D = 0.5\times10^{-4}/10^{-4} = 0.5 \) s. True.
  2. \( u_i^{n+1} = ru_{i+1} + (1 - 2r)u_i + ru_{i-1} \); at \( r = 1/2 \) the middle weight is zero, giving \( \tfrac{1}{2}(u_{i+1} + u_{i-1}) \). False.
  3. \( \Delta t_{\max}\propto\Delta x^2 \). True.
  4. Crank–Nicolson is unconditionally stable. False.

Practice Q7. The derivatives of \( f(x) = e^x \) at \( x = 0 \) are estimated with step \( h = 0.1 \). Consider:

  1. The central-difference estimate of \( f'(0) \) is 1.0017 to four decimal places.
  2. Its error is close to \( h^2/6 \).
  3. Halving \( h \) reduces the error of the forward-difference estimate by a factor of about 4.
  4. The estimate \( [f(h) - 2f(0) + f(-h)]/h^2 \) of \( f''(0) \) is 1.0008 to four decimal places.

Which are correct?

(a) 1, 2 and 4 only (b) 1 and 3 only (c) 2, 3 and 4 only (d) 1, 2, 3 and 4

Answer: (a) 1, 2 and 4 only
  1. \( (e^{0.1} - e^{-0.1})/0.2 = \sinh(0.1)/0.1 = 1.001668 \). True.
  2. \( \sinh h/h - 1 = h^2/6 + h^4/120 + \cdots \approx 0.00167 \). True.
  3. The forward difference is first order: halving \( h \) halves the error (0.0517 to about 0.0254). False.
  4. \( 2(\cosh0.1 - 1)/0.01 = 1.000834 \). True.

Quick Revision Table

IdeaFormula or fact
Bisection steps\( n \geq \log_2[(b - a)/\varepsilon] \)
Newton–Raphson\( x_{n+1} = x_n - f/f' \); \( e_{n+1}\approx\frac{f''}{2f'}e_n^2 \)
Newton, multiple rootlinear, ratio \( (m - 1)/m \)
Secant order\( (1 + \sqrt5)/2 \approx 1.618 \)
Fixed pointconverges if \( \lvert g'(\alpha)\rvert < 1 \)
Interpolation error\( \frac{f^{(n+1)}(\xi)}{(n + 1)!}\prod(x - x_i) \)
Differences of a polynomial\( \Delta^nf = a\,n!\,h^n \)
Trapezoid\( \frac{h}{2}[f_0 + 2\sum f_i + f_n] \), error \( -\frac{(b - a)h^2}{12}f'' \)
Simpson 1/3\( \frac{h}{3}[f_0 + 4\sum_{\text{odd}} + 2\sum_{\text{even}} + f_n] \), error \( -\frac{(b - a)h^4}{180}f^{(4)} \)
Euler\( y_{n+1} = y_n + hf \); order 1; stable for \( h\lambda < 2 \)
RK4\( y_n + \frac{h}{6}(k_1 + 2k_2 + 2k_3 + k_4) \); order 4
Central difference\( [f(x + h) - f(x - h)]/2h \), error \( h^2f'''/6 \)
Second difference\( [f_+ - 2f_0 + f_-]/h^2 \), error \( h^2f^{(4)}/12 \)
FTCS heat\( r = D\Delta t/\Delta x^2 \leq 1/2 \)
CFL (wave)\( c\Delta t/\Delta x \leq 1 \)
Laplace stencilnode = average of four neighbours

Key Takeaways

What’s Next