Problem 4, HW 4. MAE 185.

Nasser M. Abbasi

May 24, 2003
problem Employee a two-through six-points Gauss-Legendre formulas to solve ∫ 3
 −3 1+22x2dx

Answer

f(x)= --2-
      1+2x2   This function is an even function:

PIC
f(x)

hence

pict

First transform the integral to be inside the limits of − 1  to + 1  . Let x= k1y+ k2

pict

Solve for k1,k2   . Adding the above 2 equations gives 2k2 = 3 =⇒ _____k2 = 1.5

Hence, 0= − k1+ 1.5 =⇒ _____k1 = 1.5

hence the transformation is_______________________x = 1.5+ 1.5y and ____________________dx = 1.5 dy

Using the above transformation, the integral becomes

pict

Hence        ---1----
g(y)=  5.5+9y+4.5y2

2 points Gauss

c0 = 1,c1 = 1   ,x0 = − 1√3,x1 = +√13-

pict

Hence

pict

3 points Gauss

c = 5∕9, c = 8∕9, c = 5∕9,x = − √0.6, x = 0.0, x = √0.6
 0       1        2       0           1       2

pict

Hence

pict

4 points Gauss

c0 = 0.3478548, c1 = 0.6521452, c2 = 0.6521452, c3 = 0.3478548

x0 = − 0.861136312, x1 = − 0.339981044, x2 = 0.339981044, x3 = 0.861136312

pict

so

pict

5 points Gauss

c0 = 0.2369269, c1 = 0.4786287, c2 = 0.568889, c3 = 0.4786287, c4 = 0.2369269

x0 = − 0.906179846, x1 = − 0.538469310, x2 = 0.0, x3 = 0.53846931, x4 = 0.906179846

pict

Hence,

pict

6 points Gauss

c0 = 0.171, c1 = 0.361, c2 = 0.468, c3 = 0.468, c4 = 0.3607616, c5 = 0.1713245

x = − 0.932, x = − 0.661, x = − 0.239, x = 0.239, x = 0.661x = 0.93
 0           1           2           3         4        5

pict

Hence

pict

summary: This table shows the relative error normalized to the true value for value of number of points n, starting with n=2 up to n=6. Analytically,

∫            √ --    ( √--)
  ---2--dx =   2arctan   2x
  1 +2x2

hence

          ∫ 3   2        [√ --     (√ --  )  √ --    ( √--  ) ]
Ianalytical = 2  -----2dx = 2   2arctan    2(3) −   2arctan   2 (0 )  = 2[1.894]= 3.788
           0 1+ 2x

So     |       |
𝜀t = |true−tarupperox|100 %

|-|-----|----------------|
| |     |                |
|n I    𝜀t               |
|-|-----|----------------|
| |     ||3.788−3.818||        |
|2 3.818|--3.788---=-0.792-|
| |     |       |        |
|3 3.902 |3.7883.−7388.902| = 3.017
|-|-----|----------------|
|43.799 ||3.788−3.780||= 0.287 |
|-|-----|--3.788-----------|
| |     |       |        |
|5 3.783 |3.7883.−7388.783|= 0.144|
|-|-----|----------------|
|63.787 ||3.788−3.787||= 0.035 |
-----------3.788-----------|

As number of points increases, the acurracy increases.

observation: I am able to find why the n=3 case seems to have some abnormality. 𝜀
t  should decrease as n increases, but for n=3 it did not. Checked the calculations but not able to see if I did some arithmitic error.

PIC