← Back to notes

October 10, 2026

Numerical Analysis

numerical analysismath

Syllabus:

Interpolation: Lagrangian Interpolating Formula, Divided Differences and Their Properties, Newton's Fundamental Interpolation Formula, Finite Differences, Forward Differences, Backward Differences, relation between Forward and Backward Differences, Newton's Forward Difference Interpolation Formula.

Solution of Equations: Method of Bisections, Regula-Falsi Method, Newton-Raphson's Method.

Linear Equation: Gauss Elimination Method, Cholesky's Method, Gauss-Seidel Method, Method of Relaxation.

Ordinary Differential Equations: Euler's Method, Single Step Method, Runge-Kutta Method, Milne-Simpson Method.

In this notes, we'll cover -
Part 1. Interpolation

  • Lagrange Interpolating Formula
  • Divided Differences and Their Properties
  • Newton's Divided Difference Formula
  • Finite Differences (Forward, Backward)
  • Relation Between Forward and Backward Differences
  • Newton's Forward Difference Formula

Part 2. Solution of Equations

  • Bisection Method
  • Regula-Falsi Method
  • Newton-Raphson Method

Part 3. Systems of Linear Equations

  • Gauss Elimination
  • Cholesky's Method
  • Gauss-Seidel Method
  • Method of Relaxation

Part 4. Ordinary Differential Equations

  • Euler's Method
  • Single-Step Methods
  • Runge-Kutta Method
  • Milne-Simpson Method

Part 1. Interpolation

The Interpolation Problem

Definition 1. Interpolation:
Let y=f(x)y = f(x) be a function, and suppose the values of ff are known at distinct points
x0, x1, …, xnx_0,\ x_1,\ \ldots,\ x_n
as y0=f(x0), y1=f(x1), …, yn=f(xn)y_0 = f(x_0),\ y_1 = f(x_1),\ \ldots,\ y_n = f(x_n).

Interpolation means finding an approximate value of f(x)f(x) at some intermediate point xx lying between x0x_0 and xnx_n, by constructing a polynomial (or other simple function) that passes through the given data points.

The polynomial P(x)P(x) of degree at most nn satisfying
P(xi)=yi(i=0,1,…,n)P(x_i) = y_i \quad (i = 0,1,\ldots,n)
is called an interpolating polynomial.

Fig 1.1Interpolation — curve through given points
Unknown f(x)Interpolating polynomial P(x)Data points (xᵢ, yᵢ)

Lagrange Interpolating Formula

Definition 2. Lagrange Fundamental Polynomials:
Given distinct nodes x0,x1,…,xnx_0, x_1, \ldots, x_n, the ii-th Lagrange basis polynomial is

ℓi(x)=∏j=0j≠inx−xjxi−xj=(x−x0)⋯(x−xi−1)(x−xi+1)⋯(x−xn)(xi−x0)⋯(xi−xi−1)(xi−xi+1)⋯(xi−xn).\ell_i(x) = \prod_{\substack{j=0 \\ j \neq i}}^{n} \frac{x - x_j}{x_i - x_j} = \frac{(x-x_0)\cdots(x-x_{i-1})(x-x_{i+1})\cdots(x-x_n)}{(x_i-x_0)\cdots(x_i-x_{i-1})(x_i-x_{i+1})\cdots(x_i-x_n)}.

Clearly ℓi(xk)=0\ell_i(x_k) = 0 if k≠ik \neq i, and ℓi(xi)=1\ell_i(x_i) = 1.

Theorem 1 (Lagrange Interpolation Formula)

Let yi=f(xi)y_i = f(x_i) be given at (n+1)(n+1) distinct points x0,x1,…,xnx_0, x_1, \ldots, x_n. Then there exists a unique polynomial Pn(x)P_n(x) of degree at most nn such that Pn(xi)=yiP_n(x_i) = y_i for each ii, and

Pn(x)=∑i=0nyi ℓi(x)=∑i=0nyi∏j=0j≠inx−xjxi−xj.P_n(x) = \sum_{i=0}^{n} y_i\,\ell_i(x) = \sum_{i=0}^{n} y_i \prod_{\substack{j=0 \\ j \neq i}}^{n} \frac{x - x_j}{x_i - x_j}.

Proof:

Let the data (xi,yi)(x_i, y_i), i=0,1,…,ni = 0,1,\ldots,n, be given, with all xix_i distinct.
Define
Pn(x)=∑i=0nyi ℓi(x).P_n(x) = \sum_{i=0}^{n} y_i\,\ell_i(x).

Step 1. Degree of PnP_n.
Each ℓi(x)\ell_i(x) is a product of nn linear factors, so deg⁡(ℓi)=n\deg(\ell_i) = n.
Hence PnP_n is a polynomial of degree at most nn.

Step 2. Interpolation conditions.
For a fixed index kk,
Pn(xk)=∑i=0nyi ℓi(xk)=yk ℓk(xk)=yk⋅1=yk,P_n(x_k) = \sum_{i=0}^{n} y_i\,\ell_i(x_k) = y_k\,\ell_k(x_k) = y_k \cdot 1 = y_k,
since ℓi(xk)=0\ell_i(x_k) = 0 for i≠ki \neq k.
Thus Pn(xi)=yiP_n(x_i) = y_i for all ii.

Step 3. Uniqueness.
Suppose Qn(x)Q_n(x) is another polynomial of degree at most nn with Qn(xi)=yiQ_n(x_i) = y_i.
Then R(x)=Pn(x)−Qn(x)R(x) = P_n(x) - Q_n(x) has degree at most nn and has (n+1)(n+1) roots x0,…,xnx_0,\ldots,x_n.
A nonzero polynomial of degree ≤n\leq n cannot have more than nn roots.
Hence R≡0R \equiv 0, so Pn=QnP_n = Q_n.

Therefore the Lagrange formula gives the unique interpolating polynomial of degree ≤n\leq n.

Error term (statement): If ff is (n+1)(n+1) times continuously differentiable, then for some ξ\xi between the smallest and largest of x,x0,…,xnx, x_0, \ldots, x_n,

f(x)−Pn(x)=f(n+1)(ξ)(n+1)! (x−x0)(x−x1)⋯(x−xn).f(x) - P_n(x) = \frac{f^{(n+1)}(\xi)}{(n+1)!}\,(x-x_0)(x-x_1)\cdots(x-x_n).

E.g., Find P(x)P(x) through (0,1)(0,1), (1,3)(1,3), (2,7)(2,7).

P(x)=1⋅(x−1)(x−2)(0−1)(0−2)+3⋅(x−0)(x−2)(1−0)(1−2)+7⋅(x−0)(x−1)(2−0)(2−1)=12(x−1)(x−2)−3x(x−2)+72x(x−1).P(x) = 1\cdot\frac{(x-1)(x-2)}{(0-1)(0-2)} + 3\cdot\frac{(x-0)(x-2)}{(1-0)(1-2)} + 7\cdot\frac{(x-0)(x-1)}{(2-0)(2-1)} = \tfrac{1}{2}(x-1)(x-2) - 3x(x-2) + \tfrac{7}{2}x(x-1).

Divided Differences

Definition 3. Divided Differences:
Let yi=f(xi)y_i = f(x_i). The zeroth divided difference is
f[xi]=yi.f[x_i] = y_i.

The first divided difference is
f[xi,xi+1]=f[xi+1]−f[xi]xi+1−xi=yi+1−yixi+1−xi.f[x_i, x_{i+1}] = \frac{f[x_{i+1}] - f[x_i]}{x_{i+1} - x_i} = \frac{y_{i+1} - y_i}{x_{i+1} - x_i}.

The second divided difference is

f[xi,xi+1,xi+2]=f[xi+1,xi+2]−f[xi,xi+1]xi+2−xi.f[x_i, x_{i+1}, x_{i+2}] = \frac{f[x_{i+1}, x_{i+2}] - f[x_i, x_{i+1}]}{x_{i+2} - x_i}.

In general,

f[xi,xi+1,…,xi+k]=f[xi+1,…,xi+k]−f[xi,…,xi+k−1]xi+k−xi.f[x_i, x_{i+1}, \ldots, x_{i+k}] = \frac{f[x_{i+1},\ldots,x_{i+k}] - f[x_i,\ldots,x_{i+k-1}]}{x_{i+k} - x_i}.

Theorem 2 (Properties of Divided Differences)

(i) Divided differences are symmetric in their arguments: the value of f[x0,x1,…,xk]f[x_0,x_1,\ldots,x_k] does not depend on the order of x0,…,xkx_0,\ldots,x_k.
(ii) If ff is a polynomial of degree mm, then the (m+1)(m+1)-th and higher divided differences vanish.
(iii) (Mean value form) If f(k)f^{(k)} exists, then
f[x0,x1,…,xk]=f(k)(ξ)k!f[x_0,x_1,\ldots,x_k] = \frac{f^{(k)}(\xi)}{k!}
for some ξ\xi in the interval containing x0,…,xkx_0,\ldots,x_k.

Proof of (i) (sketch):
One shows by induction that

f[x0,…,xk]=∑i=0kyi∏j≠i(xi−xj),f[x_0,\ldots,x_k] = \sum_{i=0}^{k} \frac{y_i}{\prod_{j\neq i}(x_i - x_j)},

which is visibly symmetric in the xx's (and yy's attached to them).

Proof of (ii):
If deg⁡(f)=m\deg(f) = m, then f(m+1)≡0f^{(m+1)} \equiv 0. By (iii), the (m+1)(m+1)-th divided difference is zero.

Newton's Divided Difference Formula

Theorem 3 (Newton's Fundamental / Divided Difference Formula)

The unique interpolating polynomial of degree at most nn may be written as

Pn(x)=f[x0]+f[x0,x1](x−x0)+f[x0,x1,x2](x−x0)(x−x1)+⋯+f[x0,…,xn](x−x0)⋯(x−xn−1).P_n(x) = f[x_0] + f[x_0,x_1](x-x_0) + f[x_0,x_1,x_2](x-x_0)(x-x_1) \quad + \cdots + f[x_0,\ldots,x_n](x-x_0)\cdots(x-x_{n-1}).

Proof:

Let Pn(x)P_n(x) be the interpolating polynomial. Write it in the Newton form

Pn(x)=a0+a1(x−x0)+a2(x−x0)(x−x1)+⋯+an(x−x0)⋯(x−xn−1).P_n(x) = a_0 + a_1(x-x_0) + a_2(x-x_0)(x-x_1) + \cdots + a_n(x-x_0)\cdots(x-x_{n-1}).

Putting x=x0x = x_0: Pn(x0)=a0=y0=f[x0]P_n(x_0) = a_0 = y_0 = f[x_0].

Putting x=x1x = x_1:
y1=a0+a1(x1−x0)  ⟹  a1=y1−y0x1−x0=f[x0,x1].y_1 = a_0 + a_1(x_1-x_0) \implies a_1 = \frac{y_1-y_0}{x_1-x_0} = f[x_0,x_1].

Continuing inductively, one finds ak=f[x0,x1,…,xk]a_k = f[x_0,x_1,\ldots,x_k].

Hence Newton's divided difference formula holds.
(It agrees with Lagrange at the nodes, so by uniqueness it is the interpolating polynomial.)

Finite Differences

Assumption: Nodes are equally spaced: xi=x0+ihx_i = x_0 + ih, i=0,1,2,…i = 0,1,2,\ldots, with step h>0h > 0. Write yi=f(xi)y_i = f(x_i).

Definition 4. Forward Difference Operator Δ\Delta:
Δyi=yi+1−yi.\Delta y_i = y_{i+1} - y_i.
Higher differences:
Δ2yi=Δ(Δyi)=Δyi+1−Δyi=yi+2−2yi+1+yi,\Delta^2 y_i = \Delta(\Delta y_i) = \Delta y_{i+1} - \Delta y_i = y_{i+2} - 2y_{i+1} + y_i,
and in general
Δkyi=Δk−1yi+1−Δk−1yi.\Delta^{k} y_i = \Delta^{k-1} y_{i+1} - \Delta^{k-1} y_i.

Definition 5. Backward Difference Operator ∇\nabla:
∇yi=yi−yi−1.\nabla y_i = y_i - y_{i-1}.
Higher: ∇2yi=∇yi−∇yi−1\nabla^2 y_i = \nabla y_i - \nabla y_{i-1}, and so on.

Definition 6. Shift Operator EE:
Eyi=yi+1,Ekyi=yi+k.E y_i = y_{i+1}, \qquad E^k y_i = y_{i+k}.

Fig 1.2Forward difference table (schematic)
y valuesΔyΔ²y

Theorem 4 (Operator Relations)

The operators EE, Δ\Delta, and ∇\nabla are related by
E=1+Δ,∇=1−E−1,Δ=E∇=∇E.E = 1 + \Delta, \qquad \nabla = 1 - E^{-1}, \qquad \Delta = E\nabla = \nabla E.
Also,
Δnyi=∇nyi+n.\Delta^n y_i = \nabla^n y_{i+n}.

Proof:

Eyi=yi+1=yi+(yi+1−yi)=yi+Δyi=(1+Δ)yiE y_i = y_{i+1} = y_i + (y_{i+1}-y_i) = y_i + \Delta y_i = (1+\Delta)y_i.
Hence E=1+ΔE = 1 + \Delta.

Further, ∇yi+1=yi+1−yi=Δyi\nabla y_{i+1} = y_{i+1} - y_i = \Delta y_i, so Δyi=∇yi+1=∇Eyi\Delta y_i = \nabla y_{i+1} = \nabla E y_i, giving Δ=∇E\Delta = \nabla E.
Similarly Δ=E∇\Delta = E\nabla.

Finally, Δyi=yi+1−yi=∇yi+1\Delta y_i = y_{i+1}-y_i = \nabla y_{i+1}, and by induction Δnyi=∇nyi+n\Delta^n y_i = \nabla^n y_{i+n}.

Theorem 5 (Relation Between Forward and Backward Differences)

At a fixed tabular point,
Δny0=∇nyn,\Delta^n y_0 = \nabla^n y_n,
and more generally the forward differences starting at yiy_i equal the backward differences ending at yi+ny_{i+n}.

Proof:
This is the special case i=0i = 0 of Δnyi=∇nyi+n\Delta^n y_i = \nabla^n y_{i+n} from Theorem 4.

Newton's Forward Difference Formula

Theorem 6 (Newton-Gregory Forward Difference Formula)

Let x=x0+uhx = x_0 + uh, where u=x−x0hu = \dfrac{x-x_0}{h}. Then the interpolating polynomial is

Pn(x)=y0+u Δy0+u(u−1)2! Δ2y0+u(u−1)(u−2)3! Δ3y0+⋯+u(u−1)⋯(u−n+1)n! Δny0.P_n(x) = y_0 + u\,\Delta y_0 + \frac{u(u-1)}{2!}\,\Delta^2 y_0 + \frac{u(u-1)(u-2)}{3!}\,\Delta^3 y_0 \quad + \cdots + \frac{u(u-1)\cdots(u-n+1)}{n!}\,\Delta^n y_0.

Proof:

Start from Newton's divided difference formula with equal spacing xi=x0+ihx_i = x_0 + ih.

One shows that
f[x0,x1,…,xk]=Δky0k! hk.f[x_0,x_1,\ldots,x_k] = \frac{\Delta^k y_0}{k!\, h^k}.

Also
(x−x0)(x−x1)⋯(x−xk−1)=hk u(u−1)⋯(u−k+1).(x-x_0)(x-x_1)\cdots(x-x_{k-1}) = h^k\, u(u-1)\cdots(u-k+1).

Substituting these into the divided difference formula yields Newton's forward formula.

When to use: Prefer this formula when xx lies near the beginning of the table (small uu).

Newton's backward formula (for reference): With u=x−xnhu = \dfrac{x-x_n}{h} and backward differences at yny_n,

P(x)=yn+u ∇yn+u(u+1)2! ∇2yn+⋯ .P(x) = y_n + u\,\nabla y_n + \frac{u(u+1)}{2!}\,\nabla^2 y_n + \cdots.

Prefer when xx is near the end of the table.


Part 2. Solution of Equations

We seek a root of f(x)=0f(x) = 0, where ff is continuous (and, for Newton-Raphson, differentiable).

Bisection Method

Idea: If f(a)f(a) and f(b)f(b) have opposite signs, then by the Intermediate Value Theorem there is at least one root in (a,b)(a,b). Repeatedly bisect the interval and keep the half where the sign change persists.

Theorem 7 (Bisection Method — Algorithm and Convergence)

Let ff be continuous on [a,b][a,b] with f(a)f(b)<0f(a)f(b) < 0. Define

x0=a,x1=b,xn+1=xn(L)+xn(R)2,x_0 = a,\quad x_1 = b, \qquad x_{n+1} = \frac{x_n^{(L)} + x_n^{(R)}}{2},

where [xn(L),xn(R)][x_n^{(L)}, x_n^{(R)}] is the current bracket containing a sign change. Then the sequence of midpoints converges to a root ξ∈(a,b)\xi \in (a,b), and after nn steps
∣xn−ξ∣≤b−a2n.|x_n - \xi| \leq \frac{b-a}{2^n}.

Proof / Derivation:

Let ff be continuous on [a,b][a,b] with f(a)f(b)<0f(a)f(b) < 0.
By IVT, there exists ξ∈(a,b)\xi \in (a,b) with f(ξ)=0f(\xi) = 0.

Algorithm (one step):
Set c=a+b2c = \dfrac{a+b}{2}.

  • If f(c)=0f(c) = 0, stop; cc is a root.
  • If f(a)f(c)<0f(a)f(c) < 0, replace bb by cc.
  • If f(c)f(b)<0f(c)f(b) < 0, replace aa by cc.

The new interval still contains a root and has length half of the previous one.

After nn bisections, the interval length is b−a2n\dfrac{b-a}{2^n}.
Any point xnx_n of the current interval (in particular the midpoint) satisfies
∣xn−ξ∣≤b−a2n.|x_n - \xi| \leq \frac{b-a}{2^n}.
Hence xn→ξx_n \to \xi as n→∞n \to \infty.

Rate: Linear convergence (error roughly halves each time). Guaranteed, but slow.

Fig 2.1Bisection method
y = f(x)Current bracket [a,b]Midpoint c

E.g., Solve x3−x−1=0x^3 - x - 1 = 0 on [1,2][1,2].
f(1)=−1<0f(1) = -1 < 0, f(2)=5>0f(2) = 5 > 0.
c1=1.5c_1 = 1.5, f(1.5)=0.875>0f(1.5) = 0.875 > 0 →\to new interval [1,1.5][1, 1.5].
Continue until the required accuracy.

Regula-Falsi Method (Method of False Position)

Idea: Instead of the midpoint, take the point where the chord joining (a,f(a))(a,f(a)) and (b,f(b))(b,f(b)) meets the xx-axis.

Theorem 8 (Regula-Falsi Formula)

Derivation:

Let ff be continuous on [a,b][a,b] with f(a)f(b)<0f(a)f(b) < 0.
The equation of the chord through (a,f(a))(a,f(a)) and (b,f(b))(b,f(b)) is

y−f(a)x−a=f(b)−f(a)b−a.\frac{y - f(a)}{x - a} = \frac{f(b) - f(a)}{b - a}.

Set y=0y = 0 to find the intercept x1x_1:

−f(a)x1−a=f(b)−f(a)b−a  ⟹  x1=a−f(a)(b−a)f(b)−f(a)=af(b)−bf(a)f(b)−f(a).-\frac{f(a)}{x_1 - a} = \frac{f(b) - f(a)}{b - a} \implies x_1 = a - \frac{f(a)(b-a)}{f(b)-f(a)} = \frac{af(b) - bf(a)}{f(b)-f(a)}.

If f(a)f(x1)<0f(a)f(x_1) < 0, set b:=x1b := x_1; else set a:=x1a := x_1. Repeat.

Note: Convergence is usually faster than bisection, but one endpoint may stay fixed for many iterations (linear convergence still).

Fig 2.2Regula-Falsi (false position)
y = f(x)ChordFalse-position root x₁

Newton-Raphson Method

Idea: Replace ff near xnx_n by its tangent line; take the next iterate as the root of the tangent.

Theorem 9 (Newton-Raphson Formula)

Let ff be continuously differentiable and f′(x)≠0f'(x) \neq 0 near a root. The Newton-Raphson iteration is

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

If f(ξ)=0f(\xi)=0, f′(ξ)≠0f'(\xi)\neq 0, and f′′f'' is continuous near ξ\xi, then for x0x_0 sufficiently close to ξ\xi the method converges quadratically:

∣xn+1−ξ∣∣xn−ξ∣2=∣f′′(ξ)∣2∣f′(ξ)∣.\frac{|x_{n+1}-\xi|}{|x_n-\xi|^2} = \frac{|f''(\xi)|}{2|f'(\xi)|}.

Derivation:

Let xnx_n be an approximation to the root.
The tangent to y=f(x)y = f(x) at xnx_n is
y−f(xn)=f′(xn) (x−xn).y - f(x_n) = f'(x_n)\,(x - x_n).
It meets the xx-axis where y=0y = 0:

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

Geometric meaning: Each step follows the tangent down (or up) to the axis.

Caution: Fails or diverges if f′(xn)≈0f'(x_n) \approx 0, or if x0x_0 is poorly chosen. For multiple roots, convergence drops to linear unless a modified formula is used.

Fig 2.3Newton-Raphson method
y = f(x)Tangent at xₙNext iterate xₙ₊₁

E.g., Find 2\sqrt{2} by solving f(x)=x2−2=0f(x) = x^2 - 2 = 0.
xn+1=xn−xn2−22xn=12(xn+2xn).x_{n+1} = x_n - \frac{x_n^2-2}{2x_n} = \frac{1}{2}\left(x_n + \frac{2}{x_n}\right).
With x0=1.5x_0 = 1.5: x1=1.4167x_1 = 1.4167, x2=1.4142x_2 = 1.4142, … (rapid convergence).


Part 3. Systems of Linear Equations

We solve Ax=bA\mathbf{x} = \mathbf{b}, where AA is an n×nn\times n nonsingular matrix.

Gauss Elimination Method

Definition 7. Gauss Elimination:
A direct method that reduces AA to upper triangular form by elementary row operations, then solves by back substitution.

Algorithm:

Step 1 (Forward elimination). For k=1,2,…,n−1k = 1,2,\ldots,n-1:
Assume akk≠0a_{kk} \neq 0 (pivot). For each row i=k+1,…,ni = k+1,\ldots,n, set
ℓik=aikakk,\ell_{ik} = \frac{a_{ik}}{a_{kk}},
and replace row ii by
rowi←rowi−ℓik⋅rowk\text{row}_i \leftarrow \text{row}_i - \ell_{ik}\cdot\text{row}_k
(including the right-hand side bib_i).

Step 2 (Back substitution). The system is now Ux=cU\mathbf{x} = \mathbf{c} with UU upper triangular.

xn=cnunn,xi=1uii(ci−∑j=i+1nuijxj)(i=n−1,…,1).x_n = \frac{c_n}{u_{nn}},\qquad x_i = \frac{1}{u_{ii}}\left(c_i - \sum_{j=i+1}^{n} u_{ij}x_j\right) \quad (i = n-1,\ldots,1).

Partial pivoting: If ∣akk∣|a_{kk}| is small, swap row kk with the row below it that has the largest ∣aik∣|a_{ik}| in column kk. This improves numerical stability.

E.g., Solve

2x+y−z=8,−3x−y+2z=−11,−2x+y+2z=−3.2x + y - z = 8, -3x - y + 2z = -11, -2x + y + 2z = -3.

Eliminate xx from rows 2,3 using multipliers ℓ21=−3/2\ell_{21} = -3/2, ℓ31=−1\ell_{31} = -1; continue to triangular form; back-substitute.

Cholesky's Method

Definition 8. Cholesky Decomposition:
If AA is symmetric positive definite, then there exists a unique lower triangular matrix LL with positive diagonal entries such that
A=LLT.A = L L^{T}.
(Sometimes written A=LDLTA = L D L^{T} with DD diagonal.)

Algorithm (compute L=(ℓij)L = (\ell_{ij})):
For i=1,…,ni = 1,\ldots,n:

ℓii=aii−∑k=1i−1ℓik2,ℓji=1ℓii(aji−∑k=1i−1ℓjkℓik)(j=i+1,…,n).\begin{aligned} \ell_{ii} &= \sqrt{a_{ii} - \sum_{k=1}^{i-1} \ell_{ik}^2}, \\ \ell_{ji} &= \frac{1}{\ell_{ii}}\left(a_{ji} - \sum_{k=1}^{i-1} \ell_{jk}\ell_{ik}\right) \quad (j = i+1,\ldots,n). \end{aligned}

Then solve Ly=bL\mathbf{y} = \mathbf{b} (forward substitution) and LTx=yL^{T}\mathbf{x} = \mathbf{y} (back substitution).

Advantage: Roughly half the work of Gauss elimination when AA is SPD; numerically stable.

Gauss-Seidel Method

Definition 9. Iterative Methods:
Write A=L∗+D+U∗A = L_* + D + U_* (strictly lower + diagonal + strictly upper).
Gauss-Seidel updates unknowns in place, using the newest values as soon as they are available:

xi(k+1)=1aii(bi−∑j=1i−1aijxj(k+1)−∑j=i+1naijxj(k)),i=1,…,n.x_i^{(k+1)} = \frac{1}{a_{ii}}\left( b_i - \sum_{j=1}^{i-1} a_{ij}x_j^{(k+1)} - \sum_{j=i+1}^{n} a_{ij}x_j^{(k)} \right), \quad i = 1,\ldots,n.

In matrix form:
(D+L∗)x(k+1)=b−U∗x(k).(D+L_*)\mathbf{x}^{(k+1)} = \mathbf{b} - U_*\mathbf{x}^{(k)}.

Theorem 10 (Sufficient Condition)

If AA is strictly diagonally dominant, or symmetric positive definite, then the Gauss-Seidel iteration converges for any initial vector x(0)\mathbf{x}^{(0)}.

Remark: Gauss-Seidel usually converges faster than Jacobi (which uses only old values in a full sweep).

Method of Relaxation

Definition 10. Successive Over-Relaxation (SOR):
Accelerate Gauss-Seidel by extrapolating with a relaxation factor ω\omega:

xi(k+1)=(1−ω) xi(k)+ω x^i(k+1),x_i^{(k+1)} = (1-\omega)\,x_i^{(k)} + \omega\,\hat{x}_i^{(k+1)},

where x^i(k+1)\hat{x}_i^{(k+1)} is the Gauss-Seidel update for component ii.

  • ω=1\omega = 1: ordinary Gauss-Seidel.
  • 0<ω<10 < \omega < 1: under-relaxation (may stabilize divergent processes).
  • 1<ω<21 < \omega < 2: over-relaxation (often faster when it converges).

Choosing ω\omega: For many structured SPD systems there is an optimal ω∈(1,2)\omega \in (1,2); in exams one often takes a given ω\omega (e.g. 1.21.2) and iterates until consecutive approximations agree to the required tolerance.


Part 4. Ordinary Differential Equations

We consider the IVP

dydx=f(x,y),y(x0)=y0.\frac{dy}{dx} = f(x,y), \qquad y(x_0) = y_0.

A numerical method produces values yn≈y(xn)y_n \approx y(x_n) at xn=x0+nhx_n = x_0 + nh.

Euler's Method

Theorem 11 (Euler's Method)

The Euler step is

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

Geometrically: advance along the tangent to the solution curve at (xn,yn)(x_n,y_n).
Local truncation error is O(h2)O(h^2); global error is O(h)O(h) (first-order method).

Derivation:

By Taylor's theorem,

y(xn+h)=y(xn)+h y′(xn)+h22y′′(ξ)=y(xn)+h f(xn,y(xn))+O(h2).y(x_n+h) = y(x_n) + h\, y'(x_n) + \frac{h^2}{2}y''(\xi) = y(x_n) + h\, f\big(x_n,y(x_n)\big) + O(h^2).

Dropping the O(h2)O(h^2) term and replacing y(xn)y(x_n) by yny_n gives Euler's formula.

Fig 4.1Euler's method — tangent steps
True solution y(x)Euler polygonal pathTangent segments

E.g., y′=x+yy' = x + y, y(0)=1y(0) = 1, h=0.1h = 0.1.
y1=1+0.1(0+1)=1.1y_1 = 1 + 0.1(0+1) = 1.1,
y2=1.1+0.1(0.1+1.1)=1.22y_2 = 1.1 + 0.1(0.1+1.1) = 1.22, and so on.

Single-Step Methods

Definition 11. Single-Step Method:
A method that computes yn+1y_{n+1} using only the data at the current point (xn,yn)(x_n, y_n) (and evaluations of ff between xnx_n and xn+1x_{n+1}).

Euler and classical Runge-Kutta are single-step.
Multistep methods (e.g. Milne-Simpson) use several previous points yn,yn−1,…y_n, y_{n-1}, \ldots.

Modified Euler / Heun (improved Euler):

k1=f(xn,yn),k2=f(xn+h, yn+hk1),yn+1=yn+h2(k1+k2).k_1 = f(x_n, y_n), k_2 = f(x_n+h,\ y_n + h k_1), y_{n+1} = y_n + \frac{h}{2}(k_1 + k_2).

This is a second-order single-step method (average of slopes at the ends).

Runge-Kutta Method

Theorem 12 (Classical 4th-Order Runge-Kutta)

The RK4 formulae are

k1=f(xn, yn),k2=f ⁣(xn+h2, yn+h2k1),k3=f ⁣(xn+h2, yn+h2k2),k4=f(xn+h, yn+hk3),yn+1=yn+h6(k1+2k2+2k3+k4).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+h k_3), y_{n+1} = y_n + \frac{h}{6}\big(k_1 + 2k_2 + 2k_3 + k_4\big).

Local truncation error is O(h5)O(h^5); the method is of order 44.

Idea: Weighted average of four slope estimates in [xn,xn+h][x_n, x_n+h] — one at the left, two at the midpoint, one at the right — chosen so that the Taylor expansions match through order h4h^4.

Why popular in exams: One formula, no need for higher derivatives of ff, good accuracy for moderate hh.

Fig 4.2Runge-Kutta — four slope samples in one step
Solution curvek₁, k₄ (end slopes)k₂, k₃ (mid slopes)

Milne-Simpson Method

Definition 12. Predictor-Corrector (Milne-Simpson):
A multistep method using four previous points.

Milne's predictor (Adams-Bashforth type / Milne):

yn+1(p)=yn−3+4h3(fn+fn−1+fn−2)(one common exam form uses)y_{n+1}^{(p)} = y_{n-3} + \frac{4h}{3}\big( f_n + f_{n-1} + f_{n-2} \big) \quad\text{(one common exam form uses)} yn+1(p)=yn−3+4h3(2fn−fn−1+2fn−2).y_{n+1}^{(p)} = y_{n-3} + \frac{4h}{3}\big(2f_n - f_{n-1} + 2f_{n-2}\big).

(Use the form prescribed in your textbook; both appear in Indian UG books.)

Simpson's corrector:

yn+1(c)=yn−1+h3(fn+1(p)+4fn+fn−1),y_{n+1}^{(c)} = y_{n-1} + \frac{h}{3}\big( f_{n+1}^{(p)} + 4f_n + f_{n-1} \big),

where fn+1(p)=f(xn+1, yn+1(p))f_{n+1}^{(p)} = f\big(x_{n+1},\, y_{n+1}^{(p)}\big).
One may iterate the corrector until successive values agree.

Starting values: Milne-Simpson needs y0,y1,y2,y3y_0, y_1, y_2, y_3. Compute the first few steps by a single-step method (e.g. RK4), then switch to Milne-Simpson.

Order: The corrector is related to Simpson's rule; the method is of order 44 when used carefully.


Worked Numerical Patterns (Exam Style)

Pattern A — Lagrange (5–7 marks)

Q. Use Lagrange's formula to find f(1.5)f(1.5) given f(1)=1f(1)=1, f(2)=8f(2)=8, f(3)=27f(3)=27 (for f(x)=x3f(x)=x^3).

Solution.
Here x0=1x_0=1, x1=2x_1=2, x2=3x_2=3, y0=1y_0=1, y1=8y_1=8, y2=27y_2=27, and x=1.5x=1.5.

P(1.5)=1⋅(1.5−2)(1.5−3)(1−2)(1−3)+8⋅(1.5−1)(1.5−3)(2−1)(2−3)+27⋅(1.5−1)(1.5−2)(3−1)(3−2)=1⋅(−0.5)(−1.5)(−1)(−2)+8⋅(0.5)(−1.5)(1)(−1)+27⋅(0.5)(−0.5)(2)(1)=0.375+6−3.375=3.P(1.5) = 1\cdot\frac{(1.5-2)(1.5-3)}{(1-2)(1-3)} + 8\cdot\frac{(1.5-1)(1.5-3)}{(2-1)(2-3)} + 27\cdot\frac{(1.5-1)(1.5-2)}{(3-1)(3-2)} = 1\cdot\frac{(-0.5)(-1.5)}{(-1)(-2)} + 8\cdot\frac{(0.5)(-1.5)}{(1)(-1)} + 27\cdot\frac{(0.5)(-0.5)}{(2)(1)} = 0.375 + 6 - 3.375 = 3.

(True value 1.53=3.3751.5^3 = 3.375; three points of a cubic need not recover the cubic exactly unless four points — here degree ≤2\leq 2 approx.)

Pattern B — Newton-Raphson (5–7 marks)

Q. Find a real root of x3−2x−5=0x^3 - 2x - 5 = 0 correct to 3 decimal places by Newton-Raphson.

Solution.
Let f(x)=x3−2x−5f(x) = x^3 - 2x - 5, f′(x)=3x2−2f'(x) = 3x^2 - 2.
f(2)=−1<0f(2) = -1 < 0, f(3)=16>0f(3) = 16 > 0, so a root lies in (2,3)(2,3). Take x0=2x_0 = 2.

xn+1=xn−xn3−2xn−53xn2−2.x_{n+1} = x_n - \frac{x_n^3 - 2x_n - 5}{3x_n^2 - 2}.

x1=2−−110=2.1x_1 = 2 - \dfrac{-1}{10} = 2.1,
x2=2.1−2.13−4.2−53(2.1)2−2=2.0945…x_2 = 2.1 - \dfrac{2.1^3 - 4.2 - 5}{3(2.1)^2-2} = 2.0945\ldots,
Continue until ∣xn+1−xn∣<0.0005|x_{n+1}-x_n| < 0.0005. Root ≈2.094\approx 2.094.

Pattern C — Euler (5 marks)

Q. Using Euler's method with h=0.2h = 0.2, estimate y(0.4)y(0.4) given y′=y−xy' = y - x, y(0)=2y(0)=2.

Solution.
yn+1=yn+h(yn−xn)y_{n+1} = y_n + h(y_n - x_n).
n=0n=0: x0=0x_0=0, y0=2y_0=2, y1=2+0.2(2−0)=2.4y_1 = 2 + 0.2(2-0) = 2.4.
n=1n=1: x1=0.2x_1=0.2, y2=2.4+0.2(2.4−0.2)=2.84y_2 = 2.4 + 0.2(2.4-0.2) = 2.84.
Hence y(0.4)≈2.84y(0.4) \approx 2.84.


Question Bank

1-Mark Questions

Definitions:

  1. Define interpolation.
  2. Write Lagrange's interpolating formula for n=1n=1 (linear case).
  3. Define first divided difference f[x0,x1]f[x_0,x_1].
  4. Define the forward difference operator Δ\Delta.
  5. Define the backward difference operator ∇\nabla.
  6. Write the relation E=1+ΔE = 1 + \Delta.
  7. State Newton's forward difference formula (up to second difference).
  8. State the formula used in the bisection method.
  9. Write the Regula-Falsi iteration formula.
  10. Write the Newton-Raphson iteration formula.
  11. What is partial pivoting in Gauss elimination?
  12. When can Cholesky decomposition be applied?
  13. Write one iteration formula of the Gauss-Seidel method for a 2×22\times 2 system.
  14. What is the relaxation factor ω\omega in SOR?
  15. Write Euler's formula for y′=f(x,y)y'=f(x,y).
  16. Write the classical RK4 formula for yn+1y_{n+1}.
  17. What is a predictor-corrector method?
  18. Why does Milne-Simpson need starting values?

Short facts:

  1. Order of convergence of Newton-Raphson (simple root).
  2. Error bound after nn bisections on [a,b][a,b].
  3. If ff is a polynomial of degree 33, what is Δ4yi\Delta^4 y_i?
  4. Prefer Newton forward or backward when xx is near the end of the table?
  5. Gauss-Seidel vs Jacobi — which uses updated values within a sweep?

5-Mark Questions

  1. Derive Lagrange's interpolation formula for three points (x0,y0)(x_0,y_0), (x1,y1)(x_1,y_1), (x2,y2)(x_2,y_2).
  2. Prove that divided differences are symmetric in their arguments.
  3. Derive Newton's divided difference formula.
  4. Prove E=1+ΔE = 1 + \Delta and Δnyi=∇nyi+n\Delta^n y_i = \nabla^n y_{i+n}.
  5. Derive Newton's forward difference formula from divided differences.
  6. Describe the bisection method and prove ∣xn−ξ∣≤(b−a)/2n|x_n-\xi| \leq (b-a)/2^n.
  7. Derive the Regula-Falsi formula geometrically.
  8. Derive the Newton-Raphson formula from the tangent line.
  9. Explain Gauss elimination with a 3×33\times 3 example (symbolic or numeric).
  10. Write the algorithm for Cholesky decomposition.
  11. Write Gauss-Seidel iteration for
    a11x+a12y=b1,a21x+a22y=b2.a_{11}x + a_{12}y = b_1,\quad a_{21}x + a_{22}y = b_2.
  12. Explain the method of relaxation (SOR) and the role of ω\omega.
  13. Derive Euler's method from Taylor's theorem.
  14. Write RK4 formulae and explain the meaning of k1,k2,k3,k4k_1,k_2,k_3,k_4.
  15. Explain Milne's predictor and Simpson's corrector.

7 or 8-Mark Questions

  1. State and derive Lagrange's interpolating formula. Hence find f(2.5)f(2.5) from a given table of four values.
  2. Define divided differences. Prove Newton's fundamental formula. Construct a divided difference table and interpolate.
  3. Establish Newton's forward difference formula. Using a difference table, estimate f(x)f(x) near the start of the table.
  4. Compare bisection, Regula-Falsi, and Newton-Raphson (formula, geometry, rate of convergence, limitations).
  5. Find a real root of a given transcendental equation by Newton-Raphson correct to 4 decimal places (full iteration table).
  6. Solve a 3×33\times 3 linear system by Gauss elimination with partial pivoting.
  7. Solve Ax=bA\mathbf{x}=\mathbf{b} by Cholesky's method (given SPD AA).
  8. Perform 3 iterations of Gauss-Seidel for a diagonally dominant system; comment on convergence.
  9. Using Euler's method, tabulate the solution of an IVP up to a given xx; compare briefly with modified Euler.
  10. Apply RK4 for one or two steps to a given IVP; show all kik_i calculations.
  11. Describe the Milne-Simpson predictor-corrector method. Starting from RK4 values, compute one predictor-corrector step.