You are on page 1of 39

Situation 1:

Consider the following data points which represent a function f(x):

x f(x)
0 5.176
0.1 15.471
0.2 45.887
0.3 96.5
0.4 47.488
0.5 19
0.6 11.692
0.7 12.382
0.8 17.846
0.9 21.703
1 16

Determine f'(x) and f''(x) at x=0, x=0.5, and x=1, using:


a)finite difference approximation of order O(h), with h=0.1
b)finite difference approximation of order O(h 2), with h=0.2
c)finite difference approximation of order O(h 2), with h=0.1
d)Richardson's extrapolation (with initial approximations made from (b) and (c), with p=2,3,and 4
e)Lagrange's interpolation method (and analytical differentiation of resulting Lagrange polynomial)

A)
Using first forward difference approximation of order 0(h)

FORMULAS:

At x= 0
h= 0.1

102.95

𝑓^′ (0)=(𝑓(0.1)−𝑓(0))/0.1 𝑓^′ (0.5)=(𝑓(0.5)−𝑓(0.4))/


𝑓^′ (0)=(𝑓(0.1)−𝑓(0))/0.1
2012.1

𝑓"(0)=(𝑓(0.2)−2𝑓(0.1)+𝑓(0))/ 𝑓"(0.5)=(𝑓(0.5)−2𝑓(0.4)+𝑓(0.3
〖 0.1 〗 ^2
At x= 0.5
h= 0.1

-73.08

𝑓^′ (0.5)=(𝑓(0.6)−𝑓(0.5))/0.1 𝑓^′ (1)=(𝑓(1)−𝑓(0.9))/0.1


799.8

𝑓"(00.5)=(𝑓(0.7)−2𝑓(0.6)+𝑓(0.5))/ 𝑓"(1)=(𝑓(1)−2𝑓(0.9)+𝑓(0.8))/
〖 0.1 〗 ^2
h p=2,3,and 4
ge polynomial)

Using first backward difference approximation of order 0(h)

FORMULAS:

At x= 0.5
h= 0.1

-284.88
𝑓^′ (0.5)=(𝑓(0.5)−𝑓(0.4))/0.1
2052.4

(0.5)=(𝑓(0.5)−2𝑓(0.4)+𝑓(0.3))/ 〖 0.1 〗 ^2

At x= 1
h= 0.1

-57.03

𝑓^′ (1)=(𝑓(1)−𝑓(0.9))/0.1
-956

1)=(𝑓(1)−2𝑓(0.9)+𝑓(0.8))/ 〖 0.1 〗 ^2
B)Finite difference approximation of order O(h2)

x f(x)
0 5.176
0.1 15.471
0.2 45.887
0.3 96.5
0.4 47.488
0.5 19
0.6 11.692
0.7 12.382
0.8 17.846
0.9 21.703
1 16

Using second forward difference approximation of order 0(h2)

FORMULAS:

At x= 0
h= 0.2

𝑓^′ (0)=(−𝑓(0.4)+4𝑓(0.2)−3𝑓(0))/(2(0.2)) 301.33 𝑓^′ (0.5)=(𝑓(0.7)−𝑓(0

𝑓"(0)=(−𝑓(0.6)+4𝑓(0.4)−5𝑓(0.2)+2𝑓(0))/ 〖 0.2 〗 ^2 -1020.575 𝑓"(0.5)=(𝑓(0.7)−2𝑓(0


By using first central difference approximation of order O(h2)

FORMULAS:

At x= 0.5
h= 0.2

𝑓^′ (0.5)=(𝑓(0.7)−𝑓(0.3))/(2(0.2)) -210.295 𝑓^′ (1)=(3𝑓(1)−4𝑓(0

𝑓"(0.5)=(𝑓(0.7)−2𝑓(0.5)+𝑓(0.3))/ 〖 0.2 〗 ^2 1772.05 𝑓"(1)=(2𝑓(1)−5𝑓(0.8


Using second backward difference approximation of order 0(h 2)

FORMULAS:

At x= 1
h= 0.2

𝑓^′ (1)=(3𝑓(1)−4𝑓(0.8)+𝑓(0.6))/(2(0.2)) -29.23

𝑓"(1)=(2𝑓(1)−5𝑓(0.8)+4𝑓(0.6)−𝑓(0.4))/ 〖 0.2 〗 ^2 -1448.75


c)Finite difference approximation of order O(h 2), with h=0.1

x f(x)
0 5.176
0.1 15.471
0.2 45.887
0.3 96.5
0.4 47.488
0.5 19
0.6 11.692
0.7 12.382
0.8 17.846
0.9 21.703
1 16

Using second forward difference approximation of order 0(h2)


FORMULAS:

At x= 0
h= 0.1

𝑓^′ (0)=(−𝑓(0.2)+4𝑓(0.1)−3𝑓(0))/(2(0.1)) 2.345 𝑓^′ (0.5)=(𝑓(0.6)−𝑓(0

𝑓"(0)=(−𝑓(0.3)+4𝑓(0.2)−5𝑓(0.1)+2𝑓(0))/ 〖 0.1 〗 ^2 2004.5 𝑓"(0.5)=(𝑓(0.6)−2𝑓(0

At x= 0.5
h= 0.1

𝑓^′ (0.5)=(−𝑓(0.7)+4𝑓(0.6)−3𝑓(0.5))/(2(0.1)) -113.07

𝑓"(0)=(−𝑓(0.8)+4𝑓(0.7)−5𝑓(0.6)+2𝑓(0.5))/ 〖 0.1 〗 ^2 1122.2


By using first central difference approximation of order O(h2) Using second back
FORMULAS: FORMULAS:

At x= 0.5 At x=
h= 0.1 h=

𝑓^′ (0.5)=(𝑓(0.6)−𝑓(0.4))/(2(0.1)) -178.98 𝑓^′ (1)=(3𝑓(0.5)−4𝑓(0.4)+𝑓(0

𝑓"(0.5)=(𝑓(0.6)−2𝑓(0.5)+𝑓(0.4))/ 〖 0.1 〗 ^2 2118 𝑓"(1)=(2𝑓(0.5)−5𝑓(0.4)+4𝑓(0.3

At x=
h=

𝑓^′ (1)=(3𝑓(1)−4𝑓(0.9)+𝑓(0.8

𝑓"(1)=(2𝑓(1)−5𝑓(0.9)+4𝑓(0.8)
Using second backward difference approximation of order 0(h 2)
FORMULAS:

0.5
0.1

(1)=(3𝑓(0.5)−4𝑓(0.4)+𝑓(0.3))/(2(0.1)) -182.26

)=(2𝑓(0.5)−5𝑓(0.4)+4𝑓(0.3)−𝑓(0.2))/ 〖 0.1 〗 ^2 14067.3

1
0.1

(1)=(3𝑓(1)−4𝑓(0.9)+𝑓(0.8))/(2(0.1)) -104.83

)=(2𝑓(1)−5𝑓(0.9)+4𝑓(0.8)−𝑓(0.7))/ 〖 0.1 〗 ^2 -1751.3


RICHARDSON EXTRAPOLATION:
x f(x)
0 5.176
0.1 15.471
0.2 45.887
0.3 96.5
0.4 47.488
0.5 19
0.6 11.692
0.7 12.382
0.8 17.846
0.9 21.703
1 16

d)Richardson's extrapolation (with initial approximations made from (b) and (c), with p=2,3,and 4

p= 2 h1= 0.1
p= 3 h2= 0.2
p= 4

Solution: Apply Richardson Extrapolation to finite difference approximations. Start with two forward difference

At x= 0
h= 0.2

Using second forward difference approximation of order 0(h2)


FORMULAS:

301.33
𝑔(0.2)=(−𝑓(0.4)+4𝑓(0.2)−3𝑓(0))/(2(0.2))

-1020.575
𝑔′(0.2)=(−𝑓(0.6)+4𝑓(0.4)−5𝑓(0.2)+2𝑓(0))/ 〖 0.2 〗 ^2
h 0.1

2.345
𝑔(0.1)=(−𝑓(0.2)+4𝑓(0.1)−3𝑓(0))/(2(0.1))

2004.5
𝑔′(0.1)=(−𝑓(0.3)+4𝑓(0.2)−5𝑓(0.1)+2𝑓(0))/ 〖 0.1 〗 ^2

p= 2
at x = 0 at x = 0
-97.3166667
𝑓^′ (0)=𝐺=(2^2 𝑔(0.1)−𝑔(0.2))/(2^2−1) 𝑓^′ (0)=𝐺=(2^3 𝑔(0.1)−𝑔(0.
3012.858333
𝑓"(0)=𝐺=(2^2 𝑔′(0.1)−𝑔′(0.2))/(2^2−1) 𝑓"(0)=𝐺=(2^3 𝑔′(0.1)−𝑔′(0.

at x = 0.5 at x = 0.5
-168.541667
𝑓^′ (0)=𝐺=(2^2 𝑔(0.1)−𝑔(0.2))/(2^2−1) 𝑓^′ (0)=𝐺=(2^3 𝑔(0.1)−𝑔(0.2

2233.316667
𝑓"(0)=𝐺=(2^2 𝑔′(0.1)−𝑔′(0.2))/(2^2−1) 𝑓"(0)=𝐺=(2^3 𝑔′(0.1)−𝑔′(0.2

at x = 1 at x = 1
𝑓^′ (0)=𝐺=(2^2 𝑔(0.1)−𝑔(0.2))/(2^2−1) -130.03 𝑓^′ (0)=𝐺=(2^3 𝑔(0.1)−𝑔(0.2

𝑓"(0)=𝐺=(2^2 𝑔′(0.1)−𝑔′(0.2))/(2^2−1) -1852.15 𝑓"(0)=𝐺=(2^3 𝑔′(0.1)−𝑔′(0.2


with two forward difference approximations of O(h 2)

At x= 0.5
h= 0.2

By using first central difference approximation of order O(h2)


FORMULAS:

-210.295
𝑔(0.2)=(𝑓(0.7)−𝑓(0.3))/(2(0.2))

1772.05
𝑔′(0.2)=(𝑓(0.7)−2𝑓(0.5)+𝑓(0.3))/ 〖 0.2 〗 ^2
h 0.1

-178.98
𝑔(0.1)=(𝑓(0.6)−𝑓(0.4))/(2(0.1))

2118
𝑔′(0.1)=(𝑓(0.6)−2𝑓(0.5)+𝑓(0.4))/ 〖 0.1 〗 ^2

p= 3 p= 4
at x = 0
-40.367143
(0)=𝐺=(2^3 𝑔(0.1)−𝑔(0.2))/(2^3−1) 𝑓^′ (0)=𝐺=(2^4 𝑔(0.1)−𝑔(0.2))/(2^4−1)
2436.6536
(0)=𝐺=(2^3 𝑔′(0.1)−𝑔′(0.2))/(2^3−1) 𝑓"(0)=𝐺=(2^4 𝑔′(0.1)−𝑔′(0.2))/(2^4−1)

at x = 0.5
-174.50643
(0)=𝐺=(2^3 𝑔(0.1)−𝑔(0.2))/(2^3−1) 𝑓^′ (0)=𝐺=(2^4 𝑔(0.1)−𝑔(0.2))/(2^4−1)

2167.4214
0)=𝐺=(2^3 𝑔′(0.1)−𝑔′(0.2))/(2^3−1) 𝑓"(0)=𝐺=(2^4 𝑔′(0.1)−𝑔′(0.2))/(2^4−1)

at x = 1
(0)=𝐺=(2^3 𝑔(0.1)−𝑔(0.2))/(2^3−1) -115.63 𝑓^′ (0)=𝐺=(2^4 𝑔(0.1)−𝑔(0.2))/(2^4−1)

0)=𝐺=(2^3 𝑔′(0.1)−𝑔′(0.2))/(2^3−1) -1794.5214 𝑓"(0)=𝐺=(2^4 𝑔′(0.1)−𝑔′(0.2))/(2^4−1)


At x= 1
h= 0.2

Using second backward difference approximation of order 0(h2)


FORMULAS:

-29.23
𝑔(0.2)=(3𝑓(1)−4𝑓(0.8)+𝑓(0.6))/(2(0.2))

-1448.75
𝑔′(0.2)=(2𝑓(1)−5𝑓(0.8)+4𝑓(0.6)−𝑓(0.4))/ 〖 0.2 〗 ^2
h 0.1

-104.83
𝑔(0.1)=(3𝑓(1)−4𝑓(0.9)+𝑓(0.8))/(2(0.1))

-1751.3
𝑔′(0.1)=(2𝑓(1)−5𝑓(0.9)+4𝑓(0.8)−𝑓(0.7))/ 〖 0.1 〗 ^2

-17.587333

2206.1717

-176.89233

2141.0633

-109.87

-1771.47
LAGRANGE INTERPOLATION:

n=0 n=1 n=2 n=3 n=4 n=5 n=6 n=7


x 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7
f(x) 5.176 15.471 45.887 96.5 47.488 19 11.692 12.382

Solving for a0

a0 -0.1 -0.2 -0.3 -0.4 -0.5 -0.6 -0.7 -0.8


a1 0.1 -0.1 -0.2 -0.3 -0.4 -0.5 -0.6 -0.7
a2 0.2 0.1 -0.1 -0.2 -0.3 -0.4 -0.5 -0.6
a3 0.3 0.2 0.1 -0.1 -0.2 -0.3 -0.4 -0.5
a4 0.4 0.3 0.2 0.1 -0.1 -0.2 -0.3 -0.4
a5 0.5 0.4 0.3 0.2 0.1 -0.1 -0.2 -0.3
a6 0.6 0.5 0.4 0.3 0.2 0.1 -0.1 -0.2
a7 0.7 0.6 0.5 0.4 0.3 0.2 0.1 -0.1
a8 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1
a9 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2
a10 10.824 0.529 -29.887 -80.5 -31.488 -3 4.308 3.618

Solving for ai multiplier at x= 0

a0 -0.2 -0.3 -0.4 -0.5 -0.6 -0.7 -0.8 -0.9


-0.1 -0.3 -0.4 -0.5 -0.6 -0.7 -0.8 -0.9
-0.1 -0.2 -0.4 -0.5 -0.6 -0.7 -0.8 -0.9
-0.1 -0.2 -0.3 -0.5 -0.6 -0.7 -0.8 -0.9
-0.1 -0.2 -0.3 -0.4 -0.6 -0.7 -0.8 -0.9
-0.1 -0.2 -0.3 -0.4 -0.5 -0.7 -0.8 -0.9
-0.1 -0.2 -0.3 -0.4 -0.5 -0.6 -0.8 -0.9
-0.1 -0.2 -0.3 -0.4 -0.5 -0.6 -0.7 -0.9
-0.1 -0.2 -0.3 -0.4 -0.5 -0.6 -0.7 -0.8
-0.1 -0.2 -0.3 -0.4 -0.5 -0.6 -0.7 -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= 27481481.481
-0.4 -0.5 = -13194444.44
-0.3 -0.4 = 6766203.7037
-0.2 -0.3 = -4094576.72
-0.1 -0.2 = 2213045.6349
0.1 -0.1 = -598076.4991
-1.846 -5.703 = 7.492947E-08

-1 -0.003629 a6 -0.1 -0.2 -0.3


-1 -0.001814 0 -0.2 -0.3
-1 -0.00121 0 -0.1 -0.3
-1 -0.000907 0 -0.1 -0.2
-1 -0.000726 0 -0.1 -0.2
-1 -0.000605 0 -0.1 -0.2
-1 -0.000518 0 -0.1 -0.2
-1 -0.000454 0 -0.1 -0.2
-1 -0.000403 0 -0.1 -0.2
-0.9 -0.000363 0 -0.1 -0.2
-151.6034

-1 -0.003629 a7 -0.1 -0.2 -0.3


-1 0 0 -0.2 -0.3
-1 0 0 -0.1 -0.3
-1 0 0 -0.1 -0.2
-1 0 0 -0.1 -0.2
-1 0 0 -0.1 -0.2
-1 0 0 -0.1 -0.2
-1 0 0 -0.1 -0.2
-1 0 0 -0.1 -0.2
-0.9 0 0 -0.1 -0.2
1547.1

-1 -0.001814 a8 -0.1 -0.2 -0.3


-1 0 0 -0.2 -0.3
-1 0 0 -0.1 -0.3
-1 0 0 -0.1 -0.2
-1 0 0 -0.1 -0.2
-1 0 0 -0.1 -0.2
-1 0 0 -0.1 -0.2
-1 0 0 -0.1 -0.2
-1 0 0 -0.1 -0.2
-0.9 0 0 -0.1 -0.2
-10324.58

-1 -0.00121 a9 -0.1 -0.2 -0.3


-1 0 0 -0.2 -0.3
-1 0 0 -0.1 -0.3
-1 0 0 -0.1 -0.2
-1 0 0 -0.1 -0.2
-1 0 0 -0.1 -0.2
-1 0 0 -0.1 -0.2
-1 0 0 -0.1 -0.2
-1 0 0 -0.1 -0.2
-0.9 0 0 -0.1 -0.2
38600

-1 -0.000907 a10 -0.1 -0.2 -0.3


-1 0 0 -0.2 -0.3
-1 0 0 -0.1 -0.3
-1 0 0 -0.1 -0.2
-1 0 0 -0.1 -0.2
-1 0 0 -0.1 -0.2
-1 0 0 -0.1 -0.2
-1 0 0 -0.1 -0.2
-1 0 0 -0.1 -0.2
-0.9 0 0 -0.1 -0.2
-24931.2

-1 -0.000726 THEREFORE:
-1 0 x=0 f'(x)= 11583.46
-1 0 x=0.5 f'(x)= -115.3695
-1 0 x=1 f'(x)= -4053.087
-1 0
-1 0 Note: To obtain the value of x at 0.5 and 1 just change
-1 0
-1 0
-1 0
-0.9 0
9576

n=8 n=9 n=10


0.8 0.9 1
17.846 21.703 16

0.018144 a6 -0.2 -0.3 -0.4


0.006048 0 -0.3 -0.4
0.003024 0 -0.1 -0.4
0.001814 0 -0.1 -0.2
0.00121 0 -0.1 -0.2
0.000864 0 -0.1 -0.2
0.000648 0 -0.1 -0.2
0.000504 0 -0.1 -0.2
0.000403 0 -0.1 -0.2
465.84

0.018144 a7 -0.2 -0.3 -0.4


0 0 -0.3 -0.4
0 0 -0.1 -0.4
0 0 -0.1 -0.2
0 0 -0.1 -0.2
0 0 -0.1 -0.2
0 0 -0.1 -0.2
0 0 -0.1 -0.2
0 0 -0.1 -0.2
-7735.5

0.018144 a8 -0.2 -0.3 -0.4


0 0 -0.3 -0.4
0 0 -0.1 -0.4
0 0 -0.1 -0.2
0 0 -0.1 -0.2
0 0 -0.1 -0.2
0 0 -0.1 -0.2
0 0 -0.1 -0.2
0 0 -0.1 -0.2
103245.8

0.012096 a9 -0.2 -0.3 -0.4


0 0 -0.3 -0.4
0 0 -0.1 -0.4
0 0 -0.1 -0.2
0 0 -0.1 -0.2
0 0 -0.1 -0.2
0 0 -0.1 -0.2
0 0 -0.1 -0.2
0 0 -0.1 -0.2
-386000

0.009072 a10 -0.2 -0.3 -0.4


0 0 -0.3 -0.4
0 0 -0.1 -0.4
0 0 -0.1 -0.2
0 0 -0.1 -0.2
0 0 -0.1 -0.2
0 0 -0.1 -0.2
0 0 -0.1 -0.2
0 0 -0.1 -0.2
249312

0.007258 THEREFORE:
0 x=0 f''(x)= -109149
0 x=0.5 f''(x)= 3605.833
0 x=1 f''(x)= -29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0
-0.3 -0.4 -0.5 -0.6 -1 0
-0.3 -0.4 -0.5 -0.6 -0.8 0
-21226.28571

-0.5 -0.6 -0.7 -0.9 -1 0.004536


-0.5 -0.6 -0.7 -0.9 -1 0
-0.5 -0.6 -0.7 -0.9 -1 0
-0.5 -0.6 -0.7 -0.9 -1 0
-0.3 -0.6 -0.7 -0.9 -1 0
-0.3 -0.4 -0.7 -0.9 -1 0
-0.3 -0.4 -0.5 -0.9 -1 0
-0.3 -0.4 -0.5 -0.6 -1 0
-0.3 -0.4 -0.5 -0.6 -0.7 0
10038.375

-0.5 -0.6 -0.7 -0.8 -1 0.004032


-0.5 -0.6 -0.7 -0.8 -1 0
-0.5 -0.6 -0.7 -0.8 -1 0
-0.5 -0.6 -0.7 -0.8 -1 0
-0.3 -0.6 -0.7 -0.8 -1 0
-0.3 -0.4 -0.7 -0.8 -1 0
-0.3 -0.4 -0.5 -0.8 -1 0
-0.3 -0.4 -0.5 -0.6 -1 0
-0.3 -0.4 -0.5 -0.6 -0.7 0
-2411.444444

-0.5 -0.6 -0.7 -0.8 -0.9 0.0036288


-0.5 -0.6 -0.7 -0.8 -0.9 0
-0.5 -0.6 -0.7 -0.8 -0.9 0
-0.5 -0.6 -0.7 -0.8 -0.9 0
-0.3 -0.6 -0.7 -0.8 -0.9 0
-0.3 -0.4 -0.7 -0.8 -0.9 0
-0.3 -0.4 -0.5 -0.8 -0.9 0
-0.3 -0.4 -0.5 -0.6 -0.9 0
-0.3 -0.4 -0.5 -0.6 -0.7 0
2.719041E-10

f x at 0.5 and 1 just change the input x value


COMPOSITE TRAPEZOIDAL RULE:
FORMULA:

Trapezoidal Rule x erf(a) Multiplier


0 1.12837916709551 1
h 0.1 1.11715160678894 2
0.1 0.2 1.08413478710486 2
0.3 1.03126090961896 2
0.4 0.961541298839308 2
0.5 0.878782578935445 2
0.6 0.787243431714287 2
0.7 0.691274860410539 2
0.8 0.594985786257469 2
0.9 0.501968574240363 2
1 0.415107497420595 1

Total area approximation:


RULE:

Product of the sum


1.12837916709551
2.23430321357787
2.16826957420973
2.06252181923793
1.92308259767862
1.75756515787089
1.57448686342857
1.38254972082108
1.18997157251494
1.00393714848073
0.415107497420595

0.842008716616823
COMPOSITE SIMPSONS RULE:
FORMULA:

Simpsons rule x erf(a) Multiplier Product of the sum


n 0 1.128379 1 1.12837916709551
0.5 0.1 1.117152 4 4.46860642715575
0.2 1.084135 2 2.16826957420973
h 0.3 1.031261 4 4.12504363847585
0.1 0.4 0.961541 2 1.92308259767862
0.5 0.878783 4 3.51513031574178
0.6 0.787243 2 1.57448686342857
0.7 0.691275 4 2.76509944164215
0.8 0.594986 2 1.18997157251494
0.9 0.501969 4 2.00787429696145
1 0.415107 1 0.415107497420595

Total area approximation: 0.842701713077498


ROMBERG INTERPOLATION

Determine erf(1)

Given: a= 0 b= 1

PERFORM RECURSIVE TRAPEZOIDAL RULE:

𝑅_1,1= 𝐼_1= 1/2 [𝑓(0)+𝑓(1)] = 0.7717433323

1/2 𝐼_1+1/2 = 0.8252629556


𝑅_2,1= 𝐼_0.5 𝑓(1/2)
=
𝑅_3,1= 𝐼_0.25 1/2
𝐼_0.5+1/4[𝑓(1/4)+𝑓(3/4)]
= 0.8383677774
=

𝑅_4,1=𝐼_0.125 1/2 = 0.8416192212


𝐼_0.25+1/8[𝑓(1/8)+𝑓(3/8)+𝑓(5/8)+𝑓(7/
= 8)]

PERFORM RICHARDSON EXTRAPOLATION:

𝑅_2,2= (4^(2−1) 4/3 𝑅_2,1−1/3 𝑅_1,1 = 0.84310283


𝑅_2,1−𝑅_1,1)/(4^(
2−1)−1)

𝑅_3,2= (4^(2−1) 4/3 𝑅_3,1−1/3 𝑅_2,1 = 0.8427360514


𝑅_3,1−𝑅_2,1)/(4^(
2−1)−1)
4/3 𝑅_4,1−1/3 𝑅_3,1
𝑅_4,2= (4^(2−1)
𝑅_4,1−𝑅_3,1)/(4^(
=
0.8427030358
2−1)−1)
(4^(3−1) 16/15 𝑅_3,2−1/15 𝑅_2,2 = 0.8427115995
𝑅_3,3= 𝑅_3,2−𝑅_2,2)/(4^(
3−1)−1)

𝑅_4,3= (4^(3−1) 16/15 𝑅_4,2−1/15 𝑅_3,2 =


𝑅_4,2−𝑅_3,2)/(4^( 0.8427008348
3−1)−1)

𝑅_4,4= (4^(4−1) 64/63 𝑅_4,3−1/63 𝑅_3,3 = 0.8427006639


𝑅_4,3−𝑅_3,3)/(4^(
4−1)−1)
𝑅_4,4= (4^(4−1)
𝑅_4,3−𝑅_3,3)/(4^(
4−1)−1)

TABULATED DATA MANUALLY INTEGRATED VALUE:TRUE VALUE= 0.8427007929

i n Oh^2 Oh^3 Oh^4 Oh^5 ERROR


1 1 0.771743 8.4202437259
2 2 0.825263 0.843103 2.0692798025
3 4 0.838368 0.842736 0.842711599479115 0.5141819606
4 8 0.841619 0.842703 0.842700834809729 0.842701 0.1283458689

THEREFORE BY ROMBERG EXTRAPOLATION, erf(1)= 0.842701

= = 0.8427006639
TOLERANCE 0.5%
6.48516002999256
1.56313520117069
0.386331932718202
0.175970088742015
GAUSS -LEGENDRE QUADRATURE
at n= 4

Given: a= 0 b= 1

x= (𝑏+𝑎)/2+(𝑏−𝑎)/2ξ

(1+0)/2+(1−0)/2
x= ξ

x= 0.5+0.5ξ

2/√𝜋 ∫_0^1▒𝑒^( 〖−𝑥〗 ^2 ) dx


erf(a)=

2/√𝜋 𝑒^( 〖− (−0.5−0.5ξ) 〗 ^2 )


erf(a)=

Substituting the value of ξ from calculated x value


x A
at ξ= 0 0.5 0.568889
at ξ= 0.538469 0.7692345 0.478629
at ξ= -0.538469 0.2307655 0.478629
at ξ= 0.90618 0.95309 0.236927
at ξ= -0.90618 0.04691 0.236927

2/√𝜋 𝑒^( 〖− (0.5) 〗 ^2 )


f(0.5) 0.499929742548
2/√𝜋 𝑒^( 〖− (0.7692345) 0.298863303129
f(0.7692345) 〗 ^2 )

2/√𝜋 𝑒^( 〖− (0.2307655) 0.512066904155


f(0.2307655) 〗 ^2 )

f(0.95309)2/√𝜋 𝑒^( 〖− (0.95309) 〗 ^2 )


0.107786645256

f(0.04691) 2/√𝜋 𝑒^( 〖− (0.04691) 〗 ^2


0.266755835531
)

I= 0.5[f(0.5)+f(0.2307655)+f(0.7692345)+f(0.04691)+f(0.95309)]

I= 0.842701215309

You might also like