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)=cosx
Solution
y0=f(x0)=cos0=1;y1=f(x1)=cos0.6=0.8253;y2=f(x2)=cos0.9=0.6216;
a) The Lagrange interpolation polynomial of degree at most 1 is constructed as follows:
L1(x)={x1−x0x1−xy0+x1−x0x−x0y1,x2−x1x2−xy1+x2−x1x−x1y2,for x∈[x0,x1],for x∈[x1,x2],L1(x)={1−0.2912x,1.2327−0.679x,for x∈[0,0.6],for x∈[0.6,0.9],f(0.45)≈0.8690 is approximated through the linear Lagrange polynomial: f(0.45)=cos0.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:
L2(x)=l0(x)y0+l1(x)y1+l2(x)y2,
where
l0(x)=(x0−x1x−x1)(x0−x2x−x2)l1(x)=(x1−x0x−x0)(x1−x2x−x2)l2(x)=(x2−x0x−x0)(x2−x1x−x1)f(0.45)≈0.8980 is approximated through the quadratic Lagrange polynomial.
The absolute error is
∣0.9004−0.8980∣=0.0024.
www.AssignmentExpert.com
Comments