Answer 56855
Answer 56855
Answer 56855
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;
𝑓(0.45) ≈ 0.8690 is approximated through the linear Lagrange polynomial: 𝑓(0.45) = cos 0.45 = 0.9004.
where
𝑥 − 𝑥1 𝑥 − 𝑥2
𝑙0 (𝑥) = ( )( )
𝑥0 − 𝑥1 𝑥0 − 𝑥2
𝑥 − 𝑥0 𝑥 − 𝑥2
𝑙1 (𝑥) = ( )( )
𝑥1 − 𝑥0 𝑥1 − 𝑥2
𝑥 − 𝑥0 𝑥 − 𝑥1
𝑙2 (𝑥) = ( )( )
𝑥2 − 𝑥0 𝑥2 − 𝑥1
www.AssignmentExpert.com