Numerical Analysis maths, Study notes of Mathematics

Numerical Analysis MA214 like a bunch of stuff

Typology: Study notes

2021/2022

Uploaded on 04/19/2023

vyshnavi-pushpa
vyshnavi-pushpa 🇮🇳

1 document

1 / 18

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CHAPTER 8
Interpolation
Let a physical experiment be conducted and the outcome is recorded only at some finite
number of times. If we want to know the outcome at some intermediate time where
the data is not available, then we may have to repeat the whole experiment once again
to get this data. In the mathematical language, suppose that the finite set of values
{f(xi):i=0,1,···,n}
of a function fat a given set of points
{xi:i=0,1,···,n}
is known and we want to find the value of f(x), for some x(xm,xM), where xm=
min
j=0,1,···,nxjand xM=max
j=0,1,···,nxj. One way of obtaining the value of f(x)is to
compute this value directly from the expression of the function f. Often, we may not
know the expression of the function explicitly and only the data
{(xi,yi):i=0,1,···,n}
is known, where yi=f(xi). In terms of the physical experiments, repeating an ex-
periment will quite often be very expensive. Therefore, one would like to get at least
an approximate value of f(x)(in terms of experiment, an approximate value of the
outcome at the desired time). This is achieved by first constructing a function whose
value at xicoincides exactly with the value f(xi)for i=0,1,··· ,nand then finding
the value of this constructed function at the desired points. Such a process is called
interpolation and the constructed function is called the interpolating function for the
given data.
S. Baskar and S. Sivaji Ganesh 123 Spring 2022-23
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12

Partial preview of the text

Download Numerical Analysis maths and more Study notes Mathematics in PDF only on Docsity!

CHAPTER 8

Interpolation

Let a physical experiment be conducted and the outcome is recorded only at some finite

number of times. If we want to know the outcome at some intermediate time where

the data is not available, then we may have to repeat the whole experiment once again

to get this data. In the mathematical language, suppose that the finite set of values

{f (x i ) : i = 0, 1, · · · , n}

of a function f at a given set of points

{x i : i = 0, 1, · · · , n}

is known and we want to find the value of f (x), for some x ∈ (xm, xM ), where xm =

min

j=0,1,··· ,n

x j and x M = max j=0,1,··· ,n x j

. One way of obtaining the value of f (x) is to

compute this value directly from the expression of the function f. Often, we may not

know the expression of the function explicitly and only the data

{(x i , y i ) : i = 0, 1, · · · , n}

is known, where y i = f (x i ). In terms of the physical experiments, repeating an ex-

periment will quite often be very expensive. Therefore, one would like to get at least

an approximate value of f (x) (in terms of experiment, an approximate value of the

outcome at the desired time). This is achieved by first constructing a function whose

value at xi coincides exactly with the value f (xi) for i = 0, 1, · · · , n and then finding

the value of this constructed function at the desired points. Such a process is called

interpolation and the constructed function is called the interpolating function for the

given data.

Section 8.1 Polynomial Interpolation

In certain circumstances, the function f may be known explicitly, but still too dif-

ficult to perform certain operations like differentiation and integration. Thus, it is

often preferred to restrict the class of interpolating functions to polynomials, where the

differentiation and the integration can be done more easily.

In Section 8.1, we introduce the basic problem of polynomial interpolation and prove

the existence and uniqueness of polynomial interpolating the given data. There are at

least two ways to obtain the unique polynomial interpolating a given data, one is the

Lagrange and another one is the Newton. In Section 8.1.2, we introduce Lagrange form

of interpolating polynomial, whereas Section 8.1.3 introduces the notion of divided

differences and Newton form of interpolating polynomial. The error analysis of the

polynomial interpolation is studied in Section 8.3. In certain cases, the interpolating

polynomial can differ significantly from the exact function. This is illustrated by Carl

Runge and is called the Runge Phenomenon. In Section 8.3.4, we present the example

due to Runge and state a few results on convergence of the interpolating polynomials.

The concept of piecewise polynomial interpolation and Spline interpolation are discussed

in Section 8.5.

8.1 Polynomial Interpolation

Polynomial interpolation is a concept of fitting a polynomial to a given data. Thus, to

construct an interpolating polynomial, we first need a set of points at which the data

values are known.

Definition 8.1.1.

Any collection of distinct real numbers x 0 , x 1 , · · · , x n (not necessarily in increasing

order) is called nodes.

Definition 8.1.2 [Interpolating Polynomial].

Let x 0 , x 1 , · · · , x n be the given nodes and y 0 , y 1 , · · · , y n be real numbers. A polyno-

mial pn(x) of degree less than or equal to n is said to be a polynomial interpolating

the given data or an interpolating polynomial for the given data if

p n (x i ) = y i , i = 0, 1, · · · n. (8.1)

The condition (8.1) is called the interpolation condition.

Section 8.1 Polynomial Interpolation

This leads to the system of linear equations for a i s given by

a 0

  • x 0 a 1
  • x

2

0

a 2 +... + x

n

0

a n = y 0

a 0

  • x 1 a 1
  • x

2

1

a 2 +... + x

n

1

a n = y 1

a 0

  • x n a 1
  • x

2

n

a 2 +... + x

n

n

a n = y n

The above system may be written as

V a = y,

where V is the Vandermonde matrix

V =

1 x 0 x

2

0 · · · x

n

0

1 x 1 x

2

1

· · · x

n

1

1 x n x

2

n

· · · x

n

n

a = (a 0 , a 1 ,... , an)

T , and y = (y 0 , y 1 ,... , yn)

T .

Let the j

th column of V be denoted as vj. Then we claim that the vectors v 0 , v 2 ,

... , vn are linearly independent.

Let the constants c 0 , c 1 ,.. ., c n be such that

c 0 v 0 + c 1 v 1 +... + cnvn = 0.

The k

th equation of the above system is

c 0

  • c 1 x k
  • c 2 x

2

k

+... + c n x

n

k

= 0, k = 0, 1,... , n.

Thus, we obtained a polynomial q(x) = c 0

  • c 1 x + c 2 x

2 +... + c n x

n of degree less than

or equal to n, and having n + 1 distinct roots, namely, x 0 , x 1 ,.. ., x n

. This shows

that the polynomial q(x) is the zero polynomial. That is, c 0 = c 1 =... = c n

This shows that the vectors v 0 , v 2 ,... , v n are linearly independent. This implies

that the Vandermonde matrix is invertible and hence the above system has a unique

solution a = (a 0 , a 1 ,... , an)

T

. Thus, we obtained all the coefficients of pn(x) and are

unique. This proves the existence and uniqueness of the interpolating polynomial of

a given data set.

Section 8.1 Polynomial Interpolation

Remark 8.1.5.

A special case is when the data values yi, i = 0, 1, · · · , n, are the values of a function

f at given nodes xi, i = 0, 1, · · · , n. In such a case, a polynomial interpolating the

given data

x x 0 x 1 x 2 x 3 · · · x n

y f (x 0 ) f (x 1 ) f (x 2 ) f (x 3 ) · · · f (xn)

is said to be the polynomial interpolating the given function or the interpolating

polynomial for the given function and has a special significance in applications of

Numerical Analysis for computing approximate solutions of differential equations

and numerically computing complicated integrals.

Example 8.1.6.

Let the following data represent the values of f :

x 0 0.5 1

f (x) 1.0000 0.5242 −0.

The questions are the following:

  1. What is the exact expression for the function f?
  2. What is the value of f (0.75)?

We cannot get the exact expression for the function f just from the given data,

because there are infinitely many functions having same value at the given set of

points. Due to this, we cannot expect an exact value for f (0.75), in fact, it can be

any real number. On the other hand, if we look for f in the class of polynomials of

degree less than or equal to 2, then Theorem 8.1.4 tells us that there is exactly one

such polynomial and hence we can obtain a unique value for f (0.75).

The interpolating polynomial happens to be

p 2 (x) = −1.9042x

2

  • 0.0005x + 1

and we have

p 2

The function used to generate the above table of data is

f (x) = sin

π

e

x

Section 8.1 Polynomial Interpolation

8.1.2 Lagrange’s Form of Interpolating Polynomial

Definition 8.1.7 [Lagrange’s Polynomial].

Let x 0 , x 1 , · · · , x n be the given nodes. For each k = 0, 1, · · · , n, the polynomial l k (x)

defined by

l k (x) =

n ∏

i= i! =k

(x − xi)

(x k − x i

is called the k

th Lagrange polynomial or the k

th Lagrange cardinal function.

Remark 8.1.8.

Note that the k

th Lagrange polynomial depends on all the n+1 nodes x 0 , x 1 , · · · , x n .

The Lagrange polynomials l 0 , l 1 , · · · , l n form a basis for the space of polynomials

of degree ≤ n.

Theorem 8.1.9 [Lagrange’s form of Interpolating Polynomial].

Hypothesis:

  1. Let x 0 , x 1 , · · · , x n be given nodes.
  2. Let the values of a function f be given at these nodes.
  3. For each k = 0, 1, · · · , n, let l k (x) be the k

th Lagrange polynomial.

  1. Let p n (x) (of degree ≤ n) be the polynomial interpolating the function f at

the nodes x 0 , x 1 , · · · , x n

Conclusion: Then, p n (x) can be written as

p n (x) =

n ∑

i=

f (x i )l i (x). (8.3)

This form of the interpolating polynomial is called the Lagrange’s form of In-

terpolating Polynomial.

Proof.

Firstly, we will prove that q(x) :=

n

i=

f (x i )l i (x) is an interpolating polynomial for

Section 8.1 Polynomial Interpolation

the function f at the nodes x 0 , x 1 , · · · , x n

. Since

li(xj ) =

1 if i = j

0 if i %= j

we get q(xj ) = f (xj ) for each j = 0, 1, · · · , n. Thus, q(x) is an interpolating poly-

nomial. Since interpolating polynomial is unique by Theorem 8.1.4, the polynomial

q(x) must be the same as p n (x). This completes the proof of the theorem.

Remark 8.1.10.

The set of Lagrange polynomials {l 0 (x), l 1 (x),... , l n (x)} forms a basis for the

space of all polynomials of degree less than or equal to n.

Example 8.1.11.

Consider the case n = 1 in which we have two distinct points x 0 and x 1. Thus, we

have

l 0 (x) =

x − x 1

x 0 − x 1

, l 1 (x) =

x − x 0

x 1 − x 0

and therefore,

p 1 (x) = f (x 0 )l 0 (x) + f (x 1 )l 1 (x)

= f (x 0

x − x 1

x 0 − x 1

  • f (x 1

x − x 0

x 1 − x 0

f (x 0 )(x − x 1 ) − f (x 1 )(x − x 0

x 0 − x 1

After a rearrangement of terms, we arrive at

p 1 (x) = f (x 0

f (x 1 ) − f (x 0

x 1 − x 0

(x − x 0

This is the linear interpolating polynomial of the function f. Similarly, if we are

given three nodes with corresponding values, then we can generate the quadratic

interpolating polynomial and so on..

Example 8.1.12.

Section 8.1 Polynomial Interpolation

Remark 8.1.14.

Let x 0 , x 1 , · · · , xn be nodes, and f be a function. Recall that computing an in-

terpolating polynomial in Lagrange’s form requires us to compute for each k =

0, 1, · · · , n, the k

th Lagrange’s polynomial lk(x) which depends on the given nodes

x 0 , x 1 , · · · , x n

. Suppose that we have found the corresponding interpolating poly-

nomial p n (x) of f in the Lagrange’s form for the given data. Now if we add one

more node x n+ , the computation of the interpolating polynomial p n+ (x) in the

Lagrange’s form requires us to compute a new set of Lagrange’s polynomials cor-

responding to the set of (n + 1) nodes, and no advantage can be taken of the fact

that p n is already available.

An alternative form of the interpolating polynomial, namely, Newton’s form of

interpolating polynomial , avoids this problem, and will be discussed in the next

section.

8.1.3 Newton’s Form of Interpolating Polynomial

We saw in the last section that it is easy to write the Lagrange form of the interpolating

polynomial once the Lagrange polynomials associated to a given set of nodes have been

written. However we observed in Remark 8.1.14 that the knowledge of p n (in Lagrange

form) cannot be utilized to construct p n+ in the Lagrange form. In this section we

describe Newton’s form of interpolating polynomial , which uses the knowledge of p n in

constructing p n+

Theorem 8.1.15 [Newton’s form of Interpolating Polynomial].

Hypothesis:

  1. Let x 0 , x 1 , · · · , xn be given nodes.
  2. Let the values of a function f be given at these nodes.
  3. Let p n (x) (of degree ≤ n) be the polynomial interpolating the function f at

the nodes x 0 , x 1 , · · · , x n

Conclusion: Then, p n (x) can be written as

pn(x) = A 0 +A 1 (x−x 0 )+A 2 (x−x 0 )(x−x 1 )+A 3

2 ∏

i=

(x−xi)+· · ·+An

n− 1 ∏

i=

(x−xi) (8.5)

where A 0

, A

1

, · · · , A

n are constants.

This form of the interpolating polynomial is called the Newton’s form of inter-

polating polynomial.

Section 8.1 Polynomial Interpolation

Proof.

We show that the interpolating polynomial can be written in the form (8.5) using

mathematical induction.

If n = 0, then the constant polynomial

p 0 (x) = y 0

is the required polynomial and its degree is less than or equal to 0. Thus, by taking

A

0 = y 0 , we see that p 0 (x) is in the form (8.5) as required.

Assume that the result is true for n = k. We will now prove that the result is true

for n = k + 1.

Let the data be represented by

x x 0 x 1 x 2 x 3 · · · x k x k+

y y 0 y 1 y 2 y 3 · · · y k y k+

By the assumption, there exists a polynomial p k (x) of degree less than or equal to k

such that the first k interpolating conditions

p k (x i ) = y i , i = 0, 1, · · · , k

hold. Define a polynomial p k+ (x) of degree less than or equal to k + 1 by

p k+ (x) = p k (x) + c(x − x 0 )(x − x 1 ) · · · (x − x k

where the constant c is such that the (k + 1)

th interpolation condition pk+1(xk+1) =

y k+ holds. This is achieved by choosing

c =

y k+ − p k (x k+

(x k+ − x 0 )(x k+ − x 1 ) · · · (x k+ − x k

Note that p k+ (x i ) = y i for i = 0, 1, · · · , k and therefore p k+ (x) is an interpolating

polynomial for the given data. This proves the result for n = k + 1 with A k+ = c.

By the principle of mathematical induction, the result is true for any natural number

n.

Remark 8.1.16.

Let us recall the equation (8.6) from the proof of Theorem 8.1.4 now.

Section 8.2 Newton’s Divided Differences

form. Thus the quantity f [x 0 , x 1 , · · · , x n ] is well-defined.

  1. More generally, the divided difference f [x i , x i+ , · · · , x i+k ] is the coefficient

of x

k in the polynomial interpolating f at the nodes x i , x i+ , · · · , x i+k .

  1. The Newton’s form of interpolating polynomial may be written, using divided

differences, as

p n (x) = f [x 0 ] +

n ∑

k=

f [x 0 , x 1 , · · · , x k ]

k− 1 ∏

i=

(x − x i ) (8.9)

Example 8.2.3.

As a continuation of Example 8.1.11, let us construct the linear interpolating polyno-

mial of a function f in the Newton’s form. In this case, the interpolating polynomial

is given by

p 1 (x) = f [x 0 ] + f [x 0 , x 1 ](x − x 0

where

f [x 0 ] = f (x 0 ), f [x 0 , x 1

] =

f (x 0 ) − f (x 1

x 0 − x 1

are zeroth and first order divided differences , respectively. Observe that this polyno-

mial is exactly the same as the interpolating polynomial obtained using Lagrange’s

form in Example 8.1.11.

The following result is concerning the symmetry properties of divided differences.

Theorem 8.2.4 [Symmetry].

The divided difference is a symmetric function of its arguments. That is, if z 0 , z 1 , · · · , zn

is a permutation of x 0 , x 1 , · · · , x n , then

f [x 0 , x 1 , · · · , x n ] = f [z 0 , z 1 , · · · , z n

] (8.11)

Proof.

Since z 0 , z 1 , · · · , z n is a permutation of x 0 , x 1 , · · · , x n , which means that the nodes

x 0 , x 1 , · · · , x n have only been re-labelled as z 0 , z 1 , · · · , z n , and hence the polynomial

interpolating the function f at both these sets of nodes is the same. By definition

f [x 0 , x 1 , · · · , x n ] is the coefficient of x

n in the polynomial interpolating the func-

tion f at the nodes x 0 , x 1 , · · · , x n , and f [z 0 , z 1 , · · · , z n ] is the coefficient of x

n in the

Section 8.2 Newton’s Divided Differences

polynomial interpolating the function f at the nodes z 0 , z 1 , · · · , z n

. Since both the

interpolating polynomials are equal, so are the coefficients of x

n in them. Thus, we

get

f [x 0 , x 1 , · · · , x n ] = f [z 0 , z 1 , · · · , z n

].

This completes the proof.

The following result helps us in computing recursively the divided differences of higher

order.

Theorem 8.2.5 [Higher-order divided differences].

Divided differences satisfy the equation

f [x 0 , x 1 , · · · , xn] =

f [x 1 , x 2 , · · · , x n ] − f [x 0 , x 1 , · · · , x n− 1

]

x n − x 0

Proof.

Let us start the proof by setting up the following notations.

  • Let p n (x) be the polynomial interpolating f at the nodes x 0 , x 1 , · · · , x n
  • Let p n− 1 (x) be the polynomial interpolating f at the nodes x 0 , x 1 , · · · , x n− 1
  • Let q(x) be the polynomial interpolating f at the nodes x 1 , x 2 , · · · , x n

Claim: We will prove the following relation between p n− 1 , p n , and q:

p n (x) = p n− 1 (x) +

x − x 0

x n − x 0

q(x) − p n− 1 (x)

Since both sides of the equality in (8.13) are polynomials of degree less than or equal

to n, and pn(x) is the polynomial interpolating f at the nodes x 0 , x 1 , · · · , xn, the

equality in (8.13) holds for all x if and only if it holds for x ∈ { x 0 , x 1 , · · · , x n } and

both sides of the equality reduce to f (x) for x ∈ { x 0 , x 1 , · · · , x n }. Let us now verify

the equation (8.13) for x ∈ { x 0 , x 1 , · · · , x n

  1. When x = x 0

pn− 1 (x 0 ) +

x 0 − x 0

x n − x 0

q(x 0 ) − pn− 1 (x 0 )

= pn− 1 (x 0 ) = f (x 0 ) = pn(x 0 ).

Section 8.3 Error in Polynomial Interpolation

8.2.2 Divided Differences Table

Given a collection of (n + 1) nodes x 0 , x 1 , · · · , x n and the values of the function f at

these nodes, we can construct the Newton’s form of interpolating polynomial pn(x) using

divided differences. As observed earlier, the Newton’s form of interpolation polynomial

has the formula

p n (x) = f [x 0

] +

n ∑

k=

f [x 0 , x 1 , · · · , x k

]

k− 1 ∏

i=

(x − x i

One can explicitly write the formula (8.15) for n = 1, 2, 3, 4, 5, · · ·. For instance, when

n = 5, the formula (8.15) reads

p 5 (x) = f [x 0

]

  • f [x 0 , x 1 ](x − x 0
  • f [x 0 , x 1 , x 2 ](x − x 0 )(x − x 1
  • f [x 0 , x 1 , x 2 , x 3 ](x − x 0 )(x − x 1 )(x − x 2 )

  • f [x 0 , x 1 , x 2 , x 3 , x 4 ](x − x 0 )(x − x 1 )(x − x 2 )(x − x 3 )

  • f [x 0 , x 1 , x 2 , x 3 , x 4 , x 5 ](x − x 0 )(x − x 1 )(x − x 2 )(x − x 3 )(x − x 4

For easy computation of the divided differences in view of the formula (8.12), it is

convenient to write the divided differences in a table form. For n = 5, the divided

difference table is given by

x 0 f (x 0 )

f [x 0 , x 1 ]

x 1 f (x 1 ) f [x 0 , x 1 , x 2 ]

f [x 1 , x 2 ] f [x 0 , x 1 , x 2 , x 3 ]

x 2 f (x 2 ) f [x 1 , x 2 , x 3 ] f [x 0 , x 1 , x 2 , x 3 , x 4 ]

f [x 2 , x 3 ] f [x 1 , x 2 , x 3 , x 4 ] f [x 0 , x 1 , x 2 , x 3 , x 4 , x 5 ]

x 3 f (x 3 ) f [x 2 , x 3 , x 4 ] f [x 1 , x 2 , x 3 , x 4 , x 5 ]

f [x 3 , x 4 ] f [x 2 , x 3 , x 4 , x 5 ]

x 4 f (x 4 ) f [x 3 , x 4 , x 5 ]

f [x 4 , x 5 ]

x 5 f (x 5 )

Comparing the above divided differences table and the interpolating polynomial p 5

given by (8.16), we see that the leading members of each column (denoted in bold font)

are the required divided differences used in p 5 (x).

8.3 Error in Polynomial Interpolation

Let f be a function defined on an interval I = [a, b]. Let p n (x) be a polynomial of

degree less than or equal to n that interpolates the function f at n + 1 nodes x 0 , x 1

Section 8.6 Exercises

8.6 Exercises

Polynomial Interpolation

  1. Let x 0 , x 1 , · · · , x n be distinct nodes. If p(x) is a polynomial of degree less than or

equal to n, then show that

p(x) =

n ∑

i=

p(x i )l i (x),

where l i (x) is the i

th Lagrange polynomial.

  1. Show that the polynomial 1 + x + 2x

2 is an interpolating polynomial for the data

x 0 1 2

y 1 4 11

Find an interpolating polynomial for the new data

x 0 1 2 3

y 1 4 11 -

Does there exist a quadratic polynomial that satisfies the new data? Justify your

answer.

  1. The quadratic polynomial p 2 (x) =

3

4

x

2

1

4

x +

1

2

interpolates the data

x − 1 0 1

y 1

1

2

3

2

Find a node x 3 (x 3 ∈/ {−1, 0, 1}), and a real number y 3 such that the polynomial

p 3 (x) interpolating the data

x − 1 0 1 x 3

y 1 1 / 2 3 / 2 y 3

is a polynomial of degree less than or equal to 2.

  1. Let p(x), q(x), and r(x) be interpolating polynomials for the three sets of data

x 0 1

y y 0 y 1

x 0 2

y y 0 y 2

, and

x 1 2 3

y y 1 y 2 y 3

respectively. Let s(x) be the the interpolating polynomial for the data

x 0 1 2 3

y y 0 y 1 y 2 y 3

If

p(x) = 1 + 2x, q(x) = 1 + x, and r(2.5) = 3,

then find the value of s(2.5).

  1. Obtain Lagrange form of interpolating polynomial for equally spaced nodes.
  2. Find the Largrange form of interpolating polynomial for the data:

x -2 -1 1 3

y -1 3 -1 19