Numerical Analysis: (MA214) : Instructor: Prof. Tony J. Puthenpurakal
Numerical Analysis: (MA214) : Instructor: Prof. Tony J. Puthenpurakal
Lecture 2
Department of Mathematics
Indian Institute of Technology Bombay
|x − x ∗ | = Absolute error
|x − x ∗ |
= relative error, ( provided x 6= 0)
|x|
2 x ∗ is said to be approximate x to t significant digits if
x − x∗
−t
x ≤ 5 × 10
Example
√
(a) f (x) = x is well conditioned.
10
(b) f (x) = 1−x 2 is ill conditioned near 1.
(c) I gave an example where f = f1 (f2 (f3 (f4 ))) with f well conditioned but
f3 ill-conditioned. This also creates lot of error.
6 Last time I gave a spectacular example of instability.
p(x) = a0 + a1 x + a2 x 2 + · · · + an x n
This is called power form. This may lead to loss of significant digits.
In nested form
Remark:- The polynomial constructed for proving this theorem has slow
convergence. So it is ineffective in practice.
n 2 3 4 5 6 7
Tn (3) 3 -5 11 -21 43 -85
We prove that there exists a unique polynomial which does the job.
Example:-
n = 2 and x0 , x1 , x2 are distinct points
(x − x1 )(x − x2 )
l0 (x) =
(x0 − x1 )(x0 − x2 )
(x − x0 )(x − x2 )
l1 (x) =
(x1 − x0 )(x1 − x2 )
(x − x0 )(x − x1 )
l2 (x) =
(x2 − x0 )(x2 − x1 )
Properties:-
1 l (x) is a degree n-polynomial, for all k = 0, 1, · · · , n
k
2 l (x ) = 1
k k
3 l (x ) = 0 for i 6= k
k i
X n
Pn (x) = f (xi )li (x)
i=0
Proof.
degree p(x) ≤ n
degree q(x) ≤ n
So h(x) = p(x) − q(x) is a polynomial of degree ≤ n.
The function
f (x) = log(x)
f (3.2) = log(3.2)
= 1.163
Note :- aInstructor:
n =coefficient
Prof. Tony J.of x n in Pn (x).
Puthenpurakal Numerical Analysis : [ MA214 ] Lecture 2
Definition
f [x0 , x1 , · · · , xn ] =: an
f [x0 , x1 , · · · , xn ] is called the nth divided difference of f (x) at the points
x0 , x1 , · · · , xn .
we write
Pn (x) = f (x0 ) + f [x0 , x1 ](x − x0 )
+ f [x0 , x1 , x2 ](x − x0 )(x − x1 )
+ ···
..
.
+ f [x0 , x1 , x2 , · · · , xn ](x − x0 )(x − x1 ) · · · (x − xn−1 )
f [x0 ] = f (x0 )
P1 (x1 ) = f (x1 )
f (x1 ) = f (x0 ) + f [x0 , x1 ](x1 − x0 )
f (x1 ) − f (x0 )
So f [x0 , x1 ] =
x1 − x0
Proposition
f [x1 , x2 , · · · , xk ] − f [x0 , x1 , · · · , xk−1 ]
f [x0 , x1 , x2 , · · · , xk ] =
xk − x0
Proof.
Let Pi (x) = polynomial of degree ≤ i which agrees with f (x) at the points
x0 , x1 , x2 , · · · , xi .
Let qk−1 (x) = polynomial of degree ≤ k − 1 which agrees with f (x) at the
points x1 , x2 , · · · , xk .
Instructor: Prof. Tony J. Puthenpurakal Numerical Analysis : [ MA214 ] Lecture 2
Proof Continue
Set
x − x0 xk − x
p(x) = qk−1 (x) + Pk−1 (x)
xk − x0 xk − x0
Note: degree p(x) ≤ k
p(x0 ) = f (x0 ) and p(xk ) = f (xk ) and for 1 ≤ i ≤ k − 1
xi − x0 xk − xi
p(xi ) = f (xi ) + f (xi ) = f (xi )
xk − x0 xk − x0
By uniqueness of interpolating polynomial
p(x) = Pk (x)
x f (x) f [, ] f [, , ] f [, , , ]
0.8 1.657E −1 6.62E −1 6.1E −1 −2.5E −1
0.9 2.319E −1 7.84E −1 5.35E −1
1.0 3.103E −1 8.91E −1
1.1 3.994E −1
P2 (x) = f (0.8) + f [0.8, 0.9](x − 0.8) + f [0.8, 0.9, 1.0](x − 0.8)(x − 0.9)
= 1.657E −1 + 6.62E −1(x − 0.8) + 6.1E −1(x − 0.8)(x − 0.9)
P2 (0.85) = 1.973E −1
f (0.85) = 1.974E −1
Remarks:-
1 In the above example error of P3 (x) was same as that P2 (x).
2 It is possible that interpolating error to increase if we increase number
of points.
error en (x) = f (x) − Pn (x)
i.e. it is possible that
Proof.
k=1
f (x1 ) − f (x0 )
f [x0 , x1 ] = = f 0 (ξ) by M.V.T.
x1 − x0
ek (x) = f (x) − Pk (x)
(k)
has k + 1 zeros x0 , x1 , · · · , xk . So ek (x) will have a zero say ξ.
(k) (k)
0 = ek (ξ) = f (k) (ξ) − Pk (ξ)
0 = f (k) (ξ) − k!f [x0 , x1 , · · · , xk ]
f (k)(ξ)
So f [x0 , x1 , · · · , xk ] =
Instructor: Prof. Tony J. Puthenpurakal
k!
Numerical Analysis : [ MA214 ] Lecture 2
Corollary
Estimating:-
n
Y
Ψn+1 (x) = (x − xj )
j=0
Definition
f [x0 , x0 ] = f 0 (x0 )
We need a cubic polynomial P3 (x) such that P3 (1) = f (1), P30 (1) = f 0 (1),
P3 (2) = f (2), P30 (2) = f 0 (2).
n f (x) f [, ] f [, , ] f [, , , ]
y0 = 1 0 1 -0.3069 0.1137
y1 = 1 0 6.931E −1 -0.1931
y2 = 2 6.931E −1 0.5
y3 = 2 6.931E −1