This material was developed by Aaron Tresham at the University of Hawaii at Hilo and is

licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

- Intro to Sage
- Graphing and Solving Equations
- Limits
- Symbolic Integration

A definite integral is considered "improper" if the interval of integration is unbounded, the function being integrated is unbounded on the interval of integration, or both. In such cases, the usual definition of the definite integral does not apply.

Consider the function . Suppose we wanted the area under this curve for ; in other words, we want . This is an infinite region, so you might assume that it has infinite area. However, in this case the area is actually finite.

unknown message type 'text'

To see this, consider the integral for any . This is a normal definite integral, and the answer is .

What happens as ? We have .

So it make sense to say .

The previous example falls under the first type of improper integral, when one or both of the limits of integration is . In this case, the region under the curve is infinite in the horizontal direction.

Here is the **definition**:

If exists for every , then we define , provided this limit exists.

If the limit exists, we say the improper integral **converges** (or is convergent). Otherwise, we say it **diverges** (or is divergent).

Similarly, if exists for every , then we define , provided this limit exists.

Also, if there is a number such that and both converge, then we define .

Note: If these integrals converge for one value of , then they converge for any value of . The answer does not depend on the choice of .

It is interesting that may not equal .

Let's explore integrals of the form .

We already saw what happens when above, so let's try etc.

Interact: please open in CoCalc

The second type of improper integral is when the integrand (the function being integrated) is unbounded on the interval of integration. In this case, the region under the curve is infinite in the vertical direction.

Consider .

We have finite limits of integration, but notice that is not bounded on the interval , since .

Notice that for we have .

If we try to compute this integral in Sage, it will ask us for more information.

Error in lines 2-2
Traceback (most recent call last):
File "/projects/9189c752-e334-4311-afa9-605b6159620a/.sagemathcloud/sage_server.py", line 879, in execute
exec compile(block+'\n', '', 'single') in namespace, locals
File "", line 1, in <module>
File "/projects/sage/sage-6.7/local/lib/python2.7/site-packages/sage/misc/functional.py", line 663, in integral
return x.integral(*args, **kwds)
File "sage/symbolic/expression.pyx", line 10712, in sage.symbolic.expression.Expression.integral (build/cythonized/sage/symbolic/expression.cpp:52941)
return integral(self, *args, **kwds)
File "/projects/sage/sage-6.7/local/lib/python2.7/site-packages/sage/symbolic/integration/integral.py", line 761, in integrate
return definite_integral(expression, v, a, b, hold=hold)
File "sage/symbolic/function.pyx", line 994, in sage.symbolic.function.BuiltinFunction.__call__ (build/cythonized/sage/symbolic/function.cpp:10865)
res = super(BuiltinFunction, self).__call__(
File "sage/symbolic/function.pyx", line 502, in sage.symbolic.function.Function.__call__ (build/cythonized/sage/symbolic/function.cpp:6801)
res = g_function_evalv(self._serial, vec, hold)
File "sage/symbolic/function.pyx", line 1065, in sage.symbolic.function.BuiltinFunction._evalf_or_eval_ (build/cythonized/sage/symbolic/function.cpp:11522)
return self._eval0_(*args)
File "/projects/sage/sage-6.7/local/lib/python2.7/site-packages/sage/symbolic/integration/integral.py", line 176, in _eval_
return integrator(*args)
File "/projects/sage/sage-6.7/local/lib/python2.7/site-packages/sage/symbolic/integration/external.py", line 23, in maxima_integrator
result = maxima.sr_integral(expression, v, a, b)
File "/projects/sage/sage-6.7/local/lib/python2.7/site-packages/sage/interfaces/maxima_lib.py", line 784, in sr_integral
self._missing_assumption(s)
File "/projects/sage/sage-6.7/local/lib/python2.7/site-packages/sage/interfaces/maxima_lib.py", line 993, in _missing_assumption
raise ValueError(outstr)
ValueError: Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(t-1>0)', see `assume?` for more details)
Is t-1 positive, negative or zero?

Sage needs some information about . We can give it this information using the assume command.

-t*log(t) + t - 1

What happens as ?

-1

So it makes sense to define .

Here's the **definition** in general:

If is continuous on the interval and is unbounded near , then we define , provided this limit exists.

Similarly, if is continuous on the interval and is unbounded near , then we define , provided this limit exists.

Also, if is continuous on the intervals and and unbounded near , then we define , provide both of these converge.

Let's look at a graph of the integrand. Notice that it is unbounded near 0.

Thus, this is an improper integral, so

Therefore, this integral diverges.

+Infinity

Note that Sage can handle improper integrals. It informs us that this integral is divergent (see the last line of the error output).

Error in lines 1-1
Traceback (most recent call last):
File "/projects/9189c752-e334-4311-afa9-605b6159620a/.sagemathcloud/sage_server.py", line 736, in execute
exec compile(block+'\n', '', 'single') in namespace, locals
File "", line 1, in <module>
File "/usr/local/sage/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/misc/functional.py", line 799, in integral
return x.integral(*args, **kwds)
File "expression.pyx", line 10184, in sage.symbolic.expression.Expression.integral (build/cythonized/sage/symbolic/expression.cpp:44846)
File "/usr/local/sage/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/symbolic/integration/integral.py", line 699, in integrate
return definite_integral(expression, v, a, b)
File "function.pyx", line 914, in sage.symbolic.function.BuiltinFunction.__call__ (build/cythonized/sage/symbolic/function.cpp:8891)
File "function.pyx", line 504, in sage.symbolic.function.Function.__call__ (build/cythonized/sage/symbolic/function.cpp:5761)
File "/usr/local/sage/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/symbolic/integration/integral.py", line 173, in _eval_
return integrator(*args)
File "/usr/local/sage/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/symbolic/integration/external.py", line 21, in maxima_integrator
result = maxima.sr_integral(expression, v, a, b)
File "/usr/local/sage/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/interfaces/maxima_lib.py", line 786, in sr_integral
raise ValueError("Integral is divergent.")
ValueError: Integral is divergent.

When we look at the graph, we see that the integrand is unbounded near 9.

So we have

(4*sqrt(2)) - 2*sqrt(-t + 9)

2^(5/2)

Here is the direct computation:

2^(5/2)

Notice that is unbounded near , which is in the middle of our interval (not one of the limits of integration).

In this case, we need to split our integral into two:

Both of the integrals on the right are unbounded near one of the limits of integration, like the previous examples.

Now we use limits to evaluate the two improper integrals.

log(-t + 1)

-Infinity

log(2) - log(t - 1)

+Infinity

Since one of these integrals (actually both) diverges, the original integral diverges.

Note: It is *not* correct to say the answer is .

Here is the direct computation in Sage. Note that Sage tells us the integral is divergent.

Error in lines 1-1
Traceback (most recent call last):
File "/projects/9189c752-e334-4311-afa9-605b6159620a/.sagemathcloud/sage_server.py", line 873, in execute
exec compile(block+'\n', '', 'single') in namespace, locals
File "", line 1, in <module>
File "/usr/local/sage/sage-6.5/local/lib/python2.7/site-packages/sage/misc/functional.py", line 663, in integral
return x.integral(*args, **kwds)
File "sage/symbolic/expression.pyx", line 10613, in sage.symbolic.expression.Expression.integral (build/cythonized/sage/symbolic/expression.cpp:52409)
return integral(self, *args, **kwds)
File "/usr/local/sage/sage-6.5/local/lib/python2.7/site-packages/sage/symbolic/integration/integral.py", line 731, in integrate
return definite_integral(expression, v, a, b, hold=hold)
File "sage/symbolic/function.pyx", line 993, in sage.symbolic.function.BuiltinFunction.__call__ (build/cythonized/sage/symbolic/function.cpp:10572)
res = super(BuiltinFunction, self).__call__(
File "sage/symbolic/function.pyx", line 499, in sage.symbolic.function.Function.__call__ (build/cythonized/sage/symbolic/function.cpp:6457)
res = g_function_evalv(self._serial, vec, hold)
File "sage/symbolic/function.pyx", line 1064, in sage.symbolic.function.BuiltinFunction._evalf_or_eval_ (build/cythonized/sage/symbolic/function.cpp:11230)
return self._eval0_(*args)
File "/usr/local/sage/sage-6.5/local/lib/python2.7/site-packages/sage/symbolic/integration/integral.py", line 175, in _eval_
return integrator(*args)
File "/usr/local/sage/sage-6.5/local/lib/python2.7/site-packages/sage/symbolic/integration/external.py", line 21, in maxima_integrator
result = maxima.sr_integral(expression, v, a, b)
File "/usr/local/sage/sage-6.5/local/lib/python2.7/site-packages/sage/interfaces/maxima_lib.py", line 782, in sr_integral
raise ValueError("Integral is divergent.")
ValueError: Integral is divergent.

If you're doing this by hand, it is very important that you notice at the beginning that the integrand is unbounded, and so the integral is improper. If you treat this like a regular definite integral, you will get the wrong answer:

The integral diverges; it is *not* equal to . So what went wrong? When you compute this like a normal definite integral, you are assuming that the integrand is bounded on the interval of integration (that's part of the definition of the definite integral). Since this assumption is false, you get the wrong answer.

So be on the lookout for unbounded functions!

Notice that the interval of integration is unbounded, and the integrand is unbounded near 0. So we need to split this up into two integrals.

So we have

Note: The choice of 1 as the other limit of integration was arbitrary.

1/2*pi - 2*arctan(sqrt(t))

-1/2*pi + 2*arctan(sqrt(t))

1/2*pi

1/2*pi

Here's the direct calculation:

pi

Note: If you get an error that says "Assumption is redundant" or "Assumption is inconsistent," then find a blank line, type forget(), and hit "Run."