Math 166
 Computer Lab # 7
 Improper Integrals

Goal:  To investigate improper integrals, which are definite integrals for which one or both of the endpoints is infinite, or the integrand becomes infinite in the interval of integration.

Introduction

The fundamental theorem of calculus tells us how to evaluate the definite integral Üab f(x) dx using an antiderivative.  However, the theorem is only guaranteed as long as two things are true:
  * f(x) must be continuous (in particular, bounded) on [a,b];
  * a and b must be finite.

We want to determine when we can assign a (finite) value to  integrals in which one or both of the endpoints are infinite or the integrand f(x) becomes infinite.  Such integrals are called improper; the fundamental theorem of calculus cannot be applied directly to them.

Integrals with Infinite Endpoints

To understand an improper integral of the form ÜaÉ f(x) dx, we will look at the proper integrals Üat f(x) dx, where t is some finite value.  We can carry out the integration on any of the proper integrals, and get a value, which usually depends on t.  Then we will consider whether, as t increases towards infinity, the value of the definite integral approaches some limiting value.  If it does so, we will say that is the value of the improper integral.

Therefore, we may regard the improper integral  ÜaÉ f(x) dx as shorthand for computing the limit as t->É  of the proper integral Üat f(x) dx.

We say ÜaÉ f(x) dx converges and is equal to lim Üat f(x) dx provided the limit exists and is finite.      t->É          	                 
 
 Otherwise we say ÜaÉ f(x) dx diverges.

Example:  Consider the improper integral Ü1É 1/x2 dx.  We can start with a table of the proper integrals Ü1t 1/x2 dx for increasing values of t.

Clear[data,f,i,x]

f[x_]:=1/x^2

data=Table[{10^i,Integrate[f[x],{x,1,10^i}]}, 
     {i,1,6}] // N;
     
TableForm[data,TableHeadings->{None,{"t",
     "Integral from 1 to t"}} ]

We see that the proper integrals  Ü1t 1/x2 dx seem to approach a limiting value of 1.  To be sure, we must compute the value of the proper integral and take the limit:

Integrate[1/x^2, {x,1,t}]
Limit[ 1-1/t, t->Infinity]

Thus, we may conclude that

Ü1É 1/x2 dx   =    lim Ü1t 1/x2 dx   = lim (1 - 1/t)   =   1
                  t->É                t->É

Here are some plots of the behavior of 1/x^2:

p1=Plot[1/x^2,{x,1,10},DisplayFunction->Identity,
    PlotLabel->"1/x^2 from 1 to 10"]
p2=Plot[1/x^2,{x,1,100},DisplayFunction->Identity,
    PlotLabel->"1/x^2 from 1 to 100"]
Show[GraphicsArray[{p1,p2}],DisplayFunction->
    $DisplayFunction]

In the above example the integrand, 1/x^2, approaches 0 as x approaches infinity.  This is actually an example of a simple rule that applies to improper integrals with an infinite endpoint:

If the improper integral ÜaÉ f(x) dx converges, f(x) must tend to zero as x approaches infinity.
  
  If f(x) does not tend to zero as x approaches infinity, then the improper integral ÜaÉ f(x) dx cannot converge.

If f(x) tends to zero as x goes to infinity, is that enough to guarantee that we can assign a finite value to the integral?  The following exercise demonstrates that this is not enough.

Exercise: Consider the improper integral Ü1É 1/x  dx.  Certainly, 1/x tends to zero as x goes to infinity.  But can we assign a finite value to this integral?  Make a table of values for the integral Ü1t 1/x dx for the values of t from 10 to 1015.

Clear[f]
f[x_]:=1/x 
data=Table[{10^i,N[ Integrate[f[x],{x,1,10^i}] ]}, 
     {i,1,15}];
TableForm[data,TableHeadings->{None,{"t",
     "Integral from 1 to t"}} ]

Clearly the value of the definite integral increases without bound as t increases and we can assign no finite value to the integral.  We say that the integral diverges.

We can also handle integrals which have both endpoints infinite.  We break up the domain of integration at any convenient point c, and then look at the two new integrals separately:

Ü-ÉÉ f(x) dx  =   Ü-Éc f(x) dx  + ÜcÉ f(x) dx   

If either of the integrals on the right diverges, then the original integral diverges.  If both the integrals on the right converge, then the original integral converges.

Integrals with Infinite Integrands

Now we want to understand an improper integral of the form 
Üab f(x) dx, where a and b are finite, but f(x) "blows up", tending to an infinite value somewhere in the range of integration.

To start with, let us suppose that f(x) blows up at the right endpoint, b.  Then, for values of t that are slightly less than b, the proper integrals Üat f(x) dx are probably good approximations for the behavior of the improper integral.  We can carry out the integration on any of the proper integrals, and get a value, which usually depends on t.  Then we will consider whether, as t increases towards b (from below!), the value of the definite integral approaches some limiting value.  If it does so, we will say that is the value of the improper integral.

If the problem occurs at the left endpoint, we can easily modify the procedure defined above.  However, if the problem occurs in the middle, we must consider approximating the improper integral by two proper integrals, one for the left and one for the right hand side.

If f(x) becomes unbounded at an endpoint, say b, we write

    Üab f(x) dx  = lim  Üat f(x) dx. 
                   t->b-

If f(x) becomes unbounded at an internal point x=c, we write

   Üab f(x) dx = Üac f(x) dx + Ücb f(x) dx 
               = lim Üat f(x) dx + lim Ütb f(x) dx .
                 t->c-             t->c+
If the first, second, or both integrals on the right diverge, then the original integral diverges.  Only if both integrals on the right converge do we say that the original integral converges.

Example:  Consider the improper integral Ü01  1/Sqrt(x)  dx.  To get an idea of the integral's behavior, we start with a table of the proper integrals Üt1 1/Sqrt(x) dx for decreasing values of t.

data=Table[ 
  {N[2^(-n)], N[Integrate[ 1/Sqrt[x], {x,2^(-n),1}]] }, 
    {n,1,10} ];
TableForm[ data, TableHeadings->{None, {"t", "Integral"}}]

This table suggests that the proper integrals approach a limit as t approaches 0.  Let's verify this by computing the value of the definite integral for a symbolic value of t, and then looking at the limit as t approaches 0.

Clear[t]
Integrate[ 1/Sqrt[x], {x,t,1}]

Limit[%,t->0]

Thus, we may assign the value of 2 to the improper integral.

Math 166
Computer Lab #7
Name:_ _ _ _ _ _ _ _ _ _
Instructor:_ _ _ _ _ _ _ _ _

1.  The goal of this problem is to determine which integrals of the form Ü1É x^p dx converge, and which diverge.  The answer is going to be fairly simple - there is a cutoff value p*.  The integral will diverge or converge depending on whether p is greater or less than p*.

a.  We know that if x^p does not eventually drop towards zero as x increases, the integral Ü1É x^p dx cannot converge.  Plot x^p for p=2 and p=-2.  Give a condition on p that guarantees that x^p will decrease as x increases?

b.  Now we know that the cutoff value p* must be less than or equal to 0.  Let's look at a "typical" value of p in this range.  Set p=-1/2, and ask Mathematica to integrate x^p from 1 to t. (Don't give t a value!)

Ask Mathematica for the limit of this value, as t goes to Infinity.

Is the cutoff value p* less than -1/2, or greater than it?

c.  Repeat exercise b for p=-3/2.  Ask Mathematica to integrate x^p from 1 to t.

Ask Mathematica for the limit of this value, as t goes to Infinity.

Is the cutoff value p* less than -3/2, or greater than it?

d.  Now it is time to figure out exactly what the cutoff value is.  Start by clearing the value of p, and then ask Mathematica for the definite integral of x^p from 1 to t, for any p.

For one value of p, the general answer that Mathematica has given does not make sense.  What is this value?  For this particular value of p, what is the correct value of the definite integral from 1 to t of x^p?  What is the limit of this value as t goes to Infinity?

e)  The value of p you examined in part d is actually the cutoff value p*.  For any p greater than or equal to p*, the improper integral of x^p will diverge.  Look at the formula for the definite integral of x^p from 1 to t that Mathematica gave you in part d, and assume that p is greater than p*.  Now think about what happens as t goes to infinity.  Explain why the limit of the proper integrals will be infinite.

2.   The improper integral of 1/x doesn't converge.  In this problem, we try to find a function that's just a little bit smaller than 1/x, and whose integral does converge.

a. Consider the improper integral ÜeÉ 1/(x ln x) dx.  Plot the functions 1/x and 1/(x ln x) from e to 10.  (Mathematica will recognize the letter "E" for what we call "e").

Find the value of the improper integral, by computing the proper integral from E to a symbolic upper limit t, and then taking the limit.

Make a table of the integrals Üet 1/(x ln x) dx for t=1010, 1015, 1020, and 1025.

b.  Repeat part a, but now for ÜeÉ 1/( x(ln x)2 )dx.

c. Finally, compare the functions 1/x, 1/(x ln x), and 
1/(x (ln x)^2) by plotting them from E to 10.

3. In this problem, we are going to be integrating x^(-1/3) over several different intervals.

a) Ask Mathematica for the indefinite integral of x^(-1/3), using the Integrate command without limits.

Compute the integral Ü13 1/x^(1/3) dx by evaluating the indefinite integral function at 3, and subtracting its value at 1.  (This is just the fundamental theorem of Calculus).

b) Now ask Mathematica to compute the definite integral in one step using the Integrate command with limits 1 and 3.  You should get the same answer as in part a.

c)  Now ask Mathematica to compute the definite integral over the range -1 to 3.  Your result is probably a complex number, which can't possibly be right.  What is going wrong?

d) Find the correct integral of 1/x^(1/3) from -1 to 3.

4. The factorial function x! is defined as 
    x!= 1 * 2 * 3 * ... * (x-1) * x.  
Mathematica allows you to write Factorial[x] or x!.  Note that the factorial formula only makes sense when x is a nonnegative integer.  (The special value 0! is defined to be 1).

a) Make a ListPlot of the factorial function between 0 and 6, and name it p1.

b) The factorial function is so useful that mathematicians struggled to find a function that "filled in the gaps" between the known values of the factorial function.  They came up with the Gamma[x] function, which is defined for all positive values of x (and most negative ones), and has the property that Gamma(x+1)=x!.

Make a Plot of Gamma[x] between 1 and 7, and name it p2.  Use a Show command to display p1 and p2 together, to show how the Gamma and Factorial functions are related.  (Of course, one plot is shifted one unit over.)

c) Whether we ask Mathematica for 5! or Gamma[6], the answer had better equal 120=1*2*3*4*5.  We can ask Mathematica for the value of 5.5! or Gamma[6.5], but now we can't check the answer using the formula, because it doesn't make sense when x is not an integer.  Let's make two simple checks on the result, though:

Verify that 5! < 5.5! < 6!

Verify that 6.5! = 6.5 * 5.5!

d)  The Gamma function is defined as an improper integral:
       Gamma(z) = Ü0É e-x xz-1 dx.
We have already found a value for Gamma(6.5) by asking Mathematica.  Let's evaluate Gamma(6.5) ourselves, by trying to evaluate:
        Gamma(6.5) = Ü0É e-x x5.5 dx.

Set z to 6.5, and use the Integrate command to evaluate the integral from x=0 to x=t, where t is a symbolic value.  (To be sure t does not accidentally have a numerical value, Clear t first!)  Mathematica will probably not be able to come up with a useful result for this complicated integrand.

e). Since Integrate fails, try using the NIntegrate command to evaluate the integral from x=0 to x=t.  (Make sure t is still a symbolic value).  Why doesn't this work?

f) The only thing left we can try is to pick big values for the upper limit t, use the Nintegrate command, and make a guess as to what happens as t increases.

Make a table of the value of the integral from x=0 to x=t, using t=10 to t=100 in increments of 10.  What appears to be the limit of these integrals?  Does it agree with the computed value Gamma(6.5)?