Numerical Analysis 1
Numerical Analysis 1
1 21TTH1TN
Analytics
1 Taylor expansion
is called remainder.
We need to determine
Zb
I = f (x)dx.
a
Zb
I = f (x)dx = F (b) − F (a).
a
We have
Zb Zb Zb
f (x)dx = P(x)dx + R(x)dx
a a a
Zb n
X Zb
= Ln,i (x)f (xi )dx + R(x)dx.
a i=0 a
n
X
≈ f (xi )ai ,
i=0
Rb
in which ai = Ln,i (x)dx. This formula is called numberical quadrature
a
formula, and the number ai is called weight.
Zb
f (a) + f (b)
f (x)dx = (b − a) · .
2
a
Zb n−1 n−1
!
h X X
f (x)dx ≈ f (a) + f (b) + 4 f (x2i+1 ) + 2 f (x2i ) ,
3
a i=0 i=1
where h = b−a
2n , x0 = a, x2n = b and xi+1 = xi + h for all i ∈ 0, 2n − 1.
The error of this approximation is
M(b − a)
ε< × h4 ,
180
Assume that f (x) is continuous on [a, b]. Let n be a positive integer and
∆x = b−an . If [a, b] is divided into n subintervals, each of length ∆x, and
mi is the midpoint of the ith interval, set
n
X
Mn = f (mi )∆x.
i=1
Rb
Then lim Mn = f (x)dx.
n→+∞ a
for n = 0, 1, 2, . . .
We consider the paradigm of population growth in the short run. Let N(t)
be the number of individuals in the population at time t and λ be the
birth rate (which doesn’t depend on t) of the population.
dN(t)
= λN(t) + v ,
dt
where v represents the immigration rate. The root of this equation is
v λt
N(t) = N0 e λt + e −1 ,
λ
where N0 is the number of individuals in the population at t = 0.
Assume that
The number of individuals in the population initially is
N(0) = 1000000.
The immigration rate in the first year is 435000.
After a year, the number of individuals is 1564000.
The equation we must solve is
435 λ
N(λ) = 1000e λ + (e − 1).
λ
It is impossible to find the root of this equation clearly, but we may make
an approximation.
Bisection method
Fixed-Point method
Newton
Assume that f is a continuous function on [a, b] such that f (a), f (b) have
different signs. Firstly, let p = a+b
2 .
If f (a)f (p) < 0, then we continue our algorithm the interval [a, p].
Otherwise, we continue our algorithm with the interval [b, p].
As a result, the length of the interval we consider is decreased by a half.
Doing this n times, we may make an approximation of the root of the
equation f (x) = 0 with error b−a
2n , which can be very small.
Examples
Prove that the equation f (x) = x 3 + 4x 2 − 10 = 0 has a root on [1, 2] and
using the bisection method to determine the approximate root, with error
10−4 .
Firstly, we have f (1.5) => 0, f (1) < 0, f (2) > 0. Therefore, we consider
the interval [1, 1.5].
Theorem
1 If g : R → R, g ∈ C ([a, b]) and g (x) ∈ [a, b], ∀x ∈ [a, b], then g has
a fixed point p on [a, b].
2 If g ∈ C 1 ([a, b]) and there exists 0 < k < 1 such that |g ′ (x)| ≤ k for
all x ∈ [a, b], then g has at most one fixed point.
We have g ′ (x) = 23 x, therefore |g ′ (x)| = 23 |x| ≤ 23 < 1 for all x ∈ [−1, 1].
Using the theorem above, we induce that g has at most one fixed point (*)
Moreover, we have g (x) ∈ [−1, 1] for all x ∈ [−1, 1]. Applying the first
claim of the theorem above, g has a fixed point (**).
Combine (*) and (**), we claim that g has a unique fixed point.
With the problem of finding the root of f , we might change into the
problem of finding the fixed point p of the function g (x) = f (x) + x (or
g (x) = x − f (x)). To find approximately the fixed point of a function g ,
we do as follow:
Firstly, we choose the initial approximate value p0 .
Then, we create the sequence {pn }∞
n=0 by using the recursive formula
pn = g (pn−1 ), ∀n ≥ 1.
If the sequence {pn }∞
n=0 converges to p and g is continuous, then p is a
fixed point of g .
|pn − p| ≤ k n max{p0 − a, p0 − b}
and
kn
|pn − p| ≤ |p1 − p0 |, ∀n ≥ 1.
1−k
kn
|pn − p| ≤ |p0 − p1 |.
1−k
1
f (p0 ) + (p − p0 )f ′ (p0 ) + (p − p0 )2 f ′′ (ζ).
2
Now that |p − p0 | is sufficiently small, we have (p − p0 )2 ≈ 0.
f (p0 )
p ≈ p0 − .
f ′ (p0 )
Examples
Given the equation f (x) = cos(x) − x = 0. Find the approximate root of
this equation, by using
a) Bisection method.
b) Newton method, with p0 = π4 .
Let A be the n × n matrix satisfying the scalar at the cell (i, j) is aij and
b = (b1 , b2 , . . . , bn )T , x = (x1 , x2 , . . . , xn )T . We must solve the equation
Ax = b. Write A = D − T , where D is an invertible matrix. The equation
is equivalent to
f (x) = D −1 Tx + D −1 b.
Starting with a given column vector of size n, called x (0) , we construct the
sequence (x (k) )k∈N that satisfies the following recursive formula
x (k) = D −1 Tx (k−1) + D −1 b.
Whenever ||x (k) − x (k−1) ||∞ < TOL (or sometimes we may consider the
||x (k) −x (k−1) ||∞
condition ||x (k) ||∞
< TOL), we stop the process of construction.
which is similar to the norm that you usually use in the subject of
Functional Analysis.