0% found this document useful (0 votes)
23 views3 pages

Name: Hillary A. Busque Date: September 1, 2016 Course & Year: Bsece - 4 Subject: Numericals

The document discusses using Lagrange polynomials for polynomial interpolation. Specifically, it provides examples of using quadratic and cubic Lagrange interpolation to approximate values of functions based on given nodes. It also gives an example of forming a Lagrange polynomial of degree 4 to represent the function f(x)=cos(x) over an interval using equally spaced nodes.

Uploaded by

hillary
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views3 pages

Name: Hillary A. Busque Date: September 1, 2016 Course & Year: Bsece - 4 Subject: Numericals

The document discusses using Lagrange polynomials for polynomial interpolation. Specifically, it provides examples of using quadratic and cubic Lagrange interpolation to approximate values of functions based on given nodes. It also gives an example of forming a Lagrange polynomial of degree 4 to represent the function f(x)=cos(x) over an interval using equally spaced nodes.

Uploaded by

hillary
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Name: HILLARY A.

BUSQUE
2016
Course & Year: BSEcE 4
NUMERICALS

Date:

SEPTEMBER 1,

Subject:

In numerical analysis, Lagrange polynomials are used for polynomial


interpolation. For a given set of distinct points and numbers, the Lagrange
xj
polynomial is the polynomial of the least degree that at each point
assumes the corresponding value (i.e. the functions coincide at each point).
Although named after Joseph Louis Lagrange, who published it in 1795, it
was first discovered in 1779 by Edward Waring and it is also an easy
consequence of a formula published in 1783 by Leonhard Euler.
1. Let

f ( x )=x +2/ x

a. Use quadratic Lagrange interpolation based on the nodes


x 0=1, x 1=2, x 2=2.5
to approximate f(1.5) and f(1.2).
x
1
2
1.2
1.5
2.5

f(x)
3
3

P2 ( x )= y o

2.936

+ y1

2.9
3.3

f ( x )=( 3 )
+(3.3)

( xx 1 )( x x2 )
( x 0x 1 )( x 0 x2 )
( xx 0 ) ( xx 2)
( xx 0 ) (xx 1)
+ y2
( x 1x 0 ) ( x 1x 2)
( x 2x 0 ) (x 2x 1)

( x 2 )( x2.5 )
( x 1 )( x2.5 )
+( 3 )
( 12 )( 12.5 )
( 21 )( 22.5 )

( x1 )( x2 )
( 2.51 )( 2.52 )

b. Use cubic Lagrange interpolation based on the nodes


x 0=0.5, x1 =1, x 2=2, x 3=2.5
to approximate f(1.5) and f(1.2).
x
0.5
1
1.2
1.5
2
2.5

f(x)
4.5
3
2.769
6
2.7
3
3.3

P3 ( x )= y o
+ y1

( x x1 ) ( xx 2 ) ( xx 3 )
( x 0x 1 )( x0 x 2) ( x 0x 3 )

( xx 0 ) ( xx 2 ) ( xx 3 )
( x 1x 0 ) ( x1 x2 ) ( x 1x 3 )

+ y2

( xx 0 ) ( xx 1 ) ( xx 3 )
( x 2x 0 ) ( x 2x1 ) ( x 2x 3 )
+ y3

( x x0 ) ( xx 1 ) ( xx 2 )
( x 3x 0 ) ( x 3x 1 ) (x 3x 2)

f(x)

0
0.3
0.6
0.9
1.2

1
0.9553
36
0.8253
36
0.6216
1
0.3623
58

f ( x )=( 4.5 )
+( 3 )

( x1 ) ( x2 ) ( x2.5 )
( x0.5 )( x2 )( x2.5 )
+(3)
( 0.51 )( 0.52 ) ( 0.52.5 )
(10.5 ) ( 12 ) ( 12.5 )

( x0.5 )( x1 ) ( x2.5 )
( x0.5 )( x1 ) (x 2)
+(3.3)
( 20.5 ) ( 21 ) ( 22.5 )
( 2.50.5 ) ( 2.51 ) (2.52)

2. Form a Lagrange polynomial of degree = 4 for the function

f ( x )=cos x

over the interval [0.0, 1.2] using equally spaced nodes.


P4 ( x )= y o

f ( x )=( 1 )

( x x1 ) ( xx 2 ) ( xx 3 )( xx 4 )
( xx 0 ) ( xx 2 ) ( xx 3 ) ( xx 4 )
( xx 0 ) ( xx 1) ( xx
+ y1
+ y2
( x 0 x1 ) ( x 0x 2 ) ( x 0x 3 )( x 0 x 4 )
( x 1x 0 )( x 1x 2 ) ( x 1x 3 )( x 1x 4 )
( x2 x0 ) ( x 2x 1 ) ( x 2

( x0.3 )( x0.6 ) ( x0.9 )( x1.2 )


( x0 ) ( x0.6 )( x0.9 )( x1.2 )
+( 0.96)
( 00.3 ) ( 00.6 ) ( 00.9 )( 01.2 )
( 0.30 )( 0.30.6 )( 0.30.9 ) ( 0.31.2 )

+ ( 0.83 )

( x0 ) ( x0.3 ) ( x0.9 ) ( x1.2 )


( x0 )( x0.3 )( x0.6 )( x1.2 )
(
+ ( 0.62 )
+(0.36)
( 0.60 )( 0.60.3 ) ( 0.60.9 ) ( 0.61.2 )
( 0.90 ) ( 0.90.3 )( 0.90.6 ) ( 0.91.2 )
( 1.2

You might also like