f(x)
a b x
b
Metode Integrasi
I f x dx
a
f(x)
a b x
Metode Differensiasi
f(x)
f xi x
y
f xi
xi xi + x
x x
y f xi x f xi
x x
Specific Study Objectives
y f xi x f xi
x x
Dictionary definition of differentiate - “to mark off
by differences, distinguish; ..to perceive the
difference in or between”
f xi x
y
f xi
x x
y f xi x f xi
x x
Integration
x
b
I f x dx
a
Mathematical Background
d d x
sin x ? e ?
dx dx
d d x
cos x ? a ?
dx dx
d d n
tan x ? x ?
dx dx
d
ln x ?
dx
if u and v are functions of x
d n d
u ? (uv ) ?
dx dx
Mathematical Background
udv ?
u du ?
n
a dx ?
bx
dx
x ?
dx ?
ax
e
Overview
Integration of Equations
Romberg Integration
Gauss Quadrature
Improper Integrals
Overview
Numerical Differentiation
High accuracy formulas
Richardson’s extrapolation
Uncertain data
Applied problems
Newton-Cotes Integration
b b
I f x dx f x dx
a a
n
f n x a0 a1 x .... an x n
Newton-Cotes Integration
b b
I f x dx f n x dx
a a
5 5
4 4
3 3
f(x)
f(x)
2 2
1 1
0 0
0 5 10 0 5 10
x x
The approximation of an integral by the area under
- a first order polynomial
- a second order polynomial
5 5
4 4
3 3
f(x)
f(x)
2 2
1 1
0 0
0 5 10 0 5 10
x x
3
f(x)
0
0 1 2 3 4 5 6 7 8 9 10
x
3
f(x)
0
0 1 2 3 4 5 6 7 8 9 10
x
5 5
4 4
3 3
f(x)
2 f(x) 2
1 1
0 0
0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 10
x x
Trapezoidal Rule
b b
I f x dx f x dx
a a
1
f n x a0 a1 x
Trapezoidal Rule
b b
I f x dx f 1 x dx
a a
f n x a0 a1 x
a b
f b f a
f 1 x f a x a
ba
Trapezoidal Rule
b b
I f x dx f 1 x dx
a a
b
f b f a
f a x a dx
a
ba
f a f b
I b a
2
f a f b
Trapezoidal Rule I b a
2
base
height
base
f a f b
Trapezoidal Rule I b a
2
base
height
height
height width
base
Error of the Trapezoidal Rule
1
Et f ' ' b a
3
12
where a b
x1 x2 xn
f x0 f x1 f x1 f x2 f xn 1 f xn
Ih h h
2 2 2
f x0 f x1 f x1 f x2 f xn 1 f xn
I h h h
2 2 2
n 1
f x0 2 f xi f xn
I b a i 1
2n
2n
}
width }
average height
Note that the interior points are given twice the weight
of the two end points 3
b a
Ea 2
f ''
12 n
Example
1.6
e
30
I x2
dx 25
1 20
f(x)
15
ba
h 10
n 5
0
0 0.3 0.6 0.9 1 .2 1 .5 1 .8
x
n 1
f x0 2 f xi f xn
I b a i 1
2n
Simpson’s 1/3 Rule
b b
I f x dx
a a
f 2 x dx
f n x a0 a1 x a 2 x 2
Simpson’s 1/3 Rule
Designate a and b as x0
and x2, and estimate f2(x)
as a second order
Lagrange polynomial
b b
I f x dx f x dx
a a
2
x x1 x x2
x2
f x0 .......dx
x 0 0
x x1 x0 x2
Simpson’s 1/3 Rule
h
I f x0 4 f x1 f x2
3
f x0 4 f x1 f x2
b a
6
}
}
width average height
Error
12
where a b
x1 x2 xn
3n
Ea
b a
5
f 4
180n 4
n 1 n2
f x0 4 f x 2 f x f x
i j n
3n
The odd points represent the middle term for each application.
Hence carry the weight 4.
The even points are common to adjacent applications and are
counted twice.
x
Simpson’s 3/8 Rule
b b
I f x dx f x dx
a a
3
f n x a 0 a1x a 2 x 2 a 3 x 3
3h
I f x 0 3f x1 3f x 2 f x 3
8
Integration of Unequal Segments
n 1
f x0 2 f xi f xn
I b a i 1
2n
f x0 f x1 f x1 f x2 f xn 1 f xn
I h h h
2 2 2
Integration of Unequal Segments
trapezoidal
rule
Integration of Unequal Segments
1/3
trapezoidal rule
rule
Integration of Unequal Segments
1/3
trapezoidal rule
rule 3/8
rule
Integration of Unequal Segments
trapezoidal
1/3 rule
trapezoidal rule
rule 3/8
rule
Example
1 4000
1 2000
4 1 0000
dx
2x
xe f(x) 8000
6000
4000
0
2000
0
0 1 2 3 4
x
f(x) b
I f x dx
a
a b x
Trapezoidal Rule
Single segment
f a f b
I b a
2
n segment
x1 x2 xn
f x0 f x1 f x1 f x2 f xn 1 f xn
I h h h
2 2 2
n 1
f x0 2 f xi f xn
I b a i 1
2n
h
I f x0 4 f x1 f x2
3
f x0 4 f x1 f x2
b a
6
}
width
}
average height
n segment
n 1 n2
f x0 4 f x 2 f x f x
i j n
3n
Simpson’s 3/8 Rule
Single segment
b b
I f x dx f x dx
a a
3
f n x a 0 a1x a 2 x 2 a 3 x 3
3h
I f x 0 3f x1 3f x 2 f x 3
8
n segment ?
Bentuk data akan mempengaruhi hasil aproksimasi nilai integrasi.
Bila data berbentuk tabel : terbatas oleh data yg diberikan
akurasi tertentu.
Richardson’n Extrapolation
Gauss Quadrature
Integration of Equations
Romberg Integration
Richardson’s Extrapolation
Gauss Quadrature
Improper Integrals
Richardson’s Extrapolation
I = I(h) + E(h)
ba 2
E h f ''
12
E h1 h12
2
E h2 h2
E h1 h12
2
E h2 h2
2
h1
E h1 E h2
h2
I h1 I h2
E h2 2
h1
1
h2
I h1 I h2
E h2 2
h1
1
h2
I = I(h2) + E(h2)
I h2 I h1
1
I I h2 2
h1 1
h2
Richardson’s Extrapolation
I h2 I h1
1
I I h2 2
h1 1
h2
What is the equation for the special case where the interval
is halved?
i.e. h2 = h1 / 2
h1 2h2 2
h2 h2
1
I I h2 2 I h I h1
2 1
2
collecting terms
4 1
I I h2 I h1
3 3
Example
4 1 4000
dx
2x
xe 1 2000
0 1 0000
8000
f(x)
6000
4000
2000
0
0 1 2 3 4
x
Romberg Integration
4 1
I I h2 I h1 k = 2; j = 1
3 3
16 1
I I hm I hl
15 15
Note:
64 1
I I hm I hl the subscripts
63 63 m and l refer to
more and less
4 k 1 I j 1,k 1 I j ,k 1
I j ,k accurate estimates
4 k 1 1
Gauss Quadrature
f(x)
x
Method of Undetermined Coefficients
f a f b
I b a
2 Before analyzing
this method, answer
this question.
This can also be expressed as
What are two
functions that
where the c’s are constant should be evaluated
Exactly by the
trapezoidal rule?
I c0 f a c1 f b
The two cases that should be evaluated exactly
by the trapezoidal rule: 1) y = constant
2) a straight line
f(x)
y=1
f(x)
-(b-a)/2 (b-a)/2 x y=x
-(b-a)/2
(b-a)/2 x
Thus, the following equalities should hold.
I c0 f a c1 f b
b a
c0 c1 2
1dx FOR y=1
ba
2 since f(a) = f(b) =1
b a
b a b a
c0 c1 b a xdx
2
FOR y =x
2 2 2 since f(a) = x =-(b-a)/2
and
f(b) = x =(b-a)/2
Evaluating both integrals
c0 c1 b a For y = 1
ba b 1
c0 c1 0 For y = x
2 2
c0 = c1 = (b-a)/2
f a f b
I b a
2
I c0 f x0 c1 f x1
-1 x0 x1 1 x
c0 f x0 c1 f x1 x 2 dx 2 / 3
1
What equations are
1
c0 f x0 c1 f x1 xdx 0 c0 x0 c1 x1` 0
1
1
c0 f x0 c1 f x1 x 2 dx 2 / 3 c0 x02 c1 x12 2 / 3
1
1
c0 c1 1
1
x0
3
1
x1
3
1 1
I f f
3 3
1 1
and
3 3
What if we aren’t integrating from –1 to 1?
x = a0 + a1xd
a = a0 + a1(-1) b = a0 + a1(1)
a = a0 + a1(-1) b = a0 + a1(1)
ba ba
a0 a1
2 2
substitute
x a0 a1xd
b a b a xd
2
x a0 a1xd
b a b a xd
2
ba
dx dxd
2
1 4000
4 1 2000
dx
2x
xe 1 0000
0 8000
f(x)
6000
4000
2000
0
0 1 2 3 4
x
Higher-Point Formulas
c0 = 0.556 x0=-0.775
c1= 0.889 x1=0.0
c2= 0.556 x2=0.775
Numerical Differentiation
f ' ' xi 2
f xi 1 f xi f ' xi h h .........
2!
Forward Finite Difference
f ' ' xi 2
f xi 1 f xi f ' xi h h .........
2!
f xi 1 f xi
f ' xi O h
h
f xi 1 f xi f ' ' xi
f ' xi h O h 2
h 2
Forward Divided Difference
f xi 1 f xi f i
f ' xi O xi 1 xi O h
xi 1 xi h
f(x)
x
Forward Divided Difference
f xi 1 f xi f i
f ' xi O xi 1 xi O h
xi 1 xi h
f(x)
(x i+1,y i+1)
x
Forward Divided Difference
f xi 1 f xi f i
f ' xi O xi 1 xi O h
xi 1 xi h
f(x)
How does
(x i+1,y i+1)
this compare
to the actual
first derivative (xi, yi)
at xi?
x
Forward Divided Difference
f xi 1 f xi f i
f ' xi O xi 1 xi O h
xi 1 xi h
f(x)
(x i+1,y i+1)
(xi, yi)
x
Forward Divided Difference
f i
f ' xi O h Error is proportional to
h the step size
f ' ' xi 2
f xi 1 f xi f ' xi h h ......
2!
f ' ' xi 2
f xi 1 f xi f ' xi h h .....
2!
f xi f xi 1 f i
f ' xi
h h
(xi,yi)
(xi-1,yi-1)
x
Centered Difference Approximation of the
First Derivative
f ' ' xi 2
f xi 1 f xi f ' xi h h ....
2!
f xi 1 f xi
f ' xi
xi 1 xi
f ' ' ' xi 2
f xi 1 f xi 1 2 f ' xi h h
6
f xi 1 f xi 1
f ' xi
2h
O h2
f xi 1 f xi 1
f ' xi Oh 2
2h
f(x)
(xi+1,yi+1)
(xi,yi)
(xi-1,yi-1)
x
f(x) f(x)
forward
true derivative
finite divided
difference approx.
x x
f(x) f(x)
backward centered
finite divided finite divided
difference approx. difference approx.
x x
Derivatives of Unequally Spaced Data
Differentiate analytically
2 x xi xi 1 2 x xi 1 xi 1
f ' x f xi 1 f xi
xi 1 xi xi 1 xi 1 xi xi 1 xi xi 1
2 x xi xi 1
f xi 1
xi 1 xi xi 1 xi 1
Derivative and Integral Estimates for Data with
Errors
dy/dt
y
1 00 10
50
0 0
0 5 10 15 0 10
t t
250 40
2 00 30
dy/dt
150
20
y
1 00
10
50
0 0
0 5 10 15 0 10
t t