1 MA8491 Numerical Methods . Topic 1 : Lagrangian Polynomials(Equal and unequal intervals) Lagrange’s interpolation formula(x given, finding y in terms of x) Let y =f(x) be a function which takes the values y = y 0 , y 1 ,…, y n corresponding to x = x 0 , x 1 ,…, x n . 1 2 0 0 1 0 2 0 ( )( ) ( ) () () ( )( ) ( ) n n x x x x x x y yx fx y x x x x x x … … 0 2 1 1 0 1 2 1 0 1 1 2 0 2 1 1 ( )( ) ( ) ( )( ) ( ) ( )( ) ( ) ( )( ) ( ) n n n n n x x x x x x y x x x x x x x x x x x x y x x x x x x … … … … … Inverse Lagrange’s interpolation formula(y given, finding x in terms of y) 1 2 0 0 1 0 2 0 ( )( ) ( ) () () ( )( ) ( ) n n y y y y y y x xy f y x y y y y y y … … 0 2 1 1 0 1 2 1 0 1 1 2 0 2 1 1 ( )( ) ( ) ( )( ) ( ) ( )( ) ( ) ( )( ) ( ) n n n n n y y y y y y x y y y y y y y y y y y y x y y y y y y … … … … … Note: Lagrange’s interpolation formula can be used for equal and unequal intervals. Part A: 1. What is the assumptions we make when Lagrange’s formula is used? Sol: Lagrange’s interpolation formula can be used whether the values of x, the independent variable are equally spaced or not whether the difference of y become smaller or not. 2. What is the disadvantage in practice in applying Lagrange’s interpolation formula? Sol: Though Lagrange’s formula is simple and easy to remember, its application is not speedy. It requires close attention to sign and there is always a chance of committing some error due to a number of positive and negative signs in the numerator and the denominator. UNIT II: INTERPOLATION AND APPROXIMATION Lagrangian Polynomials – Divided differences – Interpolating with a cubic spline – Newton’s forward and backward difference formulas.
21
Embed
denominator. · Lagrange’s interpolation formula can be used for equal and unequal intervals. Part A: 1. What is the assumptions we make when Lagrange’s formula is used? Sol:
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
1MA8491 Numerical Methods .
Topic 1 : Lagrangian Polynomials(Equal and unequal intervals)Lagrange’s interpolation formula(x given, finding y in terms of x)
Let y =f(x) be a function which takes the values y = y0, y1,…, yn corresponding to x = x0, x1,…, xn.
1 20
0 1 0 2 0
( )( ) ( )( ) ( )
( )( ) ( )n
n
x x x x x xy y x f x y
x x x x x x
……
0 21
1 0 1 2 10 1 1
2 0 2 1 1
( )( ) ( )
( )( ) ( )( )( ) ( )
( )( ) ( )
n
nn
nn
x x x x x xy
x x x x x xx x x x x x
yx x x x x x
……
………
Inverse Lagrange’s interpolation formula(y given, finding x in terms of y)
1 20
0 1 0 2 0
( )( ) ( )( ) ( )
( )( ) ( )n
n
y y y y y yx x y f y x
y y y y y y
……
0 21
1 0 1 2 10 1 1
2 0 2 1 1
( )( ) ( )
( )( ) ( )( )( ) ( )
( )( ) ( )
n
nn
nn
y y y y y y xy y y y y yy y y y y y xy y y y y y
… …………
Note:Lagrange’s interpolation formula can be used for equal and unequal intervals.
Part A:1. What is the assumptions we make when Lagrange’s formula is
used?Sol: Lagrange’s interpolation formula can be used whether the values of x, the independent variable are equally spaced or not whether the difference of y become smaller or not.
2. What is the disadvantage in practice in applying Lagrange’s interpolation formula?Sol: Though Lagrange’s formula is simple and easy to remember, its application is not speedy. It requires close attention to sign and there is always a chance of committing some error due to a number of positive and negative signs in the numerator and the denominator.
UNIT II: INTERPOLATION AND APPROXIMATIONLagrangian Polynomials – Divided differences – Interpolating with a cubicspline – Newton’s forward and backward difference formulas.
2 UNIT II: Interpolation And Approximation
3. What is ‘inverse interpolation’?Sol: Suppose we are given a table of values of x and y. Direct interpolation is the process if finding the values of y corresponding to a value of x, not present in the table. Inverse interpolation is the process of finding the values of x corresponding to a value of y, not present in the table.
4. Construct a linear interpolating polynomial given the points 0 0 1 1( , ) and ( , ).x y x y
Sol:01
0 10 1 1 0
( )( )( ) ( )( ) ( )
x xx xy y x f x y yx x x x
5. What is the Lagrange’s formula to find ‘y’ if three sets of values 0 0 1 1 2 2( , ),( , ) and ( , )x y x y x y are given.
Sol:0 2 0 11 2
0 1 20 1 0 2 1 0 1 2 2 0 2 1
( )( ) ( )( )( )( )( )( ) ( )( ) ( )( )
x x x x x x x xx x x xy y y yx x x x x x x x x x x x
6. Find the second degree polynomial fitting the following data:x 1 2 4y 4 5 13Sol: Here x0 =
1, x1 = 2, x2 = 4y0 = 4, y2 = 5, y3 = 13
By Lagrange’s formula for three points is 0 2 0 11 2
0 1 20 1 0 2 1 0 1 2 2 0 2 1
( )( ) ( )( )( )( )( )( ) ( )( ) ( )( )
x x x x x x x xx x x xy y y yx x x x x x x x x x x x
( 2)( 4) ( 1)( 4) ( 1)( 2)(4) (5) (13)(1 2)(1 4) (2 1)(2 4) (4 1)(4 2)x x x x x xy
Newton’s forward interpolation difference formula:[if y(required x near to 0x ) = ? and use ]
02 3
0 0 0 0
( ) ( ) ( )( 1) ( 1)( 2) = ...
1! 2! 3!
y x f x f x uhu u u u u uy y y y
where 0 ,
x xuh
h = length of interval Newton’s backward interpolation difference formula:
[if y(required x near to nx ) = ? and use ]
2 3( ) ( ) ( )
( 1) ( 1)( 2) ...1! 2! 3!
n
n n n n
y x f x f x vhv v v v v vy y y y
where ,n
x xvh
h = length of intervalPart A:
15. What advantage has Lagrange’s formula over Newton?Sol: The forward and backward interpolation formulae of Newton can be used only when the values of the independent variable x are equally spaced can also be used when the differences of the dependent variable y become smaller ultimately. But Lagrange’s interpolation formula can be used whether the values of x, the independent variable are equally spaced or not and whether the difference of y become smaller or not.
14 UNIT II: Interpolation And Approximation 16. Derive Newton’s forward difference formula by using operator
method. [or] Derive Gregory – Newton forward difference interpolation formula.
15MA8491 Numerical Methods .
Sol: 0 0 0u u
n n nP x P x uh E P x E y
01 u y
2 3
0 0 0 0( 1) ( 1)( 2)= ...
1! 2! 3!u u u u uuy y y y
where 0x xu
h
17. Derive Newton’s backward difference formula by using operator method.
Sol: 0v v
n n n n nP x P x vh E P x E y
11 where 1v
ny E
2 3( 1) ( 1)( 2)1 ...
2! 3! nv v v v vv y
2 3( 1) ( 1)( 2) ...1! 2! 3!n n n nv v v v v vy y y y
where ,n
x xvh
18. When will we use Newton’s forward interpolation formula?Sol: The formula is used to interpolate the values of y near
the beginning of the table values and also for extrapolating the values of y short distance ahead (to the left) of y0.
19. When Newton’s backward interpolation formula is used?Sol: The formula is used mainly to interpolate the values of
y near the end of a set of tabular values and also for extrapolating the values of y short distance ahead (to the right) of yn.
Part B:Eg.13.Using New ton’s forward interpolation formula, find the cubic
polynomial which takes the following valuesx 0 1 2 3
y = f(x) 1 2 1 10Evaluate f(4). {AU 2000, 2009}
Sol: WKT, Newton forward formula to find the polynomial in x.There are only 4 data given.Hence the polynomial will be degree 3.Newton’s forward formula is
02 3
0 0 0 0
( ) ( ) ( )( 1) ( 1)( 2) = ...
1! 2! 3!
y x f x f x uhu u u u u uy y y y
where 0 ,
x xuh
h = length of interval
16 UNIT II: Interpolation And Approximation
Newton’s divided difference tablex ( )y f x y 2 y
3y
0 0x 0 1y
2 1 1
1 1x 1 2y 1 1 2
1 2 1 10 2 12
2 2x 2 1y 9 1 10
10 1 9
3 3x 3 10y
3 2
1 1 21 1 2 121! 2! 3!
2 7 6 1
x x x x x xf x
x x x
When 2,(4) 41x
f
CW.14. The population of a city in a census takes once in 10 years is
given below. Estimate the population in the year 1955.Year 1951 1961 1971 1981
Population in lakhs 35 42 58 84Sol: ( 1955) ( 1955) 36.784y x f x
HW.15. From the table given below find sin 52 by using Newton’s forward interpolation formula.
x 45 50 55 60 y = sin x 0.7071 0.7660 0.8192 0.8660
Sol: ( 52) sin 52 0.788y x approximately.Eg.16.From the data given below find the number of students whose
weight is between 60 and 70.Weight in lbs 0–40 40–60 60–80 80–100 100–120
Number of students 250 120 100 70 50Sol: Let weight be denoted by x and
number of students be denoted by y, y = f(x). Use Newton's forward formula to find y where x lies between 60 – 70. Newton's forward formula is
02 3
0 0 0 0
( ) ( ) ( )( 1) ( 1)( 2) = ...
1! 2! 3!
y x f x f x uhu u u u u uy y y y
We rewrite the table as cumulative table showing the number of students less than x lbs.
Number of students whose weight is 70 424Number of students whose weight is between 60 70 424 370 54.
CW17. Use Newton’s backward difference formula to construct as interpolating polynomial of degree 3 for the data.f(– 0.75) = – 0.07181250, f(– 0.5) = –0.024750,