Professional Documents
Culture Documents
Given an equation in one variable f (x) = 0, • Select two guess values x0 and x1 .
• Calculate f (x0 ) and f ′ (x0 ). where a j is computed using the following table.
3.1 First derivative Assume that f (x) is continuous on [a, b]. Let n be
b−a
Forward difference a positive integer and ∆x = . If [a, b] is di-
n
f (x0 + h) − f (x0 ) vided into n subintervals, each of length ∆x, with
f ′ (x0 ) ≈ endpoints at P = {x0 , x1 , x2 , · · · , xn }, then
h
Backward difference Z b
∆x
′ f (x0 ) − f (x0 − h) f (x) dx ≈ 1 4 2 4 2 ··· 2 4 1
f (x0 ) ≈ a 3
h
Central difference In the Simpson’s rule, n must be an even integer.
f (x0 + h) − f (x0 − h) If n is odd, the last subinterval must be approxi-
f ′ (x0 ) ≈ mated using trapezoidal rule.
2h
6 Differential equations
6.1 Euler method
Given the differential equation dy/dx = f (x, y)
with initial condition f (x0 ) = y0 ,
• k1 = h f (xn , yn )
• yn+1 ≈ yn + k1
• k1 = h f (xn , yn )
h k1
• k2 = h f xn + , yn +
2 2
• yn+1 = yn + k2
• k1 = h f (xn , yn )
h k1
• k2 = h f xn + , yn +
2 2