Question #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
1

Expert's answer

2015-12-08T07:54:45-0500

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

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

a. f(x)=cosxf(x) = \cos x

Solution


y0=f(x0)=cos0=1;y_0 = f(x_0) = \cos 0 = 1;y1=f(x1)=cos0.6=0.8253;y_1 = f(x_1) = \cos 0.6 = 0.8253;y2=f(x2)=cos0.9=0.6216;y_2 = f(x_2) = \cos 0.9 = 0.6216;


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


L1(x)={x1xx1x0y0+xx0x1x0y1,for x[x0,x1],x2xx2x1y1+xx1x2x1y2,for x[x1,x2],L_1(x) = \begin{cases} \frac{x_1 - x}{x_1 - x_0} y_0 + \frac{x - x_0}{x_1 - x_0} y_1, & \text{for } x \in [x_0, x_1], \\ \frac{x_2 - x}{x_2 - x_1} y_1 + \frac{x - x_1}{x_2 - x_1} y_2, & \text{for } x \in [x_1, x_2], \end{cases}L1(x)={10.2912x,for x[0,0.6],1.23270.679x,for x[0.6,0.9],L_1(x) = \begin{cases} 1 - 0.2912x, & \text{for } x \in [0, 0.6], \\ 1.2327 - 0.679x, & \text{for } x \in [0.6, 0.9], \end{cases}

f(0.45)0.8690f(0.45) \approx 0.8690 is approximated through the linear Lagrange polynomial: f(0.45)=cos0.45=0.9004f(0.45) = \cos 0.45 = 0.9004.

The absolute error is


0.90040.8690=0.0314.|0.9004 - 0.8690| = 0.0314.


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


L2(x)=l0(x)y0+l1(x)y1+l2(x)y2,L_2(x) = l_0(x) y_0 + l_1(x) y_1 + l_2(x) y_2,


where


l0(x)=(xx1x0x1)(xx2x0x2)l_0(x) = \left(\frac{x - x_1}{x_0 - x_1}\right) \left(\frac{x - x_2}{x_0 - x_2}\right)l1(x)=(xx0x1x0)(xx2x1x2)l_1(x) = \left(\frac{x - x_0}{x_1 - x_0}\right) \left(\frac{x - x_2}{x_1 - x_2}\right)l2(x)=(xx0x2x0)(xx1x2x1)l_2(x) = \left(\frac{x - x_0}{x_2 - x_0}\right) \left(\frac{x - x_1}{x_2 - x_1}\right)

f(0.45)0.8980f(0.45) \approx 0.8980 is approximated through the quadratic Lagrange polynomial.

The absolute error is


0.90040.8980=0.0024.|0.9004 - 0.8980| = 0.0024.


www.AssignmentExpert.com


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!
LATEST TUTORIALS
APPROVED BY CLIENTS