Tapos Na Yan Welcome

You might also like

Download as xlsx, pdf, or txt
Download as xlsx, pdf, or txt
You are on page 1of 30

Given the function:

Where,
ℎ= (𝑏−𝑎)/𝑛

i xi
a 0
a+h 0.5
a+2h 1
a+3h 1.5
a+4h 2
a+5h 2.5
b 3

TRUE VALUE=
98.427685
SECOND DERIVATIVE OF THE FUNCTION
𝑓(𝑥)=𝑥^2 𝑒^𝑥
Applying Product Rule of Diff
(𝑑(𝑢𝑣))/𝑑𝑥=(𝑢(𝑑𝑣))/𝑑𝑥+
𝑓^′ (𝑥)=𝑥^2 𝑒^𝑥+2𝑥𝑒^𝑥
Then,
𝑓^′′ (𝑥)=𝑥^2 𝑒^𝑥+4𝑥𝑒^𝑥+
function:
∫_0^3▒ 〖
𝑥 ^2 𝑒^𝑥 𝑑𝑥 〗

a. Using Multiple Application Trapezoidal Rule with a total number of segments n = 6. Find the
numerical Integration value (I) and its true percent relative error.

FUNCTION :

𝑓(𝑥)=𝑥^2 𝑒^𝑥

𝑎)/𝑛
n= 6
h= 0.5

f(xi) INTEGRATE USING ANALYTICAL METHOD:


0
𝑓(𝑥)=∫_0^3▒ 〖
𝑥 ^2 𝑒^𝑥 𝑑𝑥 〗
0.412180317675
2.718281828459 Using Integration by Parts:
10.08380040826 ∫1▒𝑢𝑑𝑣=𝑢𝑣 − ∫1▒𝑣𝑑𝑢
29.55622439572
∫1▒ 〖𝑥 ^2 𝑒^𝑥 𝑑𝑥 〗 =𝑥^2 𝑒^𝑥−2𝑥𝑒^𝑥+2𝑒^𝑥+𝑐
76.1405872544
∫_0^3▒ 〖𝑥 ^2 𝑒^𝑥 𝑑𝑥 〗 = 〖[(3) 〗 ^2 𝑒^3−2(3)𝑒^3+2
180.7698323087 𝑒^0−2(0)𝑒^0+2𝑒^0]
∫_0^3▒ 〖𝑥 ^2 𝑒^𝑥 𝑑𝑥 〗 =98.42768462

𝐸_𝑡=𝑇𝑉−𝐼
𝐼=(𝑏−𝑎) (𝑓(𝑥_0 )+2∑_(𝑖=1)^(𝑛−1)▒ 〖
𝑓 (𝑥_𝑖 )+𝑓(𝑥_𝑛 ) 〗 )/2𝑛

I= 104.647995179429
"ε" _𝑡=𝐸_𝑡
"ε" _𝑡=𝐸_𝑡

SECOND DERIVATIVE OF THE FUNCTION:


𝑓(𝑥)=𝑥^2 𝑒^𝑥
Applying Product Rule of Differentiation:
Integrate.....
(𝑑(𝑢𝑣))/𝑑𝑥=(𝑢(𝑑𝑣))/𝑑𝑥+(𝑣(𝑑𝑢))/𝑑𝑥 𝑓^′′ (𝑥)=𝑥^2 𝑒^𝑥+4𝑥𝑒^𝑥+2𝑒^𝑥
𝑓^′ (𝑥)=𝑥^2 𝑒^𝑥+2𝑥𝑒^𝑥
∫1▒ 〖
𝑓 ^′′ (𝑥)𝑑𝑥=∫1▒ 〖
𝑥 ^2 𝑒^𝑥+4𝑥𝑒^𝑥+2𝑒^
Then,
𝑓^′′ (𝑥)=𝑥^2 𝑒^𝑥+4𝑥𝑒^𝑥+2𝑒^𝑥 ∫1▒ 〖
𝑓 ^′′ (𝑥)𝑑𝑥=𝑥^2 𝑒^𝑥+2𝑥𝑒^𝑥+𝑐 〗

∫_𝑎^𝑏▒ 〖 𝑓 ^′′ (𝑥)𝑑𝑥 〗 =∫_0^3▒ 〖


𝑓 ^′′ (𝑥)𝑑𝑥=
[(0)^2 𝑒^0+2(0) 𝑒^0 ]

∫_𝑎^𝑏▒ 〖
𝑓 ^′′ (𝑥)𝑑𝑥 〗
=

THEREFORE,
𝐸_𝑎=−(𝑏−𝑎)^3/(12𝑛

SUMMARY
a 0
b 3
h 0.5
True Value 98.4276846159384
I 104.647995179429
Ea -6.27673028849615
Et -6.22031056349093
True Error (%)-6.31967579829027
n = 6. Find the

METHOD:

𝑒^𝑥−2𝑥𝑒^𝑥+2𝑒^𝑥+𝑐
〖[(3) 〗 ^2 𝑒^3−2(3)𝑒^3+2𝑒^3]− 〖[(0) 〗 ^2

8.42768462

𝐸_𝑡=𝑇𝑉−𝐼
Et= -6.22031056

True Error (%)


"ε" _𝑡=𝐸_𝑡/𝑇𝑉×100

"ε" _𝑡=
"ε" _𝑡=𝐸_𝑡/𝑇𝑉×100

"ε" _𝑡=
-6.3196758

4𝑥𝑒^𝑥+2𝑒^𝑥

∫1▒ 〖 𝑥 ^2 𝑒^𝑥+4𝑥𝑒^𝑥+2𝑒^𝑥 𝑑𝑥 〗〗 Substitute.....


¯𝑓′′^
𝑥^2 𝑒^𝑥+2𝑥𝑒^𝑥+𝑐 〗
(𝑥)=(∫_𝑎^𝑏▒ 〖𝑓′′ (𝑥) 〗 )/(𝑏−𝑎) 𝑑𝑥
𝑥 〗 =∫_0^3▒ 〖
𝑓 ^′′ (𝑥)𝑑𝑥=[(3)^2 𝑒^3+2(3) 𝑒^3 ]− 〗
^0 ] Mean ¯𝑓′′^ (𝑥) = 100.427684615938


𝑓 ^′′ (𝑥)𝑑𝑥 〗 301.283053847815

𝐸_𝑎=−(𝑏−𝑎)^3/(12𝑛^2 ) ¯𝑓^( ′′) (𝑥)

-6.27673029
𝐸_𝑎=
−𝑎) 𝑑𝑥
Given the function:
∫_0^3▒ 〖
𝑥 ^2 𝑒^𝑥 𝑑𝑥 〗

b. Using Simpson’s Rule with a total number of segments n = 5. Find the nu


value (I) and its true percent relative error

FUNCTION :

𝑓(𝑥)=𝑥^2 𝑒^𝑥

Where,
ℎ= (𝑏−𝑎)/𝑛
n= 5
h= 0.6

i xi f(xi) INTEGRATE USING ANALYTICAL MET


a 0 0
𝑓(𝑥)=∫_0^3▒ 〖
𝑥 ^2 𝑒^𝑥 𝑑𝑥 〗
a+h 0.6 0.655962768
a+2h 1.2 4.780968369 Using Integration by Parts:
a+3h 1.8 19.60085778 ∫1▒𝑢𝑑𝑣=𝑢𝑣 − ∫1▒𝑣𝑑𝑢
a+4h 2.4 63.49349595
∫1▒ 〖 𝑥 ^2 𝑒^𝑥 𝑑𝑥 〗 =𝑥^2 𝑒^𝑥−
b 3 180.7698323
∫_0^3▒ 〖 𝑥 ^2 𝑒^𝑥 𝑑𝑥 〗 = 〖[(3
〖[(0) 〗 ^2 𝑒^0−2(0)𝑒^0+2𝑒^
∫_0^3▒ 〖 𝑥 ^2 𝑒^𝑥 𝑑𝑥 〗 =98.42

TRUE VALUE=
98.42768462

𝐹𝑜𝑟 𝑆𝑖𝑚𝑝𝑠𝑜𝑛^′ 𝑠 1/3 𝑅𝑢𝑙𝑒:

I 1.480964

Solve for MEAN…..

FOURTH DERIVATIVE OF THE FUNCTION:


𝑓(𝑥)=𝑥^2 𝑒^𝑥
Applying Product Rule of Differentiation:
(𝑑(𝑢𝑣))/𝑑𝑥=(𝑢(𝑑𝑣))/𝑑𝑥+(𝑣(𝑑𝑢))/𝑑𝑥
𝑓^′ (𝑥)=𝑥^2 𝑒^𝑥+2𝑥𝑒^𝑥
𝑓^′′ (𝑥)=𝑥^2 𝑒^𝑥+4𝑥𝑒^𝑥+2𝑒^𝑥
𝑓(𝑥)=𝑥^2 𝑒^𝑥
Applying Product Rule of Differentiation:
(𝑑(𝑢𝑣))/𝑑𝑥=(𝑢(𝑑𝑣))/𝑑𝑥+(𝑣(𝑑𝑢))/𝑑𝑥
𝑓^′ (𝑥)=𝑥^2 𝑒^𝑥+2𝑥𝑒^𝑥
𝑓^′′ (𝑥)=𝑥^2 𝑒^𝑥+4𝑥𝑒^𝑥+2𝑒^𝑥
𝑓^′′′ (𝑥)=𝑥^2 𝑒^𝑥+6𝑥𝑒^𝑥+6𝑒^𝑥
Then,
𝑓^((4)) (𝑥)=𝑥^2 𝑒^𝑥+8𝑥𝑒^𝑥+12𝑒^𝑥

THEREFORE,

𝐹𝑜𝑟 𝑆𝑖𝑚𝑝𝑠𝑜𝑛^′ 𝑠 1/3


𝑅𝑢𝑙𝑒:
gments n = 5. Find the numerical Integration
cent relative error

TE USING ANALYTICAL METHOD:


∫_0^3▒ 〖
𝑥 ^2 𝑒^𝑥 𝑑𝑥 〗
ntegration by Parts:
𝑑𝑣=𝑢𝑣 − ∫1▒𝑣𝑑𝑢


𝑥 ^2 𝑒^𝑥 𝑑𝑥 〗 =𝑥^2 𝑒^𝑥−2𝑥𝑒^𝑥+2𝑒^𝑥+𝑐
▒〖 𝑥 ^2 𝑒^𝑥 𝑑𝑥 〗 = 〖[(3) 〗 ^2 𝑒^3−2(3)𝑒^3+2𝑒^3]− 𝐸_𝑡=𝑇𝑉−𝐼
Et= -0.890898
〗 ^2 𝑒^0−2(0)𝑒^0+2𝑒^0]
▒〖 𝑥 ^2 𝑒^𝑥 𝑑𝑥 〗 =98.42768462
True Error (%)
"ε" _𝑡=𝐸_𝑡/𝑇𝑉×100

"ε" _𝑡= -0.90513

𝐹𝑜𝑟 𝑆𝑖𝑚𝑝𝑠𝑜𝑛^′ 𝑠 3/8 𝑅𝑢𝑙𝑒:

I 97.8376189250273

I TOTAL= 99.31858281329

tiation:
Integrate.....
))/𝑑𝑥
𝑓^((4)) (𝑥)=𝑥^2 𝑒^𝑥+8𝑥𝑒^𝑥+12𝑒^𝑥

∫1▒ 〖
𝑓 ^((4)) (𝑥)𝑑𝑥=∫1▒ 〖
𝑥 ^2 𝑒^𝑥+8𝑥𝑒^𝑥+12𝑒^𝑥 𝑑𝑥 〗〗
∫1▒ 〖
𝑓 ^((4)) (𝑥)𝑑𝑥=𝑥^2 𝑒^𝑥+6𝑥𝑒^𝑥+6𝑒^𝑥+𝑐 〗
tiation:
Integrate.....
))/𝑑𝑥
𝑓^((4)) (𝑥)=𝑥^2 𝑒^𝑥+8𝑥𝑒^𝑥+12𝑒^𝑥

∫1▒ 〖
𝑓 ^((4)) (𝑥)𝑑𝑥=∫1▒ 〖
𝑥 ^2 𝑒^𝑥+8𝑥𝑒^𝑥+12𝑒^𝑥 𝑑𝑥 〗〗
∫1▒ 〖𝑓 ^((4)) (𝑥)𝑑𝑥=𝑥^2 𝑒^𝑥+6𝑥𝑒^𝑥+6𝑒^𝑥+𝑐 〗
𝑥
∫_𝑎^𝑏▒ 〖𝑓 ^((4)) (𝑥)𝑑𝑥 〗 =∫_0^3▒ 〖
𝑓 ^((4)) (𝑥)𝑑𝑥=[(3)^2 𝑒^3+6(3) 𝑒^3+6𝑒^3 ]− 〗 [(0)^2 𝑒^0+6(0) 𝑒^0

2𝑒^𝑥

∫_0^3▒ 〖
𝑓 ^((4))
656.822718465193
(𝑥)𝑑𝑥 〗 =

𝐹𝑜𝑟 𝑆𝑖𝑚𝑝𝑠𝑜𝑛^′ 𝑠 3/8 𝑅𝑢𝑙𝑒:

Et -0.18916494292

AVERAGE
-0.1366191254408

SUMMARY
a 0
b 3
h 0.6
True Value 98.427684616
I 99.318582813
Ea -0.1366191254
Et -0.8908981973
True Error (%) -0.9051296907
𝑉−𝐼

=𝐸_𝑡/𝑇𝑉×100
Substitute.....
〖 ¯𝑓^((4)) 〗 ^
(𝑥)=(∫_𝑎^𝑏▒ 〖𝑓 ^((4))
]− 〗 [(0)^2 𝑒^0+6(0) 𝑒^0+6𝑒^0 ]
(𝑥) 〗 )/(𝑏−𝑎)
Mean 𝑑𝑥) 〗 ^ 218.940906155064
〖¯𝑓^((4)
(𝑥) =

𝑛^′ 𝑠 3/8 𝑅𝑢𝑙𝑒:

Et -0.084073308
Given the Function:

Numerically Integrate the function with an interval from x=5 to 10 wherein y(5)

Equation:
Find the integral:
y= 0.5x4-3.9x3+8.85x2-5x-1.25

xi f(x,y)
5 41
6 112
7 231.6
8 411.8
9 664.6
10 1002
dy/dt=2x3-11.7x2+17.7x-5

terval from x=5 to 10 wherein y(5)=20 and step size of h=1

dy/dt=2x3-11.7x2+17.7x-5 h 1
at x= 5 y=20

yi+1=yi+f(xi-yi)h
y(Euler) y(true) Et error%
20 20 0 0
61 92.95 31.95 34.373318989
173 260.2 87.2 33.512682552
404.6 576.35 171.75 29.799600937
816.4 1108 291.6 26.317689531
1481 1933.75 452.75 23.413057531
Given the Function:

Numerically Integrate the function with an interval from x=5 to 10 wherein y(5

Equation:
Find the integral:
y= 0.5x4-3.9x3+8.85x2-5x-1.25

Predictor:

𝑌 ^0 〗 _(𝑖+1)=𝑦_𝑖+𝑓(𝑥_𝑖,𝑦_𝑖 )ℎ
Corrector:
𝑦_(𝑖+1)=𝑦_𝑖+(𝑓(𝑥_𝑖,𝑦_𝑖 )+𝑓(𝑥_𝑖+1,
〖𝑦 ^0 〗 _(𝑖+1)))/2 ℎ

xi
5
6
7
8
9
10
dy/dt=2x3-11.7x2+17.7x-5

rval from x=5 to 10 wherein y(5)=20 and step size of h=1

dy/dt=2x3-11.7x2+17.7x-5

85x2-5x-1.25

+1)=𝑦_𝑖+𝑓(𝑥_𝑖,𝑦_𝑖 )ℎ

𝑖 )+𝑓(𝑥_𝑖+1,

y(Heun) y(true) f(xi,yi) y0(i+1) xi+1


20 20 41 61 6
96.5 92.95 112 96.5 7
268.3 260.2 231.6 268.3 8
590 576.35 411.8 590 9
1128.2 1108 664.6 1128.2 10
1961.5 1933.75 1002 1961.5 0
h 1
at x= 5 y=20

f(xi+1,y0i+1) y(i+1) average slope Et error%


112 96.5 76.5 0 0
231.6 268.3 171.8 -3.55 -3.819258
411.8 590 321.7 -8.1 -3.11299
664.6 1128.2 538.2 -13.65 -2.368353
1002 1961.5 833.3 -20.2 -1.823105
-5 2460 498.5 -27.75 -1.435036
Given the Function:
dy/dt=2x3-11.7x2+17.7x-5

Numerically Integrate the function with an interval from x=5 to 10 wherein y(5

Equation: dy/dt=2x3-11.7x2+17.7x-5
Find the integral:
y= 0.5x4-3.9x3+8.85x2-5x-1.25

𝑦_(𝑖+1/2)=𝑦_𝑖+𝑓(𝑥_𝑖,𝑦_𝑖)ℎ/2
〖𝑦 ^′ 〗 _(𝑖+1/2)=𝑓(𝑥_(𝑖+1/2),𝑦_(𝑖+1/2))
𝑦_(𝑖+1)=𝑦_𝑖+𝑓(𝑥_(𝑖+1/2),𝑦_(𝑖+1/2) )ℎ

xi xi new
5
6 5
7 6
8 7
9 8
10 9
dt=2x3-11.7x2+17.7x-5

an interval from x=5 to 10 wherein y(5)=20 and step size of h=1

dt=2x3-11.7x2+17.7x-5 h
at x= 5 y=20

2)=𝑦_𝑖+𝑓(𝑥_𝑖,𝑦_𝑖)ℎ/2
_(𝑖+1/2)=𝑓(𝑥_(𝑖+1/2),𝑦_(𝑖+1/2))
𝑦_𝑖+𝑓(𝑥_(𝑖+1/2),𝑦_(𝑖+1/2) )ℎ

yi f(xi,yi) xi+1/2 yi+1/2 f(xi+1/2,yi+1/2)

20 41 5.5 111.675 71.175


91.175 112 6.5 312.15 164.975
256.15 231.6 7.5 685.325 313.375
569.525 411.8 8.5 1303.8 528.375
1097.9 664.6 9.5 332.3 821.975
1

xi+1 y(midpoint) y(true) Et error %


5 20 20 0 0
6 91.175 92.95 1.775 1.909629
7 256.15 260.2 4.05 1.556495
8 569.525 576.35 6.825 1.184176
9 1097.9 1108 10.1 0.911552
10 1919.875 1933.75 13.875 0.717518
Given the Function:
dy/dt=2x3-11.7x2+17.7x-5

Numerically Integrate the function with an interval from x=5 to 10 wh

Equation: dy/dt=2x3-11.7x2+17.7x-5
Find the integral:
y= 0.5x4-3.9x3+8.85x2-5x-1.25

𝑦_(𝑖+1)=𝑦_𝑖+(1/3 𝑘
𝑘_1=𝑓(𝑥_𝑖+𝑦_𝑖)
𝑘_2=𝑓(𝑥_𝑖+3/4 ℎ,𝑦_

xi xi new
5
6 5
7 6
8 7
9 8
10 9
/dt=2x3-11.7x2+17.7x-5

terval from x=5 to 10 wherein y(5)=20 and step size of h=1

/dt=2x3-11.7x2+17.7x-5 h 1
at x= 5 y=20
8.85x2-5x-1.25

𝑦_(𝑖+1)=𝑦_𝑖+(1/3 𝑘_1+2/3 𝑘_2 )ℎ


𝑘_1=𝑓(𝑥_𝑖+𝑦_𝑖)
𝑘_2=𝑓(𝑥_𝑖+3/4 ℎ,𝑦_𝑖+3/4 𝑘_1 ℎ)

yi k1 xi+(3/4)h yi+(3/4)h k2 xi+1 y(ralston)


5 20
20 41 5.75 20 90.1625 6 93.775
93.775 112 6.75 93.775 196.4875 7 262.1
262.1 231.6 7.75 262.1 360.4125 8 579.575
579.575 411.8 8.75 579.575 593.9375 9 1112.8
1112.8 664.6 9.75 1112.8 909.0625 10 1940.375
y(true) Et error %
20 0 0
92.95 -0.825 -0.887574
260.2 -1.9 -0.730208
576.35 -3.225 -0.559556
1108 -4.8 -0.433213
1933.75 -6.625 -0.342599
Given the Function:
dy/dt=2x3-11.7x2+17.7x-5

Numerically Integrate the function with an interval from x=5 to 10 wherein y(5)=20 and step size of h=1

Equation: dy/dt=2x3-11.7x2+17.7x-5
Find the integral:
y= 0.5x4-3.9x3+8.85x2-5x-1.25

xi xi yi
5
6 5 20
7 6 92.95
8 7 260.2
9 8 576.35
10 9 1108
nd step size of h=1

h 1
at x= 5 y=20

k1 xi+(1/2)h yi+(1/2)h k2 xi+(1/2)h xi+1 yi-k1h+2k2h k3

41 5.5 20 71.175 5.5 6 121.35 112


112 6.5 92.95 164.975 6.5 7 310.9 231.6
231.6 7.5 260.2 313.375 7.5 8 655.35 411.8
411.8 8.5 576.35 528.375 8.5 9 1221.3 664.6
664.6 9.5 1108 821.975 9.5 10 2087.35 1002
xi+1 y(3rd order y(true) Et error %
5 20 20 0 0
6 92.95 92.95 0 0
7 260.2 260.2 0 0
8 576.35 576.35 0 0
9 1108 1108 0 0
10 1933.75 1933.75 0 0
Given the Function:
dy/dt=2x3-11.7x2+17.7x-5

Equation: dy/dt=2x3-11.7x2+17.7x-5
Find the integral:
y= 0.5x4-3.9x3+8.85x2-5x-1.25

xi xi new yi k1 xi+(1/2)h yi+(1/2)k1h k2


5
6 5 20 41 5.5 20 71.175
7 6 86.14583 112 6.5 86.1458333333 164.975
8 7 242.2917 231.6 7.5 242.291666667 313.375
9 8 542.0375 411.8 8.5 542.0375 528.375
10 9 1050.983 664.6 9.5 1050.98333333 821.975
h
at x= 5 y=20

xi+(1/2)h yi+(1/2)k2h k3 xi+1 yi+k3h k4 xi+1 y(4th order RK)


5 20
5.5 55.5875 71.175 6 91.175 71.175 6 86.14583333333
6.5 168.63333333 164.975 7 251.12083 164.975 7 242.2916666667
7.5 398.97916667 313.375 8 555.66667 313.375 8 542.0375
8.5 806.225 528.375 9 1070.4125 528.375 9 1050.983333333
9.5 1461.9708333 821.975 10 1872.9583 821.975 10 1846.729166667
1

y(true) Et error %
20 0 0
92.95 6.804167 7.320244
260.2 17.90833 6.882526
576.35 34.3125 5.953414
1108 57.01667 5.145909
1933.75 87.02083 4.500108

You might also like