0% found this document useful (0 votes)
56 views1 page

Answer 56855

This document provides the solution to an interpolation problem. [1] It gives values for the function f(x)=cos(x) at points x0=0, x1=0.6, and x2=0.9. [2] It constructs linear and quadratic Lagrange interpolation polynomials to approximate f(0.45) and finds the absolute error for each. [3] The linear interpolation has an error of 0.0314 while the quadratic interpolation has a lower error of 0.0024.

Uploaded by

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

Answer 56855

This document provides the solution to an interpolation problem. [1] It gives values for the function f(x)=cos(x) at points x0=0, x1=0.6, and x2=0.9. [2] It constructs linear and quadratic Lagrange interpolation polynomials to approximate f(0.45) and finds the absolute error for each. [3] The linear interpolation has an error of 0.0314 while the quadratic interpolation has a lower error of 0.0024.

Uploaded by

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

Answer on Question #56855 – Math – Algorithms | Quantitative Methods

For the given functions f (x), let x0 = 0, x1 = 0.6, and x2 = 0.9. Construct interpolation polynomials of degree
at most one and at most two to approximate f (0.45), and find the absolute error.

a. f (x) = cos x

Solution

𝑦0 = 𝑓(𝑥0 ) = cos 0 = 1;

𝑦1 = 𝑓(𝑥1 ) = cos 0.6 = 0.8253;

𝑦2 = 𝑓(𝑥2 ) = cos 0.9 = 0.6216;

a) The Lagrange interpolation polynomial of degree at most 1 is constructed as follows:


𝑥1 − 𝑥 𝑥 − 𝑥0
𝑦0 + 𝑦 , 𝑓𝑜𝑟 𝑥 ∈ [𝑥0, 𝑥1],
𝑥 −𝑥 𝑥1 − 𝑥0 1
𝐿1 (𝑥) = { 𝑥1 − 𝑥0 𝑥 − 𝑥1
2
𝑦1 + 𝑦 , 𝑓𝑜𝑟 x ∈ [x1, x2],
𝑥2 − 𝑥1 𝑥2 − 𝑥1 2

1 − 0.2912𝑥, 𝑓𝑜𝑟 𝑥 ∈ [0, 0.6],


𝐿1 (𝑥) = {
1.2327 − 0.679𝑥, 𝑓𝑜𝑟 𝑥 ∈ [0.6, 0.9],

𝑓(0.45) ≈ 0.8690 is approximated through the linear Lagrange polynomial: 𝑓(0.45) = cos 0.45 = 0.9004.

The absolute error is

|0.9004 − 0.8690| = 0.0314.

b) The Lagrange interpolation polynomial of degree at most 2 is constructed as follows:

𝐿2 (𝑥) = 𝑙0 (𝑥)𝑦0 + 𝑙1 (𝑥)𝑦1 + 𝑙2 (𝑥)𝑦2 ,

where

𝑥 − 𝑥1 𝑥 − 𝑥2
𝑙0 (𝑥) = ( )( )
𝑥0 − 𝑥1 𝑥0 − 𝑥2
𝑥 − 𝑥0 𝑥 − 𝑥2
𝑙1 (𝑥) = ( )( )
𝑥1 − 𝑥0 𝑥1 − 𝑥2
𝑥 − 𝑥0 𝑥 − 𝑥1
𝑙2 (𝑥) = ( )( )
𝑥2 − 𝑥0 𝑥2 − 𝑥1

𝑓(0.45) ≈ 0.8980 is approximated through the quadratic Lagrange polynomial.

The absolute error is

|0.9004 − 0.8980 | = 0.0024.

www.AssignmentExpert.com

You might also like