Chapter 1 Introduction
Chapter 1 Introduction
INTRODUCTION
Differentiation (I)
Product rule
(fg )0 = f 0 g + g 0 f .
so
(fgh)0 = f 0 (gh) + (gh)0 f = f 0 gh + g 0 hf + h0 gf .
Example
d
(x x1 )(x x2 )(x x3 ) = (x x2 )(x x3 ) + (x x1 )(x x3 )
dx
+(x x1 )(x x2 ).
Differentiation (II)
n
Y
(x xi ) = (x x1 )(x x2 ) . . . (x xn ).
i=1
Then
n
d Y
(x xi ) = (x x2 )(x x3 ) . . . (x xn ) +
dx
i=1
(x x1 )(x x3 ) . . . (x xn ) + . . . +
(x x1 )(x x2 ) . . . (x xi1 )(x xi+1 ) . . . (x xn ) + . . .
+(x x1 )(x x2 ) . . . (x xn1 ).
O notation (I)
n + 1 1
1
2
2 = + 2 .
n
n n
n
O notation (II)
If |h| < 1 then |h2 | < |h|, |h3 | < |h2 |, ....Then
|ah + bh2 | |ah| + |bh2 | (|a| + |b|)|h|,
so ah + bh2 is O(h).
f (n) (x0 )
f 00 (x0 )
(xx0 )2 +. . .+
(xx0 )n +. . . .
2!
n!
x2 x3
+
...;
2
3
Integration
Definition of integration:
Divide an interval [a, b] into n parts by
a = x0 < x1 < . . . < xn1 < xn = b.
Pick up a point i in (xi1 , xi ).
Then
Z b
n
X
f (x)dx =
lim
f (i )(xi xi1 ).
a
i=1
Example:
Z
0
1
e dx = e = e 1 = 1.718281828.
x
But for
Z
e x dx,
e x dx e 1/4 = 1.284025.
1
2
e x dx (e 1/16 + e 9/16 ) = 1.40977.
2
Dividing [0, 1] into three intervals [0, 1/3], [1/3, 2/3] and [2/3, 1],
and pick up 1 = 1/6, 2 = 1/2 and 3 = 5/6, then
Z
0
e x dx 1.43826
Error (I)
Error (II)
Floating point
b b 2 4ac
b + b 2 4ac
, x2 =
,
x1 =
2a
2a
i.e. x1 = 0.01610723, x2 = 62.08390.
.
b + b 2 4ac
x1 =
2.000
= 0.01611.
62.10 + 62.06
Algorithm
Pseudocode
INPUT N, x1 , x2 ,. . . , xN .
Set SUM = 0.
For i = 1, 2, . . . , N
Set SUM = SUM + xi .
OUTPUT SUM.
1
.
np
n2 + n + 1
.
n2
Then n 1 as n .
|n 1| =
n+1
1
1
2
= + 2 ,
2
n
n n
n
n =
Then
|
n 1| =
n3 + n + 1
.
n3
1
1
2
n+1
= 2 + 3 2.
3
n
n
n
n
f 00 (0) 2 f 000 () 3
h +
h .
2
6
f 00 (0) 2
K
h ]| |h3 |.
2
6