















































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Easy to understand andd apply for the engineering problems
Typology: Lecture notes
1 / 55
This page cannot be seen from the preview
Don't miss anything!
Hoang Hai Ha
Given a function y = f ( x ) by the table:
xk x 0 x 1 · · · xn yk = f ( xk ) y 0 y 1 · · · yn
To find f ′( ¯ x ), we interpolate it by a function G ( x ) and apply
f ′( ¯ x ) ≈ G ′( ¯ x )
Consider the table of data points for y = f ( x ):
x x 0 x 1 y y 0 y 1 where y 0 = f ( x 0 ) and y 1 = f ( x 1 ) = f ( x 0 + h ). The polynomial interpolation Lagrange is
L ( x ) =
x − x 0 h
y 1 −
x − x 1 h
y 0 ,
where h = x 1 − x 0. Then, for all ∀ x ∈ [ x 0 , x 1 ] we have
y 1 − y 0 h
f ( x 0 + h ) − f ( x 0 ) h
Forward difference formula:
y 1 − y 0 h
f ( x 0 + h ) − f ( x 0 ) h
Backward difference formula:
f ( x 0 ) − f ( x 0 − h ) h
Use forward and backward difference formulas to approximate derivative of f ( x ) = ln x at x 0 = 1.8 with h = 0..
Consider the table where nodes are equally spaced x x 0 x 1 x 2 y y 0 y 1 y 2 where y 0 = f ( x 0 ), y 1 = f ( x 1 ) = f ( x 0 + h ), y 2 = f ( x 2 ) = f ( x 0 + 2 h ) Polynomial interpolation Lagrange for this table is
L ( x ) ==
( x − x 0 )( x − x 1 ) 2 h^2
y 2 −
( x − x 0 )( x − x 2 ) h^2
y 1 +
( x − x 1 )( x − x 2 ) 2 h^2
y 0.
L ′( x ) =
x − x 0 2 h^2
( y 2 − 2 y 1 ) +
x − x 1 h^2
( y 2 + y 0 ) +
x − x 2 2 h^2
( y 0 − 2 y 1 )
L ′′( x ) =
y 2 − 2 y 1 + y 0 h^2
The formula
− 3 y 0 + 4 y 1 − y 2 2 h
is called forward difference formul, and rewritten by
f ′( x 0 ) =
− 3 f ( x 0 ) + 4 f ( x 0 + h ) − f ( x 0 + 2 h ) 2 h
y 2 − y 0 2 h
is called centered difference formula
and written in the form
f ( x 0 + h ) − f ( x 0 − h ) 2 h
Compute y ′(1) with h = 0.5 for function y = e − x^ , using center difference formula, compare to the exact value(take the value found by the pocket calculator as the exact value.)
Compute y ′(1) with h = 0.5 for function y = e − x^ , using center difference formula, compare to the exact value(take the value found by the pocket calculator as the exact value.)
f ′(1) =
f (1 + 0.5) − f (1 − 0.5) 2 × 0.
Exact value: −0.367879441171442.
We usually find a definite integral by Newton-Leibniz formula Z (^) b
a
f ( x ) d x = F ( x )
b a
= F ( b ) − F ( a ), F ′( x ) = f ( x ).
But this method does not work in two cases: it is impossible to find F or we don’t know f ( x ) explicitly. ALTERNATIVE METHOD We replace f ( x ) by its interpolation polynomial Pn ( x ) on [ a , b ] and approximate (^) Z b
a
Z (^) b
a
Pn ( x ) d x
To derive the approximation for
Z (^) b
a
f ( x ) d x we replace f ( x ) by its polynomial interpolation passing through 2 points ( a , f ( a )) và ( b , f ( b )) Then
P 1 ( x ) = f ( a ) +
f ( b ) − f ( a ) b − a
( x − a )
To derive the approximation for
Z (^) b
a
f ( x ) d x we replace f ( x ) by its polynomial interpolation passing through 2 points ( a , f ( a )) và ( b , f ( b )) Then
P 1 ( x ) = f ( a ) +
f ( b ) − f ( a ) b − a
( x − a )
Z (^) b
a
P 1 ( x ) d x = f ( a ) x +
f ( b ) − f ( a ) b − a
μ x^2 2
− ax
b
a
We get the following which is called the Trapezoidal formula
Z (^) b
a
f ( x ) d x ≈
b − a 2
f ( a ) + f ( b )
Dividing [ a , b ] into n sub-intervals with step h =
b − a n
. Then a = x 0 , x 1 = x 0 + h ,... , xk = x 0 + kh ,... , xn = x 0 + nh và yk = f ( xk ), k = 0, 1,... , n Applying the trapezoidal rule for each interval [ xk xk + 1 ]
Z^ b
a
f ( x ) d x =
Z^ x^1
x 0
f ( x ) d x +
Z^ x^2
x 1
f ( x ) d x +... +
Z^ xn
xn − 1
f ( x ) d x
y 0 + y 1 2
y 1 + y 2 2
+... + h ·
yn − 1 + yn 2
h 2
y 0 + 2 y 1 + 2 y 2 + .... + 2 yn − 1 + yn