NUMERICAL FORMULAE Iteration Newton Raphson method for refining an approximate root x0 of f (x) = 0 xn+1 = xn − Particular case to find Secant Method xn+1 = xn − f (xn )/
f (xn ) f 0 (xn )
√ N use xn+1 =
1 2
f (xn ) − f (xn−1 ) xn − xn−1
xn +
Interpolation
∆fn = fn+1 − fn
,
∇fn = fn − fn−1
,
Gregory Newton Formula
δfn = fn+ 12 − fn− 21 1 µfn = fn+ 12 + fn− 12 2
p(p − 1) 2 p fp = f0 + p∆f0 + ∆ f0 + ... + ∆r f0 2! r where p =
x − x0 h
Lagrange’s Formula for n points y=
n X
yi `i (x)
i=1
where `i (x) =
Πnj=1,j6=i (x − xj ) Πnj=1,j6=i (xi − xj )
1
N xn
.
Numerical differentiation Derivatives at a tabular point 1 1 µ δf0 − µ δ 3 f0 + µ δ 5 f0 − ... 6 30 1 4 1 6 2 2 00 h f0 = δ f0 − δ f0 + δ f0 − ... 12 90 1 2 1 3 1 1 0 hf0 = ∆f0 − ∆ f0 + ∆ f0 − ∆4 f0 + ∆5 f0 − ... 2 3 4 5 11 4 5 5 2 00 2 3 h f0 = ∆ f0 − ∆ f0 + ∆ f0 − ∆ f0 + ... 12 6 Numerical Integration hf00
=
Z
Trapezium Rule
where
fi = f (x0 + ih), E = −
x0 +h
f (x)dx '
x0
h (f0 + f1 ) + E 2
h3 00 f (a), x0 < a < x0 + h 12
Composite Trapezium Rule Z
x0 +nh
x0
f (x)dx '
h h2 h4 000 {f0 + 2f1 + 2f2 + ...2fn−1 + fn } − (fn0 − f00 ) + (f − f0000 )... 2 12 720 n where f00 = f 0 (x0 ), fn0 = f 0 (x0 + nh), etc Z
Simpson’s Rule
where
E=−
x0 +2h
f (x)dx '
x0
h5 (4) f (a) 90
h (f0 + 4f1 + f2 ) + E 3
x0 < a < x0 + 2h.
Composite Simpson’s Rule (n even) Z
x0 +nh
x0
where
f (x)dx '
h (f0 + 4f1 + 2f2 + 4f3 + 2f4 + ... + 2fn−2 + 4fn−1 + fn ) + E 3
E=−
2
nh5 (4) f (a). 180
x0 < a < x0 + nh
Gauss order 1. (Midpoint) Z
1
f (x)dx = 2f (0) + E
−1
where
E=
2 00 f (a). 3
−1
Gauss order 2. Z
1 1 f (x)dx = f − √ +f √ +E 3 3 −1 1
where
E=
1 0v f (a). 135
−1
Differential Equations To solve y 0 = f (x, y) given initial condition y0 at x0 , xn = x0 + nh. Euler’s forward method yn+1 = yn + hf (xn , yn )
n = 0, 1, 2, ...
Euler’s backward method yn+1 = yn + hf (xn+1 , yn+1 )
n = 0, 1, 2, ...
Heun’s method (Runge Kutta order 2) yn+1 = yn +
h (f (xn , yn ) + f (xn + h, yn + hf (xn , yn ))). 2
Runge Kutta order 4. yn+1 = yn +
h (K1 + 2K2 + 2K3 + K4 ) 6
where K1
=
K2
=
K3
=
K4
=
f (xn , yn ) hK1 h f xn + , yn + 2 2 hK2 h f xn + , yn + 2 2 f (xn + h, yn + hK3 )
3
Chebyshev Polynomials Tn (x) = cos n(cos−1 x) To (x) = 1
T1 (x) = x
sin n(cos−1 x) Tn0 (x) √ Un−1 (x) = = n 1 − x2 Tm (Tn (x)) = Tmn (x). Tn+1 (x) = 2xTn (x) − Tn−1 (x) Z
Un+1 (x) = Tn (x)dx
2xUn (x) − Un−1 (x) 1 Tn+1 (x) Tn−1 (x) = − + constant, 2 n+1 n−1
f (x) =
where
n≥2
1 a0 T0 (x) + a1 T1 (x)...aj Tj (x) + ... 2
aj =
2 π
Z
π
f (cos θ) cos jθdθ 0
R and f (x)dx = constant +A1 T1 (x) + A2 T2 (x) + ...Aj Tj (x) + ... where Aj = (aj−1 − aj+1 )/2j j≥1
4
j≥0