Given:
Integral, ∫03xe2x dx.
Formula used:
(1) Formula for h is given by,
h=b−an
(2) Formula for true error percent is,
εt=| analytical value − I valueanalytical value |×100%
(3) Formula for relative percent error is,
εa=| I1,k − I2,k−1I1,k |×100%
Calculation:
Consider the following integral:
I=∫03xe2x dx
This integral is a definite integral.
For analytical solution, simplify it as follows with respect to x, ∫03xe2x dx=[ xe2x2−e2x4 ]03=[ 2xe2x−e2x4 ]03=(2(3)e6−e64)−(0e0−e04)=504.2859+0.25=504.5359
Hence, the analytical value of ∫03xe2x dx is 504.5359.
Let f(x)=xe2x
Use the application of the trapezoidal rule:
For n=1
, I=h2[ f(x0)+f(x1) ].
Here, a=0 and b=3.
Formula for h is given by,
h=b−an
Substitute the value of a=0 and b=3 and simplify it as follows,
h=3−01=3
Values for x0 and x1 are,
x0=0x1=x0+h=0+3=3
Substitute the values in I
I=32[ f(0)+f(3) ].. .. .. (1)
Calculate f(0) as
f(0)=(0)e2(0)=0
Calculate f(3) as
f(3)=(3)e2(3)=3e6=1210.286
Substitute the values f(0)=0 and f(3)=1210.286 in equation (1) and simplify it as follows,
I=32[ 0+1210.286 ]=3×1210.2862=1815.429
For n=2
, I=h2[ f(x0)+2f(x1)+f(x2) ].
Formula for h is given by,
h=b−an
Substitute the value of a=0, b=3 and n=2 and simplify it as follows,
h=3−02=1.5
Values for x0
, x1 and x2 are,
x0=0,x1=0+1.5=1.5x2=3
Substitute the values in I
I=1.52[ f(0)+2f(1.5)+f(3) ].. .. .. (2)
Calculate f(1.5) as
f(1.5)=(1.5)e2(1.5)=1.5e3=30.1283
Substitute the values f(0)=0, f(1.5)=30.1283 and f(3)=1210.286 in equation (2) and simplify it as follows,
I=1.52[ 0+2(30.1283)+1210.286 ]=1.5×1270.54262=952.90695
For n=3
, I=h2[ f(x0)+2f(x1)+2f(x2)+2f(x3)+f(x4) ].
Substitute the value of a=0, b=3 and n=4
and simplify it as follows,
h=3−04=0.75
Values for x0 and x1 are,
x0=0x1=0+0.75=0.75
Values for x2 and x3 are,
x2=0.75+0.75=1.5x3=1.5+0.75=2.25
And, x4=3
Substitute the values in I, I=0.752[ f(0)+2f(0.75)+2f(1.5)+2f(2.25)+f(3) ].. .. .. (3)
Calculate f(0.75) as
f(0.75)=(0.75)e2(0.75)=0.75e1.5=3.36127
Calculate f(2.25) as
f(2.25)=(2.25)e2(2.25)=2.25e4.5=202.5385
Substitute the values f(0)=0, f(1.5)=30.1283, f(0.75)=3.36127, f(2.25)=202.5385 and f(3)=1210.286 in equation (3) and simplify it as follows,
I=0.752[ 0+2(3.36127)+2(30.1283)+2(202.5385)+1210.286 ]=0.75×1682.342142=630.8783
For n=4
, I=h2[ f(x0)+2f(x1)+2f(x2)+2f(x3)+f(x4) ]
Formula for h is given by,
h=b−an
Substitute the value of a=0, b=3 and n=4 and simplify it as follows,
h=3−08=0.375
Values for x0 and x1 are,
x0=0,x1=0+0.375=0.375
Values for x2 and x3 are,
x2=0.375+0.375=0.75x3=0.75+0.375=1.125
Values for x4 and x5 are,
x4=1.125+0.375=1.5x5=1.5+0.375=1.875
Values for x6 and x7 are,
x6=1.875+0.375=2.25x7=2.25+0.375=2.625
And,
x8=2.625+0.375=3
Substitute the values in I, I=0.752[ f(0)+2f(0.375)+2f(0.75)+2f(1.125)+2f(1.5)+2f(1.875)+2f(2.25)+2f(2.625)+f(3)].. .. .. (4)
Calculate f(0.375) as
f(0.375)=(0.375)e2(0.375)=0.375e0.75=0.793875
Calculate f(1.125) as
f(1.125)=(1.125)e2(1.125)=1.125e2.25=10.6737
Calculate f(1.875) as
f(1.875)=(1.875)e2(1.875)=1.875e3.75=79.72702
Calculate f(2.625) as
f(2.625)=(2.625)e2(2.625)=2.625e5.25=500.23645
Substitute the values obtained in equation (4) and simplify it as follows,
I=0.3752[ 0+2(0.793875)+2(3.36127)+2(10.6737)+2(30.1283)+2(79.72702)+2(202.5385)+2(500.23645)+1210.286]=0.375×2865.204232=537.22579
Use the Romberg integration method,
For O(h4)
with n=1,2
I≃43Im−13Il
The Im
represents more accurate value and Il
represents the less accurate value.
Values for Im and Ii are,
Im=952.90695Il=1815.429
Substitute the values in I
and simplify it as follows,
I≅43(952.90695)−13(1815.429)≅1270.5426−605.143≅665.3996
For O(h4)
with n=2,4
Values for Im and Ii are,
Im=630.8783Il=952.90695
Substitute the values in I and simplify it as follows,
I≅43(630.8783)−13(952.90695)≅841.171067−317.63565≅523.535417
For O(h4)
with n=4,8
Values for Im and Ii are,
Im=537.22579Il=630.8783
Substitute the values in I
and simplify it as follows,
I≅43(537.22579)−13(630.8783)≅716.30105−210.29276≅506.00829
For O(h6)
with n=1,2
I≅1615Im−115Il
Values for Im and Ii are,
Im=523.535417Il=665.3996
Substitute the values in I
and simplify it as follows,
I≅1615(523.535417)−115(665.3996)≅558.437778−44.359973≅514.077805
For O(h6)
with n=2,4
Values for Im and Ii are,
Im=506.00829Il=523.535417
Substitute the values in I
and simplify it as follows,
I≃1615(506.00829)−115(523.535417)≃539.742176−34.902361≃504.839815
For O(h8)
with n=4,8
Values for Im and Ii are,
Im=504.839815Il=514.077805
Substitute the values in I
and simplify it as follows,
I≅6463(504.839815)−163(514.077805)≅512.853145−8.159965≅504.69318
Formula for true error percent is,
εt=| analytical value − I valueanalytical value |×100%
Consider the following values,
analytical value=504.5359I value=1815.429
Substitute the values and simplify it as follows,
εt=| 504.5359−1815.429504.5359 |×100%=259.821%
Formula for true error percent for O(h4) is,
εt=| analytical value − I valueanalytical value |×100%
Consider the following values,
analytical value=504.5359I value=665.3996
Substitute the values and simplify it as follows,
εt=| 504.5359−665.3996504.5359 |×100%=31.88%
Formula for true error percent for O(h6) is,
εt=| analytical value − I valueanalytical value |×100%
Consider the following values,
analytical value=504.5359I value=514.077805
Substitute the values and simplify it as follows,
εt=| 504.5359−514.077805504.5359 |×100%=1.891%
Formula for true error percent for O(h8) is,
εt=| analytical value − I valueanalytical value |×100%
Consider the following values,
analytical value=504.5359I value=504.69318
Substitute the values and simplify it as follows,
εt=| 504.5359−504.69318504.5359 |×100%=0.031%
Formula for relative error percent for O(h4) is,
εa=| I1,k − I2,k−1I1,k |×100%
Here, the value of k=2 for O(h4), Now,
εa=| I1,2 − I2,1I1,2 |×100%
Consider the following values,
I1,2=665.3996I2,1=952.90695
Substitute the values and simplify it as follows,
εa=| 665.3996−952.90695665.3996 |×100%=43.208%
Formula for relative error percent for O(h6) is,
εa=| I1,k − I2,k−1I1,k |×100%
Here, the value of k=3 for O(h6), Now,
εa=| I1,3 − I2,2I1,3 |×100%
Consider the following values,
I1,3=514.077805I2,2=523.535417
Substitute the values and simplify it as follows,
εa=| 514.077805−523.535417514.077805 |×100%=1.839%
Formula for relative error percent for O(h8) is,
εa=| I1,k − I2,k−1I1,k |×100%
Here, the value of k=4 for O(h8), Now,
εa=| I1,4 − I2,3I1,4 |×100%
Substitute the value of,
I1,4=504.69318I2,3=504.839815
Substitute the values and simplify it as follows,
εa=| 504.69318−504.839815504.69318 |×100%=0.029%
Consider the following table that shows O(h4),O(h6),O(h8),εt,εa, Iteration1234εt259.82131.881.8910.031εa43.2081.8390.02911815.429665.3996514.077805504.693182952.90695523.535417504.8398154630.8783506.008298537.22579
Hence, the value of integral, ∫03xe2x dx is 504.69318.