University of Florida/Egm6341/s10.Team2/HW2

From testwiki
Revision as of 18:23, 20 November 2023 by imported>ShakespeareFan00
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Problem-1: Expressions for co-efficients of second degree Newton-Cotes integration polynomial

P. 9-1 of Lecture 9 Notes

Problem 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)

Inference: This solution essentially shows the equivalence of the two methods for the Simpson's rule i.e. cubic polynomial and using Lagrange basis functions.


Solution for problem 1:Egm6341.s10.team2.niki 00:18, 8 February 2010 (UTC)

Proofread problem 1: Srikanth Madala 07:04, 11 February 2010 (UTC)

Problem-2: Application of Newton-Cotes method to derive the simple Simpson's rule

P. 9-1 of Lecture 9 Notes

Problem Statement

Derive the simple Simpson's rule using Eq.(4) on slide 8-3 Lecture-8 notes i.e. the second degree polynomial of Newton-Cotes method: P2(x)=i=02li(x)f(xi)

Solution

I2(f) =x0x2f2(x).dx=x0x2P2(x).dx
=x0x2i=02li(x)f(xi)dx
=x0x2[l0(x)f(x0)+l1(x)f(x1)+l2(x)f(x2)]dx

But we know that li(x)=j=0jij=2xxjxixj

So we get the values of l0(x),l1(x) and l2(x) as follows:

l0(x)=(xx1x0x1)(xx2x0x2)

l1(x)=(xx0x1x0)(xx2x1x2)

l2(x)=(xx0x2x0)(xx1x2x1)

But we know that x1=(x0+x2)2 or 2x1=(x0+x2)

l0(x)=(2xx0x2)(2x0x0x2)(xx2)(x0x2)=2x2(3x2+x0)x+(x22+x2x0)(x0x2)2

Similarily by substituting the value of x1 in the equations of l1(x) and l2(x), we get:

l1(x)=4(x2(x0+x2)x+x0x2)(x0x2)2

l2(x)=(2xx0x2)(2x2x0x2)(xx0)(x2x0)=2x2(3x0+x2)x+(x02+x2x0)(x0x2)2

Now plugging back the values of l0(x),l1(x) and l2(x) in the Equation for I2(f) , we get:

I2(f)=x0x2[(2x2(3x2+x0)x+(x22+x2x0)(x0x2)2)f(x0)+(4(x2(x0+x2)x+x0x2)(x0x2)2)f(x1)+(2x2(3x0+x2)x+(x02+x2x0)(x0x2)2)f(x2)]dx

Now isolating the x2 terms, x terms and constant terms, we get three consolidated terms as follows:

Term-1: x2 -term

x2(x0x2)2[2f(x0)4f(x1)+2f(x2)]

Integrating this term between limits x0 and x2, we get:

x23x033(x0x2)2[2f(x0)4f(x1)+2f(x2)]=(x22+x02+x2x0)3(x0x2)[2f(x0)4f(x1)+2f(x2)]

Term-2: x -term

x(x0x2)2[(3x2+x0)f(x0)4(x2+x0)f(x1)+(3x0+x2)f(x2)]

Integrating this term between limits x0 and x2, we get:

x22x022(x0x2)2[(3x2+x0)f(x0)4(x2+x0)f(x1)+(3x0+x2)f(x2)]=x2+x02(x2x0)[(3x2+x0)f(x0)4(x2+x0)f(x1)+(3x0+x2)f(x2)]

Term-3: Constant term

1(x0x2)2[(x22+x2x0)f(x0)4(x2x0)f(x1)+(x02+x2x0)f(x2)]

Integrating this term between limits x0 and x2, we get:

x2x0(x2x0)2[(x22+x2x0)f(x0)4(x2x0)f(x1)+(x02+x2x0)f(x2)]=1(x2x0)[(x22+x2x0)f(x0)4(x2x0)f(x1)+(x02+x2x0)f(x2)]

Note that I2(f)=Term1+Term2+Term3

Now consolidating the coefficients of f(x0),f(x1)andf(x2) in all the three terms, we get:

Consolidated Coefficient of f(x0) as:

=1x2x0[23x22+23x02+23x2x032x2212x2x032x2x012x02+x22+x2x0]
=1x2x0[(1+2332)x22+(2312)x02+(231232+1)x0x2]
=16(x2x0)[(x2x0)2]=(x2x0)6



Consolidated Coefficient of f(x1) as:

=1x2x0[43x2243x0243x2x0+42x22+42x02+(42)2x2x04x2x0]
=46(x2x0)[(x2x0)2]=4(x2x0)6



Consolidated Coefficient of f(x2) as:

=1x2x0[23x22+23x02+23x2x032x2x032x0212x2212x2x0+x02+x2x0]
=1x2x0[(2312)x22+(2332+1)x02+(231232+1)x0x2]
=16(x2x0)[(x2x0)2]=(x2x0)6



Now the value of I2(f) is the sum of all the consolidated coefficient multiplied by their respective f(xi) term. i.e.

I2(f) =(x2x0)6[f(x0)]+4(x2x0)6[f(x1)]+(x2x0)6[f(x2)]
=(x2x0)6[f(x0)+4f(x1)+f(x2)]=h3[f(x0)+4f(x1)+f(x2)]

=h3[f(x0)+4f(x1)+f(x2)]

Where h:=(x2x0)2

Thus, the simple Simpson's rule is derived using the Lagrange polynomial of second degree.


Solution for problem 2: Srikanth Madala 07:04, 11 February 2010 (UTC)

Proofread problem 2:

Problem-3: Study of Newton-Cotes method of numerical integration with the help of an example

Problem Statement

P.9-2 of Lecture 9 Notes

For the function:

F(x)=expx1x on the interval between 0 and 1 and letting x0=aandxn=b

Consider: n=1,2,4,8,16.

1) Construct Fn(x)=inli,n(x)f(xi)

Plot Fn for n=1,2,4,8,16

2) Compute the integral for n=1,2,4,8 and compare to I=1.3179022

abFn(x)dx

3) for n=4 plot:

l0,l1,l2

1: Calculation of Function

Fn(x)=inLi,n(x)F(xi)

For n=1

x0=0x1=1

Fn(x)=xf(x1)xf(x0)+f(x0)

For n=2

x0=0x1=0.5x2=1

Fn(x)=(2x23x+1)f(x0)+(4x2+4x)f(x1)+(2x2x)f(x2)

For n=4

x0=0x1=0.25x2=0.5x3=0.75x4=1

Fn(x)=L0(x)F(x0)+L1(x)F(x1)+L2(x)F(x2)+L3(x)F(x3)+L4(x)F(x4)

L0=10.66667x426.66667x3+23.33333x28.33333x+1

L1=42.66667x4+96x369.33333x2+16x

L2=64x4128x3+76x212x

L3=42.66667x4+74.66667x337.33333x2+5.33333x

L4=10.66667x416x3+7.33333x2x

For n=8

x0=0x1=18x2=28x3=38x4=48x5=58x6=68x7=78x8=88

Fn(x)=L0(x)F(x0)+L1(x)F(x1)+L2(x)F(x2)+L3(x)F(x3)+L4(x)F(x4)+L5(x)F(x5)+L6(x)F(x6)+L7(x)F(x7)+L8(x)F(x8)

L0=416.10158x81872.45714x7+3549.86667x63686.40x5+2280.53334x4854.40x3+187.49841x221.74286x+1

L1=3328.81269x8+14563.55555x726578.48889x6+26168.88889x514973.15556x4+4963.55556x3879.54286x2+64x

L2=11650.84445x849516.08889x7+87017.24445x681464.88889x5+43488.71111x413051.02222x3+1987.2x2112x

L3=23301.688889x8+96119.46667x7162747.73333x6+145408x573181.86667x4+20403.2x32848.71111x2+149.33333x

L4=29127.11111x8116508.44444x7+190236.44444x6162929.77778x5+78172.44444x420721.77778x3+2764x2140x

L5=23301.68889x8+90294.04444x7142358.75556x6+117464.17778x554294.75556x4+13912.17778x31804.8x2+89.6x

L6=11650.84445x843690.66666x7+66628.26667x653248.0x5+23918.93333x45984x3+761.95556x237.33333x

L7=3328.81267x8+12066.94603x717840.35555x6+13880.88889x56098.48889x4+1499.02222x3188.34286x2+9.14286x

L8=416.10159x81456.35556x7+2093.51111x61592.88889x5+687.64444x4166.75556x3+20.74285x2x

For n=16

L0=881657.95157x167494092.58831x15+29273799.17310x1469671642.03199x13+112925052.51958x12131967887.58325x11+114825387.35065x1075729669.30819x9+38171908.26140x814714527.588281x7+04309632.78652x6945274.82454x5+151495.79946x417046.98375x3+1260.15769x254.09166x+1

L1=14106527.22506x16+119023823.46147x15460941797.80334x14+1085937410.14913x131738929752.17911x12+2002803091.82081x111712031004.37163x10+1104672771.15791x9541708483.98513x8+201575661.16345x756355645.76161x6+11602169.33258x51698797.20815x4+166576.91462x39751.46595x2+256x

L2=105798954.18798x160886066241.32429x15+3402097620.60708x147935334841.26295x13+12559089447.19286x1214266260329.09093x11+11995763940.94187x107588089824.36582x9+3632117763.32303x81311728590.17858x7+353189860.61015x669284246.36891x5+9518965.13969x4855767.40852x3+44247.99734x2960x

L3=493728452.87722x16+4104117764.54188x1515623805456.08729x14+36086656014.89820x1356471781408.17665x12+63313558032.58708x1152430924785.25504x10+32577816415.35461x915267928048.50856x8+5377398940.34311x71405132059.13719x6+265891640.65593x534982965.07744x4+2987004.95254x3145624.88060x2+2986.66667x

L4=1604617471.8510x1613238094142.7704x15+49968790959.3588x14114310190758.3826x13+176946047896.0571x12195945043427.5014x11+159995944121.3113x1097829012110.5894x9+45015620008.1122x815526535208.6470x7+3961897869.3057x6729925713.3421x5+93240926.6909x47715278.7671x3+364667.3131x27280.0000x

L5=3851081932.4423x16+31530733321.8714x15118014600625.0386x14+267446169700.4090x13409679701374.1887x12+448410826284.2035x11361428908733.8343x10+217840661558.8782x998659688548.6735x8+33441903834.1596x78373881063.3471x6+1512122601.3085x5189195339.1544x4+15337681.5698x3711343.3212x2+13977.6x

L6=7060316876.1442x1657365074618.6718x15+212912680796.2242x14478088254093.5941x13+725020725291.7742x12784916071782.2535x11+625178174985.6762x10372001376200.4074x9+166180125282.1892x855516389946.1491x7+13692893124.6509x62434925873.1974x5+300081159.6671x423981811.0600x3+1098163.6741x221354.6667x

L7=10086166965.920x16+81319721162.733x15299314884531.628x14+666093322863.382x13+1000446772071.373x12+1072017171171.158x11844594918904.077x10+496837139865.232x9219320381819.450x8+72381528563.948x717635280331.068x6+3098508847.931x5377514324.910x4+29854977.045x31354651.574x2+26148.571x

L8=11346937836.660x1690775502693.283x15+331366044011.222x14730991010946.104x13+1087849920454.064x121154501752969.400x11+900551858718.191x10524364914637.391x9+229090002005.604x874830969058.400x7+18049489433.320x63140942275.210x5+379279801.510x429754780.212x3+1340839.429x225740x

L9=10086166965.9203x16+80058950291.9925x15289859103001.0773x14+633997839407.8629x13935238816157.1799x12+983640799863.9704x11760304481367.9756x10+438676146116.2794x9189931298320.0814x8+61497840304.9114x714709663906.2828x6+2539758045.4894x5304498045.2923x4+23737343.7162x31063948.1905x2+20337.7778x

L10=7060316876.1442x1655599995399.6357x15+199674586653.4538x14433133892733.7696x13+633595137618.2660x12660801882755.2526x11+506520525181.9884x10289867863581.2933x9+124513226619.0337x840013170290.0740x7+9503307923.1606x61630193342.9661x5+194307522.7623x415070044.2088x3+672565.1911x212812.8x

L11=3851081932.4423x16+30086577597.2055x15107183432690.0446x14+230637122421.3279x13334693607740.9036x12+346333877641.7664x11263452751068.9336x10+149663429178.3096x963841287725.7351x8+20382171194.1772x74811733315.5251x6+820893779.1809x597369178.8764x4+7519914.5780x3334427.5394x2+6353.4545x

L12=1604617471.8510x1612435785406.8449x15+43951475439.9177x1493838781918.2841x13+135144509146.9397x12138823173541.3109x11+104864824822.2035x1059179379524.2647x9+25088338392.5610x87964186416.2542x7+1870391859.2768x6317606286.2109x5+37517640.3682x42887280.1637x3+128026.8822x22426.6667x

L13=493728452.87722x16+3795537481.49362x1513309453333.22533x14+28202188704.66898x1340323751088.42652x12+41138969287.27365x1130876804370.45528x10+17321211261.59502x97302784476.34160x8+2306623062.41091x7539263122.24266x6+91202614.92199x510735523.07630x4+823698.40506x336433.35509x2+689.23077x

L14=105798954.18797x16806717025.68331x15+2806978503.29972x145904490853.45158x13+8384576805.58060x128499641805.10702x11+6341859902.60960x103538432902.20016x9+1484500201.94362x8466805633.89329x7+108701004.725845x618319599.810063x5+2149846.10200x4164522.71173x3+7261.55064x2137.14286x

L15=14106527.22506x16+106680612.13954x15368367712.88886x14+769401541.678536x131085486894.98980x12+1093842237.27907x11811729100.16131x10+450678677.52992x9188239271.99821x8+58958123.91421x713680883.41476x6+2298568.99135x5269024.36205x4+20541.40071x3904.95995x2+17.06667x

L16=881657.95157x166612434.63675x15+22661364.53636x1447010277.49563x13+65914775.02395x1266053112.55929x11+48772274.79135x1026957394.51683x9+11214513.74456x83500013.84371x7+809618.94280x6135655.88173x5+15839.91772x41207.06603x3+53.09166x2x

2:Integral Comparison

Template:Center topIntegrals using Newton CotesTemplate:Center bottom
Actual Value 1.3179022
n Estimated Value Percent Difference
n=1 1.35915 3.12981%
n=2 1.318008 .00802791%
n=4 1.318009 .00810379%
n=8 1.31790215 3.7939E-6

3: Lagrange Polynomial Plots

File:Egm6341.s10.Team2.Hw2problem3c.jpg

The plots for l3 and l4 (3rd and 4th Lagrange Polynomial) are not necessary to be plotted as their graph are symmetrical to one another (a mirror image of the l0 and l1 polynomials).


Solution for problem 3: Guillermo Varela

Problem-4: Simple to composite Simpson's rule


Solution for problem 4: Egm6341.s10.team2.lee 18:48, 7 February 2010 (UTC)

Proofread problem 4:

Problem-5: Error Bound

Refer to P. 11-1 on Lecture-11 Notes

Problem Statement

Find n if:

|fnT(7π8)f(7π8)||f4L(7π8)f(7π8)||q4+1(t)|(4+1)!

For f(x)=sin(x) and x0=0,x1=π4,x2=π2,x3=3π4,x4=1

Solution

Constructing the Lagrangian Interpolating Function:

f4L(x)=P4(x)=i=04li,4(x)f(xi)

Where

li,4(x)=j=0,j44xxjxixj

The Lagrangian Error

E4L(7π8)=|f4L(7π8)f(7π8)||q5(7π8)|5!

By Computing

f4L(7π8),f(7π8),q5(7π8)5!

Must plot the functions to compute

E4L(7π8)=1.4808e3

The Taylor Series Error

|fnT(7π8)f(7π8)|

For n=0,1,2,3...

n=0

|f0T(x)f(x)|=|sin(x)sin(x)|=0

n=1

=|12[1+7π8π41!]sin(7π8)|

=1.7128

...n=9

|fnT(7π8)f(7π8)|=6.31E4E4L(7π8)=1.4808e3


Solution for problem 5:Egm6341.s10.team2.patodon 21:43, 10 February 2010 (UTC)

Proofread problem 5:

Problem 6: (n+1)th derivative of Lagrange Interpolation Error

P. 12-2 reference: Lecture-12 Notes

Problem 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)


Solution for problem 6: Egm6341.s10.team2.niki 00:20, 8 February 2010 (UTC)
Proofread problem 6:

Problem-7: Intermediate step in the proof of Error in Newton Cotes method

P. 12-3 (top); reference: Lecture-12 Notes

Problem Statement

To Prove that the (n+1)th derivative of qn+1(x) is (n+1)!

Solution

We know that by definition qn+1(x) is:

qn+1(x)=j=0n(xxj)

Expanding the above terms in the product, we get:

qn+1(x)=(xx0)(xx1)(xx2).....(xxn)

We see that the above expression is a (n+1)th degree polynomial in x

Let it be expressed as:

qn+1(x)=xn+1+C0xn+C1xn1+C2xn2+.....+Cnx0

Note that here the coefficient of xn+1 is 1. As we successively differentiate the qn+1(x) term (n+1) times, all the lower degree terms that are less than (n+1) vanish. Therefore, we are concerned only about the (n+1)th degree term i.e. xn+1 as we successively differentiate the equation.

ddx[qn+1(x)]=(n+1)x(n+1)1+otherterms

d2dx2[qn+1(x)]=(n+1)((n+1)1)x(n+1)2+otherterms



dn+1dxn+1[qn+1(x)]=(n+1)((n+1)1)((n+1)n)x(n+1)(n+1) =(n+1)((n+1)1)((n+1)n) =(n+1)(n)21 =(n+1)!

Thus, we proved that the (n+1)th derivative of qn+1(x) is (n+1)!


Solution for problem 7: Egm6341.s10.team2.madala 11:58, 8 February 2010 (UTC)

Proofread problem 7:

Problem-8: Geometric Interpretation of G(x) Error for Log(x)

P.12-3

Problem Statement

Let F(x)=log(x)andt=2x0=3x1=4...x6=9

Plot:

1) A graph of F(x) and Fn(x)

2) A plot of the Lagrange Polynomial when i=3

3) A plot of qn+1(t) when n=6

Part 1

The Lagrange Interpolation Function is as follows:

Fn=4.92641E6x6+.0002125+.0039x4+.039876x3.25286x2+1.114899x.77941

The plot is as follows:

File:Egm6341.s10.Team2.Hw2problem81.jpg

Part 2

The Lagrange Polynomial is as follows:

L3(x)=0.027777778x6+x514.61111111x4+110.6666667x3457.3611111x2+976.3333333x840

The plot as follows: File:Egm6341.s10.Team2.Hw2problem82.jpg

Part 3

q7(x)=x742x6+742x57140x4+40369x3133938x2+241128x181440

The Plot as Follows:

File:Egm6341.s10.Team2.Hw2problem83.jpg


Solution for problem 8:

Proofread problem 8: Srikanth Madala 07:04, 11 February 2010 (UTC)

Problem-9: Error in simple Trapezoidal rule

File:9.JPG


Solution for problem 9: Egm6341.s10.team2.lee 20:48, 9 February 2010 (UTC)

Proofread problem 9:

Problem 10: Simple Simpson's Rule Error

P. 13-2

Problem Statement

Show that the Error for the simple simpson's rule is:

n=2q3(x)=(xx0)(xx1)(xx2)

|E2|=(ba)4192M3=24h4M3192

h=a+b2

Solution

The error can be written:

M33!ab|(xa)(xa+b2)(xb)|dx

with x0=ax1=a+b2x2=b

The Integral can be evaluated as follows:

ab|(xa)(xa+b2)(xb)|dx=ab(xa)(xa+b2)(bx)dx

ab(xbx2ab+xa)(xa+b2dx

abx3+x2((b+a)+(a+b2)+x(abba+b2a(b+a2))+ab(a+b2)dx

After algebraic manipulation and simplification the following is obtained:

14[b4a4+(2a+2b)(b3a3)+(a2+b2)(b2a2)+(a+b)(2ab22a2b)]

which reduces to:

132(ba)4

This result is used in the error function to yield:

(ba)432M33!=(ba)4192M3=h416192M3


Solution for problem 10: Guillermo Varela

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

P. 13-3, reference: Lecture-13 Notes

Problem 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)

Conclusion

From the above we see that 𝑰=𝑰2=7.833 which proves that the Simpsons rule can integrate a cubic polynomial exactly


Solution for problem 11: Egm6341.s10.team2.niki 00:23, 8 February 2010 (UTC)

Proofread problem 11:

Problem-12: Differentiation of a definite integral


Solution for problem 12:Egm6341.s10.team2.lee 20:54, 9 February 2010 (UTC)

Proofread problem 12:

Problem-13: Intermediate step in proving the tight error bound of the Simpson's rule


Solution for problem 13: Egm6341.s10.team2.lee 20:47, 9 February 2010 (UTC)

Proofread problem 13: Srikanth Madala 07:04, 11 February 2010 (UTC)

Problem-14: An intermediate step in the proof of tight error bound of the simple Simpson's rule

P. 15-2 (bottom), Refer: Lecture-15 Notes

Title

To Prove that: e(3)(t)=t3[F(3)(t)F(3)(t)] which is an intermediate step in the proof of tight error bound of simple Simpson's rule

Solution

We know by the definition e(t)

e(t) =[ttF(τ).dτ](t3)[F(t)+4F(0)+F(t)]
=[tkF(τ).dτ+ktF(τ).dτ](t3)[F(t)+4F(0)+F(t)]


Differentiating with respect to 't', we get:

e(1)(t)=[F(t)+F(t)](13)[F(t)+4F(0)+F(t)](t3)[F(t)+F(t)]

Again Differentiating with respect to 't', we get:

e(2)(t) =[F(t)+F(t)](13)[F(t)+F(t)](13)[F(t)+F(t)](t3)[F(t)+F(t)]
=(13)[F(t)+F(t)](t3)[F(t)+F(t)]


Again Differentiating with respect to 't', we get:

e(3)(t) =(13)[F(t)+F(t)](13)[F(t)+F(t)](t3)[F(t)+F(t)]
=t3[F(t)F(t)]=t3[F(3)(t)F(3)(t)]


Thus Proved.


Solution for problem 14: Srikanth Madala 07:04, 11 February 2010 (UTC)

Proofread problem 14:

Problem-15: Relationship between ζ and ζ 4

P. 15-3 on Lecture-15 Notes

Problem Statement

Proof:

F(4)(ζ4)90=(ba)4f(4)(ζ)1440

Solution

Given:

x(t)=x1+htandh=ba2

dx(t)dt=h

F(t)=F(x(t))

F1(t)=df(x(t))dt=df(x)dxdxdt=f1(x)h

F2(t)=df1(x(t))dt=hdf1(x)dxdxdt=f2(x)h2

F3(t)=df2(x(t))dt=h2df2(x)dxdxdt=f3(x)h3

F4(t)=df3(x(t))dt=h3df3(x)dxdxdt=f4(x)h4

The next step is to substitute h, and manipulate the equations as follows:

F4(t)=f4(x)(ba)416

F4(ζ4)=(ba)416f4(x)

F4(ζ4)90=(ba)41440F4(x)

It is then seen that the relation between ζandζ4 must be:

ζ=x1+hζ4


Solution for problem 15:

Proofread problem 15:

Problem 16: Illustration of Runge Phenomenon

P. 16-1 on Lecture-16 Notes

Problem Statement

Given data: I=55(11+x2)dx
To find:

  1. Using Newton-Cotes for n=1,2,315 find the numerical integral In, and find Exact Integral I also for comparison
  2. Plot f,fn for selected values of n=1,2,3,8,12
  3. Plot In vs n and prove that the value of In does not converge with increasing value of n
  4. Prove that the weights Wi,n:=abli,n(x)dx for n8 are not all positive and plot the li,n(x) for i=1,2,38 with n=8

Solution

1. From the below Matlab code, we generate the values of I and various values of In as tabulated below:

Template:Center topIntegrals using Newton CotesTemplate:Center bottom
Exact Integral value (I i.e 'IE' in Matlab code) 2 Arctan(5)=2.7468
n Numerical Integral Value (I_{n} i.e 'I' in Matlab code) Percent Difference
n=1 0.3846 614.1684
n=2 6.7949 -59.5754
n=3 2.0814 31.9659
n=4 2.3740 15.7033
n=5 2.3077 19.0281
n=6 3.8704 -29.0314
n=7 2.8990 -5.2499
n=8 1.5005 83.0604
n=9 2.3986 14.5160
n=10 4.6733 -41.2235
n=11 3.2448 -15.3469
n=12 -0.3129 -977.7504
n=13 1.9198 43.0777
n=14 7.8995 -65.2284
n=15 4.1556 -33.9006



2. We already know that:

f(x)=(11+x2)

And from Matlab code below we know that:

f1(x)=126

f2(x)=1/130*y*(1/10*y+1/2)+(1/5*y+1)*(1/5*y+1)+1/130*(1/10*y+1/2)*y

f3(x)=1/26*(3/10*y1/2)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+2)*(2/5*y+5/3)*(3/10*y+3/2)+8/145*(2/15*y+2/3)*(3/20*y+5/8)*(6/35*y+4/7)*(1/5*y+1/2)*(6/25*y+2/5)*(3/10*y+1/4)*y*(3/5*y1/2)*(6/5*y2)*(6/5*y+4)*(3/5*y+5/2)*(2/5*y+2)+27/1090*(3/25*y+3/5)*(2/15*y+5/9)*(3/20*y+1/2)*(6/35*y+3/7)*(1/5*y+1/3)*(6/25*y+1/5)*y*(2/5*y1/3)*(3/5*y1)*(6/5*y3)*(6/5*y+5)*(3/5*y+3)+216/16525*(6/55*y+6/11)*(3/25*y+1/2)*(2/15*y+4/9)*(3/20*y+3/8)*(6/35*y+2/7)*(1/5*y+1/6)*y*(3/10*y1/4)*(2/5*y2/3)*(3/5*y3/2)*(6/5*y4)*(6/5*y+6)+1/130*(1/10*y+1/2)*(6/55*y+5/11)*(3/25*y+2/5)*(2/15*y+1/3)*(3/20*y+1/4)*(6/35*y+1/7)*y*(6/25*y1/5)*(3/10*y1/2)*(2/5*y1)*(3/5*y2)*(6/5*y5)

Using the above equations, we generate plots (as show in the picture below) of the function f(x),fn(x) for selected values of n=1,2,3,8,12





3. The following picture is generated using the Matlab code below and from the graph we can observe that the value of In does not converge with increasing value of n
For each projected dotted line from X-axis on to the blue curve, we have a distinct numerical value of In on the Y-axis. The Exact Integral- I is the green straight line on the plot. We can clearly see that there is no convergence in the value of In(on Y-axis) as n (on X-axis) value increases.





4. The Values of weights are evaluated by integrated the Lagrange polynomials within the integration limits and they are presented in the table below. It can be noted that the Bold weights in the table are negative

Template:Center topWeights of the functionTemplate:Center bottom

n-value

W0 Value

W1 Value

W2 Value

W3 Value

W4 Value

W5 Value

W6 Value

W7 Value

W8 Value

W9 Value

W10 Value

W11 Value

W12 Value

W13 Value

W14 Value

W15 Value

8 989/2835 5888/2835 -928/2835 10496/2835 -908/567 10496/2835 -928/2835 5888/2835 989/2835
9 2857/8960 15741/8960 27/224 1209/560 2889/4480 2889/4480 1209/560 27/224 15741/8960 2857/8960
10 80335/299376 132875/74844 -80875/99792 28375/6237 -24125/5544 89035/12474 -24125/5544 28375/6237 -80875/99792 132875/74844 80335/299376
11 434293/1741824 4495513/2903040 -3237113/8709120 560593/193536 -1599257/1451520 2582261/1451520 2582261/1451520 -1599257/1451520 560593/193536 -3237113/8709120 4495513/2903040 434293/1741824
12 1364651/6306300 25008/15925 -210774/175175 1786256/315315 -1144251/140140 2431008/175175 -1045204/75075 2431008/175175 -1144251/140140 1786256/315315 -210774/175175 25008/15925 1364651/6306300
13 8181904909/40236134400 56280729661/40236134400 -1737125143/2235340800 11148172711/2874009600 -6066382933/1609445376 22964826443/4470681600 -3592666051/3353011200 -3592666051/3353011200 22964826443/4470681600 -6066382933/1609445376 11148172711/2874009600 -1737125143/2235340800 56280729661/40236134400 8181904909/40236134400
14 90241897/500385600 44436679/31274100 -770720657/500385600 109420087/15637050 -6625093363/500385600 789382601/31274100 -5600756791/166795200 101741867/2606175 -5600756791/166795200 789382601/31274100 -6625093363/500385600 109420087/15637050 -770720657/500385600 44436679/31274100 90241897/500385600
15 25221445/147603456 147529925/114802688 -129408925/114802688 1746295975/344408064 -124034975/16400384 1367713705/114802688 -10001664025/1033224192 566004225/114802688 566004225/114802688 -10001664025/1033224192 1367713705/114802688 -124034975/16400384 1746295975/344408064 -129408925/114802688 147529925/114802688 25221445/147603456



The plot of li,n(x) for i=1,2,38 with n=8



MATLAB Code:

To generate the values of numerical Intergrals: I1,I2,I15

%To generate Lagrange polynomials l(x)%

for n=1:15
    for i=1:n+1
        x(n,i) = -5+(i-1)*10/n;
        f(n,i) = 1/(1+x(n,i)^2);
    end
end
syms y;
for n=1:15
    for i=1:n+1
        pr=1;
        for j=1:n+1
            if j~=i
                pr=pr*((y-x(n,j))/(x(n,i)-x(n,j)));
            end
        end
        l(n,i)=pr;
    end
end

%To generate Fn(x)for numerically integrating%

for n=1:15
    for i=1:n+1
        F(n,i)=l(n,i)*f(n,i);
    end
end
for n=1:15
    sum=0;
    for i=1:n+1
        sum=sum+F(n,i);
    end
    G(n)=sum;
end
for n=1:15
    T(n,1)=G(n);
end

%for calculating Exact Integral and Numerical Integral%

Ie=double(int(1/(1+y^2),y,-5,5));
for n=1:15
I(n,1)=int(T(n,1),y,-5,5);
IE(n,1)=Ie;
end
n=linspace(1,15,15);
I=double(I);
plot(n,I,n,IE);
legend('I=Numerical Integral(I_n)','IE=Exact Integral(I)');
xlabel('n-Value (Degree of the Newton-Cotes appoximating polynomial)');
ylabel('Numerical Value of Exact Integral (I) and Numerical Integrals (I_n)');

%code for calculating percentage error%
for n=1:15
PE(n,1)=(((IE(n,1)-I(n,1))/I(n,1))*100);
end

Te=(1/(1+y^2));
%code for plotting f,f1,f2,f3,f8 and f12 that are represented by Te, T(1,1), T(2,1), T(3,1), T(8,1), T(12,1) respectively in this code%
figure (2);
EZPLOT(Te);
hold on;
EZPLOT(T(1,1))
hold on;
EZPLOT(T(2,1))
hold on;
EZPLOT(T(3,1))
hold on;
EZPLOT(T(8,1))
hold on;
EZPLOT(T(12,1))
hold on;
xlabel('x- Value ');
ylabel('f(x),f1(x),f2(x),f3(x),f8(x) and f12(x)');

%code for calculating the Weights by integrating the lagrange polnomial%
for n=1:15
    for i=1:n+1
W(n,i)=int(l(n,i),y,-5,5);
    end
end
%code for plotting L0,L1,L2,L3,L4...L7 and L8 for n=8%
figure (3);
ezplot(l(8,1));
hold on;
ezplot(l(8,2));
hold on;
ezplot(l(8,3));
hold on;
ezplot(l(8,4));
hold on;
ezplot(l(8,5));
hold on;
ezplot(l(8,6));
hold on;
ezplot(l(8,7));
hold on;
ezplot(l(8,8));
hold on;
ezplot(l(8,9));
hold on;
xlabel('x- Value ');
ylabel('L0(x),L1(x),L2(x),L3(x)....L7(x) and L8(x)');



Solution for problem 16: Srikanth Madala 07:04, 11 February 2010 (UTC)

Proofread problem 16:

Contributing Authors

Solutions for problem 5 and proofread problems: 3,6,8,and 12--Egm6341.s10.team2.patodon 16:42, 10 February 2010 (UTC)

--Egm6341.s10.Team2.GV 21:55, 10 February 2010 (UTC)

Solutions for problems 1,6,11 and proofread 5,9,14--Niki Nachappa Chenanda Ganapathy

Solutions for problems 4,9,12,13 and proofread 2,10,11--Pengxiang Jiang

Solutions for problems 2,7,14,16 and proofread 1,8,13--Srikanth Madala 07:04, 11 February 2010 (UTC)

Template:Center topProblem AssignmentsTemplate:Center bottom
Problem Solution Proofread
Problem 1 NN SM
Problem 2 SM JP
Problem 3 GV PO
Problem 4 JP GV
Problem 5 PO NN
Problem 6 NN PO
Problem 7 SM GV
Problem 8 PO SM
Problem 9 JP NN
Problem 10 GV JP
Problem 11 NN JP
Problem 12 GV PO
Problem 13 JP SM
Problem 14 SM NN
Problem 15 PO GV
Problem 16 SM PO