UPSC Mathematics Optional · Paper II · Methods, Errors & Formulae
Significant figures: digits certain plus one estimated digit.
If \(f(a)f(b)<0\): root in \([a,b]\). Repeatedly bisect. Error after \(n\) steps: \(\dfrac{b-a}{2^{n+1}}\). Linear convergence.
\[x_{n+1}=x_n-\frac{f(x_n)}{f'(x_n)}\]
Quadratic convergence (order 2) near simple roots. Fails if \(f'(x_n)=0\).
Error: \(e_{n+1}\approx\dfrac{f''(\alpha)}{2f'(\alpha)}e_n^2\) where \(\alpha\) is the root.
Secant: \(x_{n+1}=x_n-f(x_n)\dfrac{x_n-x_{n-1}}{f(x_n)-f(x_{n-1})}\). Order \(\approx 1.618\).
Regula Falsi: Like secant but always keep bracket (slower, always converges).
Converges if \(|g'(x)|<1\) near root. Order of convergence = order of first non-zero derivative of \(g-x\).
\(D=\dfrac{1}{h}\ln E=\dfrac{1}{h}\ln(1+\Delta)\) (differential operator in terms of \(\Delta\)).
For equally spaced \(x_0,x_1=x_0+h,\ldots\), point \(x=x_0+ph\):
\[f(x)=f_0+p\Delta f_0+\frac{p(p-1)}{2!}\Delta^2 f_0+\frac{p(p-1)(p-2)}{3!}\Delta^3 f_0+\cdots\]
Use near the beginning of the table.
For \(x=x_n+ph\) (usually \(p\in[-1,0]\)):
\[f(x)=f_n+p\nabla f_n+\frac{p(p+1)}{2!}\nabla^2 f_n+\frac{p(p+1)(p+2)}{3!}\nabla^3 f_n+\cdots\]
Use near the end of the table.
For unevenly spaced points \(x_0,x_1,\ldots,x_n\):
\[f(x)=\sum_{i=0}^n f_i\prod_{j\ne i}\frac{x-x_j}{x_i-x_j}\]
Error: \(\dfrac{(x-x_0)\cdots(x-x_n)}{(n+1)!}f^{(n+1)}(\xi)\) for some \(\xi\).
\(f(x)=f[x_0]+(x-x_0)f[x_0,x_1]+(x-x_0)(x-x_1)f[x_0,x_1,x_2]+\cdots\)
Divided difference: \(f[x_i,x_j]=\dfrac{f[x_j]-f[x_i]}{x_j-x_i}\), recursively.
Used near the middle of the table. More accurate than forward/backward for mid-range.
Stirling: \(f(x_0+ph)\approx f_0+p\mu\delta f_0+\dfrac{p^2}{2!}\delta^2 f_0+\dfrac{p(p^2-1)}{3!}\mu\delta^3 f_0+\cdots\)
Using forward differences at \(x_0\) (step \(h\)):
\[f'(x_0)=\frac{1}{h}\left[\Delta f_0-\frac{\Delta^2 f_0}{2}+\frac{\Delta^3 f_0}{3}-\cdots\right]\]
\[f''(x_0)=\frac{1}{h^2}\left[\Delta^2 f_0-\Delta^3 f_0+\frac{11}{12}\Delta^4 f_0-\cdots\right]\]
Central difference (more accurate): \(f'(x_0)\approx\dfrac{f_1-f_{-1}}{2h}\). \(f''(x_0)\approx\dfrac{f_1-2f_0+f_{-1}}{h^2}\).
Trapezoidal Rule: \(\displaystyle\int_{x_0}^{x_n}f\,dx\approx\frac{h}{2}[f_0+2(f_1+\cdots+f_{n-1})+f_n]\). Error: \(O(h^2)\).
Simpson's \(\frac{1}{3}\) Rule (\(n\) even): \(\displaystyle\int\approx\frac{h}{3}[f_0+4f_1+2f_2+4f_3+\cdots+4f_{n-1}+f_n]\). Error: \(O(h^4)\).
Simpson's \(\frac{3}{8}\) Rule (\(n\) multiple of 3): \(\displaystyle\int\approx\frac{3h}{8}[f_0+3f_1+3f_2+2f_3+3f_4+\cdots+f_n]\). Error: \(O(h^4)\).
Weddle's Rule (6 intervals): \(\displaystyle\int_{x_0}^{x_6}\approx\frac{3h}{10}[f_0+5f_1+f_2+6f_3+f_4+5f_5+f_6]\).
Gaussian Quadrature: \(\displaystyle\int_{-1}^1 f(x)\,dx\approx\sum_i w_i f(x_i)\). More accurate for same number of function evaluations.
For \(y'=f(x,y)\), \(y(x_0)=y_0\): \(y_{n+1}=y_n+hf(x_n,y_n)\). Error \(O(h)\). Low accuracy.
Modified Euler (Heun): Predictor: \(y^*=y_n+hf_n\). Corrector: \(y_{n+1}=y_n+\dfrac{h}{2}[f_n+f(x_{n+1},y^*)]\). Error \(O(h^2)\).
\[k_1=hf(x_n,y_n),\quad k_2=hf\!\left(x_n+\tfrac{h}{2},y_n+\tfrac{k_1}{2}\right)\]
\[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)\]
\[y_{n+1}=y_n+\frac{1}{6}(k_1+2k_2+2k_3+k_4)\]
Error \(O(h^4)\). Gold standard for hand calculations.
Predictor: \(y_{n+1}^p=y_{n-3}+\dfrac{4h}{3}(2f_n-f_{n-1}+2f_{n-2})\)
Corrector: \(y_{n+1}=y_{n-1}+\dfrac{h}{3}(f_{n+1}^p+4f_n+f_{n-1})\)
Needs 4 starting values (use RK4 to start).
For \(a_{11}x_1+a_{12}x_2+a_{13}x_3=b_1\), etc.: update each \(x_i\) using the latest values of other variables.
\[x_i^{(k+1)}=\frac{1}{a_{ii}}\left(b_i-\sum_{ji}a_{ij}x_j^{(k)}\right)\]
Converges if matrix is strictly diagonally dominant (\(|a_{ii}|>\sum_{j\ne i}|a_{ij}|\)).
Gauss-Seidel converges faster than Jacobi (uses updated values immediately).
Forward elimination → upper triangular → back substitution. \(O(n^3/3)\) operations.
LU: \(A=LU\) where \(L\) = lower triangular (1's on diagonal), \(U\) = upper triangular. Solve \(L\mathbf{y}=\mathbf{b}\), then \(U\mathbf{x}=\mathbf{y}\).
Cholesky: For symmetric positive definite: \(A=LL^T\). Saves half the work.