106k views
0 votes
Let f(x)=sin(πx/2). (a) (3 pts) Construct the Lagrange polynomial that interpolates f at x= 0, 3

1
​ , 3
2
​ ,1 (b) (2 pts) Approximate f( 2
1
​ ) using the polynomial obtained in part (a). (c) (5pts) Verify that the theoretical error bound holds with respect to the computation in (b).

User Eran Harel
by
8.1k points

1 Answer

1 vote

Explanation:

Using nodes X0 = 0, X1 = 31, and X2 = 32, we wish to construct a Lagrange polynomial of at most degree 2 for f(x).

P2(x) = L0(x) * f(0) + L1(x) * f(31) + L2(x) * f(32)

= L0(x) * 0 + L1(x) * (-1) + L2(x) * 0

= -L1(x)

= -x(x - 32)/[(31 - 0)(31 - 32)]

= x²/31 - (32/31)x.

Thus, f(21) ≈ P2(21) = 21²/31 - (32/31)(21) ≈ -7.452.

Theoretical error bound = |f'''(€)/3! * 21(21 - 31)(21 - 32)|

= |(π/2)³/6 * 21(21 - 31)(21 - 32)|

≈ 1492.18.

Actual value of f(21) = 1.

Since 1 - (-7.452) ≤ 1492.18, we have verified the result.

User Kennebec
by
8.4k points