166 7.7 Example 9: Using the Comparison Theorem for Non-negative Integrals.

Example 9 (a) picture:

Show[Plot[Callout[1/(x+1),"y = 1/(x+1)",{5,0.1}],{x,2,20},PlotRange->{0,.35},Filling->Axis],​​ Plot[Callout[1/(x+Sin[x]),"y = 1/(x+sin(x))",{5,0.3}],{x,2,20},PlotRange->{0,.35}]]
Out[]=
Theshadedregioncorrespondsto
∞
∫
2
1
(x+1)
x,whichdiverges.Sinceweknowthatforallx≥2,0≤
1
(x+1)
≤
1
(x+sin(x))
,itfollowsfromtheComparisonTheoremforNon-NegativeIntegrands(Theorem1inLecture10)that
∞
∫
2
1
(x+sin(x))
xdiverges!

Example 9 (b):

Picture for example 9 (b):

ShowPlotCallout1x^2,"y = 1/
2
x
",{1.5,0.8},{x,1,10},Filling->Axis,PlotRange->{0,1},​​ PlotCalloutx(x^3+Sqrt[x]),"y = x/​
3
x
+
x
​",{1,0.2},{x,1,10},PlotRange->{0,1}
Out[]=
Theshadedregioncorrespondsto
∞
∫
1
1
2
x
x=1.Sinceweknowthatforallx≥1,0≤
x
3
x
+
x
≤
1
2
x
,itfollowsfromtheComparisonTheoremforNon-NegativeIntegrands(Theorem1inLecture10)that
∞
∫
1
x
3
x
+
x
xconverges!

Estimate the integral in Example 9 (b):

ObservethatI=
I
1
+
I
2
,where
I
1
=
10
∫
1
f(x)xand
I
2
=
∞
∫
10
f(x)x.ItfollowsthatwecanestimateI≈
I
1
.(UsetheTrapezoidRulewithn=50toestimate
I
1
.)
In[]:=
Trapezoid[f_,a_,b_,n_]:=
n
∑
i=1
(1/2)(f[a+(i-1)*(b-a)/n]+f[a+i*(b-a)/n])*(b-a)/n
In[]:=
f[x_]:=x/(x^3+Sqrt[x])
N[Trapezoid[f,1,10,50]]
Out[]=
0.714904
Thus,
I
1
≈ 0.714904, so we can conclude that I ≈
I
1
.

Error estimate for Example 9 (b): Let I =
I
1
+
I
2
where
I
1
=
10
∫
1
f(x)x
and
I
2
=
∞
∫
10
f(x)x.

Nowfindanupperboundontheerrorintroducedbyusing
I
1
toestimateI.Thewaytodothisistoobservethat​​ |I-
T
n
|=|
I
1
+
I
2
-
T
n
|=
I
1
-
T
n
+
I
2
≤
I
1
-
T
n
+
I
2
≤(errorinusingthetrapezoidruletoestimate
I
1
)+
I
2
≤
3
K
2
(b-a)
12
2
n
+
∞
∫
10
g(x)x​​where
K
2
isanupperboundon|f''(x)|n[a,b]and0≤f(x)≤g(x)forx≥10.Weneedtofindavaluefor
K
2
.​​​​Thefollowingworkshowsthatwecantake
K
2
tobe0.276.
NSolve[f'''[x]==0,x]
Out[]=
{{x1.47319},{x-1.19184-0.865921},{x-1.19184+0.865921},{x0.324042-0.153639},{x0.324042+0.153639},{x-0.171849-0.314763},{x-0.171849+0.314763},{x-0.352462-0.0661711},{x-0.352462+0.0661711}}
N[f''[{1,1.47319,10}]]
Out[]=
{-0.125,0.275014,0.000592229}
{-0.125`,0.275014321953694507`,0.000592229048906810007`}
Out[]=
{-0.125,0.275014,0.000592229}
If we choose
K
2
to be a number larger than 0.275014321953694507, then we can estimate the error!
In[]:=
K2=0.276;
Itfollowsthataboundontheerrorinusingthetrapezoidrulewithn=50toestimate
I
1
,i.e.|
I
1
-
T
50
|,is:
(K2*(10-1)^3)/(12*50^2)
Out[]=
0.0067068
Nowweneedtoestimatetheerrorinignoringthetail(i.e.
I
2
).Takeg(x)=
1
2
x
.
Limit[Integrate[1/x^2,{x,10,t}],t->Infinity]
Out[]=
1
10
Thus,|I-
T
50
|≤0.0067068+0.10=0.1067068.