Question #327541

For the given functions f (x), let x0 = 1, x1 = 1.25, and x2 = 1.6. Construct interpolation polynomials of degree at most one and at most two to approximate f (1.4), and find the absolute error.

a. f (x) = sin πx

b. f (x) =cube root of (x − 1)

c. f (x) = log10 (3x − 1)

d. f (x) = e2x − x


1
Expert's answer
2022-04-12T16:04:51-0400

The Lagrange polynomial

are L1,0(x)=xx1x0x1=x1.2511.25=54xL_{1,0}(x) = \frac{x-x_1}{x_0-x_1} = \frac{x-1.25}{1-1.25}=5-4x and L1,1(x)=xx0x1x0=x11.251=4x4L_{1,1}(x) = \frac{x-x_0}{x_1-x_0} = \frac{x-1}{1.25-1}=4x-4 for the first degree. Substituting x = 1.4 get

L1,0(1.4)=0.6L_{1,0}(1.4) = -0.6 and L1,1(1.4)=1.6L_{1,1}(1.4) = 1.6

For second degree

L2,0(x)=(xx1)(xx2)(x0x1)(x0x2)=(x1.25)(x1.6)(11.25)(11.6)=203(1.25x)(1.6x)L_{2,0}(x) = \frac{(x-x_1)(x-x_2)}{(x_0-x_1)(x_0-x_2)} = \frac{(x-1.25)(x-1.6)}{(1-1.25)(1-1.6)}=\frac{20}{3}(1.25-x)(1.6-x) and L2,0(x)=0.2L_{2,0}(x) =-0.2

L2,1(x)=(xx0)(xx2)(x1x0)(x1x2)=(x1)(x1.6)(1.251)(1.251.6)=807(x1)(1.6x)L_{2,1}(x) = \frac{(x-x_0)(x-x_2)}{(x_1-x_0)(x_1-x_2)} = \frac{(x-1)(x-1.6)}{(1.25-1)(1.25-1.6)}=\frac{80}{7}(x-1)(1.6-x) and L2,1(1.4)0.914286L_{2,1}(1.4) \approx 0.914286

L2,2(x)=(xx0)(xx1)(x2x0)(x2x1)=(x1)(x1.25)(1.61)(1.61.25)=10021(x1)(x1.25)L_{2,2}(x) = \frac{(x-x_0)(x-x_1)}{(x_2-x_0)(x_2-x_1)} = \frac{(x-1)(x-1.25)}{(1.6-1)(1.6-1.25)}=\frac{100}{21}(x-1)(x-1.25) and L2,2(1.4)0.285714L_{2,2}(1.4) \approx 0.285714


a) f(x)=sin(πx)f(x)=sin(\pi x) :

f(x0)=sin(π)=0f(x_0)=sin(\pi) = 0 ;

f(x1)=sin(1.25π)=120.707107f(x_1)=sin(1.25 \pi) = \frac{-1}{\sqrt{2}}\approx -0.707107 ;

f(x2)=sin(1.6π)0.951057f(x_2) = sin(1.6 \pi) \approx -0.951057

f(1.4)=f(x0)L1,0(x)+f(x1)L1,1(x)=0(0.6)0.7071071.6=1.13137f(1.4) = f(x_0) L_{1,0}(x) + f(x_1)L_{1,1}(x) = 0(-0.6) -0.707107 \cdot 1.6 = -1.13137

Precise value is -0.951057, and error is (-0.951057) - (-1.13137) =0.180315

For second degree

f(1.4)=f(x0)L2,0(x)+f(x1)L2,1(x)++f(x1)L2,1(x)=0(0.2)0.7071070.9142860.9510570.285714=0.918228f(1.4) = f(x_0) L_{2,0}(x) + f(x_1)L_{2,1}(x) + + f(x_1)L_{2,1}(x) = 0(-0.2) -0.707107 \cdot 0.914286 -0.951057 \cdot 0.285714 = -0.918228

Error is -0.951057-(-0.918228) = -0.0328285


b) f(x)=x13f(x) = \sqrt[3]{x-1}

f(1)=0f(1)=0

f(1.25)0.629961f(1.25) \approx 0.629961

f(1.6)0.843433f(1.6) \approx 0.843433

f(1.4)=f(x0)L1,0(x)+f(x1)L1,1(x)f(1.4) = f(x_0) L_{1,0}(x) + f(x_1)L_{1,1}(x) \approx 1.00794

Precise value is 0.736806, and error is -0.271131

Second degree:

f(1.4)=f(x0)L2,0(x)+f(x1)L2,1(x)++f(x1)L2,1(x)0.816945f(1.4) = f(x_0) L_{2,0}(x) + f(x_1)L_{2,1}(x) + + f(x_1)L_{2,1}(x) \approx 0.816945

error -0.0801384


c)

f(x)=log10(3x1)f(x) = log_{10}(3x-1)

f(x0)0.30103f(x_0) \approx 0.30103

f(x1)0.439333f(x_1) \approx 0.439333

f(x2)0.579784f(x_2) \approx 0.579784

f(1.4)=f(x0)L1,0(x)+f(x1)L1,1(x)0.522314f(1.4) = f(x_0) L_{1,0}(x) + f(x_1)L_{1,1}(x) \approx 0.522314

Precise value is 0.50515, and error is -0.0171643

Second degree:

f(1.4)=f(x0)L2,0(x)+f(x1)L2,1(x)++f(x1)L2,1(x)0.507122f(1.4) = f(x_0) L_{2,0}(x) + f(x_1)L_{2,1}(x) + + f(x_1)L_{2,1}(x) \approx 0.507122

error is -0.00197208


d)

f(x)=e2xxf(x)= e^{2x}-x

f(x0)6.38906f(x_0)\approx 6.38906

f(x1)10.9325f(x_1)\approx 10.9325

f(x2)22.9325f(x_2) \approx 22.9325

f(1.4)=f(x0)L1,0(x)+f(x1)L1,1(x)13.6586f(1.4) = f(x_0) L_{1,0}(x) + f(x_1)L_{1,1}(x) \approx 13.6586

Precise value is 15.0446, and error is 1.38609

Second degree:

f(1.4)=f(x0)L2,0(x)+f(x1)L2,1(x)++f(x1)L2,1(x)15.2698f(1.4) = f(x_0) L_{2,0}(x) + f(x_1)L_{2,1}(x) + + f(x_1)L_{2,1}(x) \approx 15.2698

error is -0.225117


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