University of Florida/Egm6341/s10.team2.niki/HW2

From testwiki
Jump to navigation Jump to search

Problem 1

Statement

Using the following equations find the expressions for π’„π’Š in terms of π’™π’Š and 𝒇(π’™π’Š) where i=0,1,2

𝒇2(𝒙)=𝒑2(𝒙)=𝒄2𝒙2+𝒄1𝒙+𝒄0

(1 p8-3)

𝒑2(𝒙)=π’Š=02(π’π’Š(𝒙)𝒇(π’™π’Š))

(3 p8-3)

Solution

We have the general formula for the Lagrange basis function π’π’Š(𝒙) as

π’π’Š(𝒙)=𝒋=0;π’‹π’Šπ’(xxjxixj)

(2 p7-3)

for the case of Simple Simpson's Rule, n =2 i.e i=0,1,2. For the given interval [a,b]


𝒙0=𝒂

𝒙2=𝒃

𝒙1=a+b2

Expanding equation 3 p8-3 we get:

𝒑2(𝒙)=𝒍0(𝒙)𝒇(𝒙0)+𝒍1(𝒙)𝒇(𝒙1)+𝒍2(𝒙)𝒇(𝒙2) where,


𝒍0(𝒙)=(xx1x0x1)(xx2x0x2);

𝒍1(𝒙)=(xx0x1x0)(xx2x1x2);

𝒍2(𝒙)=(xx0x2x0)(xx1x2x1)

Thus we have the polynomial as 𝒑2(𝒙)=(x2(x2+x1)x+(x1x2)(x0x1)(x0x2)))𝒇(𝒙0)+(x2(x2+x0)x+(x0x2)(x1x0)(x1x2)))𝒇(𝒙1)+(x2(x0+x1)x+(x1x0)(x2x0)(x2x1)))𝒇(𝒙2)

Grouping coefficients of 𝒙2,𝒙1,𝒙0, 𝒑2(𝒙)={f(x0)(x0x1)(x0x2)+f(x1)(x1x0)(x1x2)+f(x2)(x2x0)(x2x1)}𝒙2{f(x0)[x2+x1](x0x1)(x0x2)+f(x1)[x2+x0](x1x0)(x1x2)+f(x2)[x1+x0](x2x0)(x2x1)}𝒙+{f(x0)[x1x2](x0x1)(x0x2)+f(x1)[x0x2](x1x0)(x1x2)+f(x2)[x0x1](x2x0)(x2x1)}

Comparing this equation with eqn 1p8-3 we see that

𝒄2={f(x0)(x0x1)(x0x2)+f(x1)(x1x0)(x1x2)+f(x2)(x2x0)(x2x1)}

(1)

𝒄1={f(x0)[x2+x1](x0x1)(x0x2)+f(x1)[x2+x0](x1x0)(x1x2)+f(x2)[x1+x0](x2x0)(x2x1)}

(2)


𝒄0={f(x0)[x1x2](x0x1)(x0x2)+f(x1)[x0x2](x1x0)(x1x2)+f(x2)[x0x1](x2x0)(x2x1)}

(3)

Problem 6

Statement

For the Lagrange Interpolation Error verify the following:

𝑬(𝒏+1)(𝒙)=𝒇(𝒏+1)(𝒙)0

(1)

Solution

We can write the Lagrange Interpolation error as


𝑬(𝒙)=𝒇(𝒙)𝒇𝒏(𝒙)

differentiating the above expression once we get

𝑬1(𝒙)=𝒇1(𝒙)f𝒏1(𝒙)

differentiating the expression (n+1) times we get

𝑬𝒏+1(𝒙)=𝒇𝒏+1(𝒙)f𝒏𝒏+1(𝒙)

But since 𝒇𝒏(𝒙) is a polynomial of degree n the (n+1)th derivative is zero

𝑬𝒏+1(𝒙)=𝒇𝒏+1(𝒙)0

(1)

Problem 11:To show that Simpson's rule can be used to integrate a cubic polynomial exactly

Statement

Given the polynomial 𝒇3(𝒙)=𝑷3(𝒙)=3+8𝒙12𝒙2+6𝒙3 where 𝒙ϵ[0,1] determine the exact integral 𝑰 and the integral using Simpson's Rule 𝑰𝒏

Solution

Case A: Determination of Exact Integral

𝑰=01(3+8𝒙2𝒙2+6𝒙3)𝒅𝒙


𝑰=[3𝒙+4𝒙223𝒙3+32𝒙4]01


𝑰=3+423+1.5


𝑰=7.833

(1)

Case B: Using Simple Simpson's rule

We have the Simple Simpson's rule as

𝑰2=h3{f(x0)+4f(x1)+f(x2)}

(2 p7-2)

where 𝒉=a+b2=0+12=0.5

𝑰2=0.53{f(0)+4f(0.5)+f(1)} we know 𝒇(0)=3;𝒇(0.5)=7.25;𝒇(1)=15 substituting we get

𝑰2=0.53{3+4(7.25)+15}=0.53{47}

𝑰2=7.833

(2)