Skip to main content
\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)
Mathematics LibreTexts

6.8: Improper Integration

  • Page ID
    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)

    We begin this section by considering the following definite integrals:

    \[ \int_0^{100}\dfrac1{1+x^2}\ dx \approx 1.5608,\]

    \[ \int_0^{1000}\dfrac1{1+x^2}\ dx \approx 1.5698,\]

    \[ \int_0^{10,000}\dfrac1{1+x^2}\ dx \approx 1.5707.\]

    Notice how the integrand is \(1/(1+x^2)\) in each integral (which is sketched in Figure \(\PageIndex{1}\)). As the upper bound gets larger, one would expect the "area under the curve" would also grow. While the definite integrals do increase in value as the upper bound grows, they are not increasing by much. In fact, consider:

    $$\begin{align} \int_0^b \frac{1}{1+x^2}\ dx &= \left. \tan^{-1}x \right|_0^b \\[4pt] &= \tan^{-1}b-\tan^{-1}0 \\[4pt] &= \tan^{-1}b. \end{align}$$

    As \(b\rightarrow \infty\), \(\tan^{-1}b \rightarrow \pi/2.\) Therefore it seems that as the upper bound \(b\) grows, the value of the definite integral \(\int_0^b\frac{1}{1+x^2}\ dx\) approaches \(\pi/2\approx 1.5708\). This should strike the reader as being a bit amazing: even though the curve extends "to infinity," it has a finite amount of area underneath it.


    Figure \(\PageIndex{1}\): Graphing \( f(x)=\frac{1}{1+x^2}\)

    When we defined the definite integral \(\int_a^b f(x)\ dx\), we made two stipulations:

    1. The interval over which we integrated, \([a,b]\), was a finite interval, and
    2. The function \(f(x)\) was continuous on \([a,b]\) (ensuring that the range of \(f\) was finite).

    In this section we consider integrals where one or both of the above conditions do not hold. Such integrals are called improper integrals.

    Improper Integrals with Infinite Bounds

    Definition \(\PageIndex{1}\): Improper Integrals with Infinite Bounds; Converge, Diverge

    1. Let \(f\) be a continuous function on \([a,\infty)\). Define $$ \int_a^\infty f(x)\ dx \equiv \lim_{b\to\infty}\int_a^b f(x)\ dx.$$
    2. Let \(f\) be a continuous function on \((-\infty,b]\). Define $$ \int_{-\infty}^b f(x)\ dx \equiv \lim_{a\to-\infty}\int_a^b f(x)\ dx.$$
    3. Let \(f\) be a continuous function on \((-\infty,\infty)\). Let \(c\) be any real number; define $$ \int_{-\infty}^\infty f(x)\ dx \equiv \lim_{a\to-\infty}\int_a^c f(x)\ dx\ +\ \lim_{b\to\infty}\int_c^b f(x)\ dx.$$

    An improper integral is said to converge if its corresponding limit exists; otherwise, it diverges. The improper integral in part 3 converges if and only if both of its limits exist.

    Example \(\PageIndex{1}\): Evaluating improper integrals

    Evaluate the following improper integrals.

    1. \(\int_1^\infty \frac1{x^2}\ dx\)
    2. \(\int_1^\infty \frac1x\ dx\)
    3. \(\int_{-\infty}^0 e^x\ dx\)
    4. \(\int_{-\infty}^\infty \frac1{1+x^2}\ dx\)


    1. \[\begin{align}[t] \int_1^\infty \frac{1}{x^2}\ dx\ =\ \lim_{b\to\infty} \int_1^b\frac1{x^2}\ dx\ &=\ \lim_{b\to\infty} \frac{-1}{x}\Big|_1^b \\ &= \lim_{b\to\infty} \frac{-1}{b} + 1\\ &= 1.\end{align}\] A graph of the area defined by this integral is given in Figure \(\PageIndex{2}\).


    Figure \(\PageIndex{2}\): A graph of \(f(x) = \frac{1}{x^2}\) in Example \(\PageIndex{1}\).

    1. \[\begin{align} \int_1^\infty \frac1x\ dx & = \lim_{b\to\infty}\int_1^b\frac1x\ dx \\ &= \lim_{b\to\infty} \ln |x|\Big|_1^b \\ &= \lim_{b\to\infty} \ln (b)\\ &= \infty. \end{align}\] The limit does not exist, hence the improper integral \(\int_1^\infty\frac1x\ dx\) diverges. Compare the graphs in Figures \(\PageIndex{3a}\) and \(\PageIndex{3b}\); notice how the graph of \(f(x) = 1/x\) is noticeably larger. This difference is enough to cause the improper integral to diverge.


    Figure \(\PageIndex{3}\): A graph of \(f(x) = \frac{1}{x}\) in Example \(\PageIndex{1}\)

    1. \[\begin{align} \int_{-\infty}^0 e^x \ dx &= \lim_{a\to-\infty} \int_a^0e^x\ dx \\ &= \lim_{a\to-\infty} e^x\Big|_a^0 \\ &= \lim_{a\to-\infty} e^0-e^a \\&= 1. \end{align}\] A graph of the area defined by this integral is given in Figure \(\PageIndex{4}\).


    Figure \(\PageIndex{4}\): A graph of \(f(x) = e^x\) in Example \(\PageIndex{1}\)

    1. We will need to break this into two improper integrals and choose a value of \(c\) as in part 3 of Definition \(\PageIndex{1}\). Any value of \(c\) is fine; we choose \(c=0\). \[\begin{align} \int_{-\infty}^\infty \frac1{1+x^2}\ dx &= \lim_{a\to-\infty} \int_a^0\frac{1}{1+x^2}\ dx + \lim_{b\to\infty} \int_0^b\frac{1}{1+x^2}\ dx \\ &= \lim_{a\to-\infty} \tan^{-1}x\Big|_a^0 + \lim_{b\to\infty} \tan^{-1}x\Big|_0^b\\ &= \lim_{a\to-\infty} \left(\tan^{-1}0-\tan^{-1}a\right) + \lim_{b\to\infty} \left(\tan^{-1}b-\tan^{-1}0\right)\\ &= \left(0-\frac{-\pi}2\right) + \left(\frac{\pi}2-0\right).\end{align}\] Each limit exists, hence the original integral converges and has value:\[= \pi.\] A graph of the area defined by this integral is given in Figure \(\PageIndex{5}\).


    Figure \(\PageIndex{5}\): A graph of \(f(x) = \frac{1}{1+x^2}\) in Example \(\PageIndex{1}\)

    The previous section introduced L'Hôpital's Rule, a method of evaluating limits that return indeterminate forms. It is not uncommon for the limits resulting from improper integrals to need this rule as demonstrated next.

    Example \(\PageIndex{2}\): Improper integration and L'Hôpital's Rule

    Evaluate the improper integral

    \[\int_1^\infty \frac{\ln x}{x^2}\ dx.\]


    This integral will require the use of Integration by Parts. Let \(u = \ln x\) and \(dv = 1/x^2\ dx\). Then


    Figure \(\PageIndex{6}\): A graph of \(f(x) = \frac{\ln x}{x^2}\) in Example \(\PageIndex{2}\)

    \[\begin{align}\int_1^\infty\frac{\ln x}{x^2}\ dx &= \lim_{b\to\infty}\int_1^b\frac{\ln x}{x^2}\ dx \\ &= \lim_{b\to\infty}\left(-\frac{\ln x}{x}\Big|_1^b +\int_1^b \frac{1}{x^2} \ dx \right)\\ &= \lim_{b\to\infty} \left.\left(-\frac{\ln x}{x} -\frac1x\right)\right|_1^b\\ &= \lim_{b\to\infty} \left(-\frac{\ln b}{b}-\frac1b - \left(-\ln 1-1\right)\right).\end{align}\]

    The \(1/b\) and \(\ln 1\) terms go to 0, leaving \( \lim_{b\to\infty} -\frac{\ln b}b + 1.\) We need to evaluate \( \lim_{b\to\infty} \frac{\ln b}{b}\) with L'Hôpital's Rule. We have:

    \[\begin{align} \lim_{b\to\infty}\frac{\ln b}b &\stackrel{\ \text{ by LHR } \ }{=} \lim_{b\to\infty} \frac{1/b}{1} \\ &= 0.\end{align}\]

    Thus the improper integral evaluates as:

    \[\int_1^\infty\frac{\ln x}{x^2}\ dx = 1.\]

    Improper Integrals with Infinite Range

    We have just considered definite integrals where the interval of integration was infinite. We now consider another type of improper integration, where the range of the integrand is infinite.

    Definition \(\PageIndex{2}\): Improper Integration with Infinite Range

    {Let \(f(x)\) be a continuous function on \([a,b]\) except at \(c\), \(a\leq c\leq b\), where \(x=c\) is a vertical asymptote of \(f\). Define

    $$\int_a^b f(x)\ dx = \lim_{t\to c^-}\int_a^t f(x)\ dx + \lim_{t\to c^+}\int_t^b f(x)\ dx.$$

    Example \(\PageIndex{3}\): Improper integration of functions with infinite range

    Evaluate the following improper integrals:

    \( 1.\ \int_0^1\frac1{\sqrt{x}}\ dx \hskip 50pt 2. \ \int_{-1}^1\frac{1}{x^2}\ dx.\)


    1. A graph of \(f(x) = 1/\sqrt{x}\) is given in Figure \(\PageIndex{7}\). Notice that \(f\) has a vertical asymptote at \(x=0\); in some sense, we are trying to compute the area of a region that has no "top." Could this have a finite value? \[\begin{align} \int_0^1 \frac{1}{\sqrt{x}}\ dx &= \lim_{a\to0^+}\int_a^1 \frac1{\sqrt{x}}\ dx \\&=\lim_{a\to0^+} 2\sqrt{x}\Big|_a^1 \\ &= \lim_{a\to0^+} 2\left(\sqrt{1}-\sqrt{a}\right)\\ &= 2.\end{align}\]
      It turns out that the region does have a finite area even though it has no upper bound (strange things can occur in mathematics when considering the infinite).
      Note: In Definition \(\PageIndex{1}\), \(c\) can be one of the endpoints (\(a\) or \(b\)). In that case, there is only one limit to consider as part of the definition.


    Figure \(\PageIndex{7}\): A graph of \(f(x)=\frac{1}{\sqrt{x}}\) in Example \(\PageIndex{3}\)

    1. The function \(f(x) = 1/x^2\) has a vertical asymptote at \(x=0\), as shown in Figure \(\PageIndex{8}\), so this integral is an improper integral. Let's eschew using limits for a moment and proceed without recognizing the improper nature of the integral. This leads to: \[\begin{align}\int_{-1}^1\frac1{x^2}\ dx &= -\frac1x\Big|_{-1}^1\\ &= -1 - (1)\\ &=-2 ! \end{align}\] Clearly the area in question is above the \(x\)-axis, yet the area is supposedly negative! Why does our answer not match our intuition? To answer this, evaluate the integral using Definition \(\PageIndex{2}\). \[\begin{align} \int_{-1}^1\frac1{x^2}\ dx &= \lim_{t\to0^-}\int_{-1}^t \frac1{x^2}\ dx + \lim_{t\to0^+}\int_t^1\frac1{x^2}\ dx \\ &= \lim_{t\to0^-}-\frac1x\Big|_{-1}^t + \lim_{t\to0^+}-\frac1x\Big|_t^1\\ &= \lim_{t\to0^-}-\frac1t-1 + \lim_{t\to0^+} -1+\frac1t\\ &\Rightarrow \Big(\infty-1\Big)\ + \ \Big(- 1+\infty\Big).\end{align}\] Neither limit converges hence the original improper integral diverges. The nonsensical answer we obtained by ignoring the improper nature of the integral is just that: nonsensical.


    Figure \(\PageIndex{8}\): A graph of \(f(x)=\frac{1}{x^2}\) in Example \(\PageIndex{3}\)

    Understanding Convergence and Divergence

    Oftentimes we are interested in knowing simply whether or not an improper integral converges, and not necessarily the value of a convergent integral. We provide here several tools that help determine the convergence or divergence of improper integrals without integrating.

    Our first tool is to understand the behavior of functions of the form \( \frac1{x\hskip1pt ^p}\).

    Example \(\PageIndex{4}\): Improper integration of \(1/x^p\)

    Determine the values of \(p\) for which \(\int_1^\infty \frac1{x\hskip1pt ^p}\ dx\) converges.


    We begin by integrating and then evaluating the limit.

    \[\begin{align} \int_1^\infty \frac1{x\hskip1pt ^p}\ dx &= \lim_{b\to\infty}\int_1^b\frac1{x\hskip1pt ^p}\ dx\\ &= \lim_{b\to\infty}\int_1^b x^{-p}\ dx \qquad \text{(assume $p\neq 1$)}\\&= \lim_{b\to\infty} \frac{1}{-p+1}x^{-p+1}\Big|_1^b\\ &= \lim_{b\to\infty} \frac{1}{1-p}\big(b\hskip1pt^{1-p}-1^{1-p}\big).\\\end{align}\]

    When does this limit converge -- i.e., when is this limit not \(\infty\)? This limit converges precisely when the power of \(b\) is less than 0: when \(1-p<0 \Rightarrow 1<p\).


    Figure \(\PageIndex{9}\): Plotting functions of the form \(1/x\,^p\) in Example \(\PageIndex{4}\)

    Our analysis shows that if \(p>1\), then \(\int_1^\infty \frac1{x\hskip1pt ^p}\ dx \) converges. When \(p<1\) the improper integral diverges; we showed in Example \(\PageIndex{1}\) that when \(p=1\) the integral also diverges.

    Figure \(\PageIndex{9}\) graphs \(y=1/x\) with a dashed line, along with graphs of \(y=1/x^p\), \(p<1\), and \(y=1/x^q\), \(q>1\). Somehow the dashed line forms a dividing line between convergence and divergence.

    The result of Example \(\PageIndex{4}\) provides an important tool in determining the convergence of other integrals. A similar result is proved in the exercises about improper integrals of the form \(\int_0^1\frac1{x\hskip1pt ^p}\ dx\). These results are summarized in the following Key Idea.

    Key Idea 21: Convergence of Improper Integrals \(\int_1^\infty\frac1{x\hskip1pt ^p}\ dx\) and \(\int_0^1\frac1{x\hskip1pt ^p}\ dx\).

    1. The improper integral \(\int_1^\infty\frac1{x\hskip1pt ^p}\ dx\) converges when \(p>1\) and diverges when \(p\leq 1.\)
    2. The improper integral \(\int_0^1\frac1{x\hskip1pt ^p}\ dx\) converges when \(p<1\) and diverges when \(p\geq 1.\)

    A basic technique in determining convergence of improper integrals is to compare an integrand whose convergence is unknown to an integrand whose convergence is known. We often use integrands of the form \(1/x\hskip1pt ^p\) to compare to as their convergence on certain intervals is known. This is described in the following theorem.

    Theorem \(\PageIndex{1}\): Direct Comparison Test for Improper Integrals

    Let \(f\) and \(g\) be continuous on \([a,\infty)\) where \(0\leq f(x)\leq g(x)\) for all \(x\) in \([a,\infty)\).

    1. If \( \int_a^\infty g(x)\ dx\) converges, then \(\int_a^\infty f(x)\ dx\) converges.
    2. If \( \int_a^\infty f(x)\ dx\) diverges, then \( \int_a^\infty g(x)\ dx\) diverges.

    Note: We used the upper and lower bound of "1" in Key Idea 21 for convenience. It can be replaced by any \(a\) where \(a>0\).

    Example \(\PageIndex{5}\): Determining convergence of improper integrals

    Determine the convergence of the following improper integrals.

    1. \( \int_1^\infty e^{-x^2}\ dx\)
    2. \( \int_3^\infty \frac{1}{\sqrt{x^2-x}}\ dx\)


    1. The function \(f(x) = e^{-x^2}\) does not have an antiderivative expressible in terms of elementary functions, so we cannot integrate directly. It is comparable to \(g(x)=1/x^2\), and as demonstrated in Figure \(\PageIndex{10}\), \(e^{-x^2} < 1/x^2\) on \([1,\infty)\). We know from Key Idea 21 that \(\int_1^\infty \frac{1}{x^2}\ dx\) converges, hence \(\int_1^\infty e^{-x^2}\ dx\) also converges.


    Figure \(\PageIndex{10}\): Graphs of \(f(x) = e^{-x^2}\) and \(f(x)= 1/x^2\) in Example \(\PageIndex{6}\)

    1. Note that for large values of \(x\), \( \frac{1}{\sqrt{x^2-x}} \approx \frac{1}{\sqrt{x^2}} =\frac{1}{x}\). We know from Key Idea 21 and the subsequent note that \(\int_3^\infty \frac1x\ dx\) diverges, so we seek to compare the original integrand to \(1/x\).
      It is easy to see that when \(x>0\), we have \(x = \sqrt{x^2} > \sqrt{x^2-x}\). Taking reciprocals reverses the inequality, giving $$\frac1x < \frac1{\sqrt{x^2-x}}.$$
      Using Theorem \(\PageIndex{1}\), we conclude that since \(\int_3^\infty\frac1x\ dx\) diverges, \(\int_3^\infty\frac1{\sqrt{x^2-x}}\ dx\) diverges as well. Figure \(\PageIndex{11}\) illustrates this.


    Figure \(\PageIndex{11}\): Graphs of \(f(x) = 1/\sqrt{x^2-x}\) and \(f(x)= 1/x\) in Example \(\PageIndex{5}\)

    Being able to compare "unknown" integrals to "known" integrals is very useful in determining convergence. However, some of our examples were a little "too nice." For instance, it was convenient that \(\frac{1}x < \frac{1}{\sqrt{x^2-x}}\), but what if the "\(-x\)" were replaced with a "\(+2x+5\)"? That is, what can we say about the convergence of \(\int_3^\infty\frac{1}{\sqrt{x^2+2x+5}}\ dx\)? We have \(\frac{1}{x} > \frac1{\sqrt{x^2+2x+5}}\), so we cannot use Theorem \(\PageIndex{1}\).

    In cases like this (and many more) it is useful to employ the following theorem.

    Theorem: Limit Comparison Test for Improper Integrals

    Let \(f\) and \(g\) be continuous functions on \([a,\infty)\) where \(f(x)>0\) and \(g(x)>0\) for all \(x\). If

    $$\lim_{x\to\infty} \frac{f(x)}{g(x)} = L,\qquad 0<L<\infty,$$


    $$\int_a^\infty f(x)\ dx \quad \text{and} \quad \int_a^\infty g(x)\ dx$$

    either both converge or both diverge.

    Example \(\PageIndex{6}\): Determining convergence of improper integrals

    Determine the convergence of \(\int_3^{\infty} \frac{1}{\sqrt{x^2+2x+5}}\ dx\).


    As \(x\) gets large, the quadratic inside the square root function will begin to behave much like \(y=x\). So we compare \(\frac{1}{\sqrt{x^2+2x+5}}\)\ to \(\frac1x\) with the Limit Comparison Test:

    $$\lim_{x\to\infty} \frac{1/\sqrt{x^2+2x+5}}{1/x} = \lim_{x\to\infty}\frac{x}{\sqrt{x^2+2x+5}}.$$

    The immediate evaluation of this limit returns \(\infty/\infty\), an indeterminate form. Using L'Hôpital's Rule seems appropriate, but in this situation, it does not lead to useful results. (We encourage the reader to employ L'Hôpital's Rule at least once to verify this.)

    The trouble is the square root function. To get rid of it, we employ the following fact: If \(\lim_{x\to c} f(x) = L\), then \(\lim_{x\to c} f(x)^2 = L^2\). (This is true when either \(c\) or \(L\) is \(\infty\).) So we consider now the limit\)

    $$\lim_{x\to\infty} \frac{x^2}{x^2+2x+5}.$$

    This converges to 1, meaning the original limit also converged to 1. As \(x\) gets very large, the function \(\frac{1}{\sqrt{x^2+2x+5}}\) looks very much like \(\frac1x.\) Since we know that \(\int_3^{\infty} \frac1x\ dx\) diverges, by the Limit Comparison Test we know that \(\int_3^\infty\frac{1}{\sqrt{x^2+2x+5}}\ dx\) also diverges. Figure \(\PageIndex{12}\) graphs \(f(x)=1/\sqrt{x^2+2x+5}\) and \(f(x)=1/x\), illustrating that as \(x\) gets large, the functions become indistinguishable.


    Figure \(\PageIndex{12}\): Graphing \(f(x)=\frac{1}{\sqrt{x^2+2x+5}}\) and \(f(x)=\frac1x\) in Example \(\PageIndex{6}\).

    Both the Direct and Limit Comparison Tests were given in terms of integrals over an infinite interval. There are versions that apply to improper integrals with an infinite range, but as they are a bit wordy and a little more difficult to employ, they are omitted from this text.

    This chapter has explored many integration techniques. We learned Substitution, which "undoes" the Chain Rule of differentiation, as well as Integration by Parts, which "undoes" the Product Rule. We learned specialized techniques for handling trigonometric functions and introduced the hyperbolic functions, which are closely related to the trigonometric functions. All techniques effectively have this goal in common: rewrite the integrand in a new way so that the integration step is easier to see and implement.

    As stated before, integration is, in general, hard. It is easy to write a function whose antiderivative is impossible to write in terms of elementary functions, and even when a function does have an antiderivative expressible by elementary functions, it may be really hard to discover what it is. The powerful computer algebra system Mathematica has approximately 1,000 pages of code dedicated to integration.

    Do not let this difficulty discourage you. There is great value in learning integration techniques, as they allow one to manipulate an integral in ways that can illuminate a concept for greater understanding. There is also great value in understanding the need for good numerical techniques: the Trapezoidal and Simpson's Rules are just the beginning of powerful techniques for approximating the value of integration.

    The next chapter stresses the uses of integration. We generally do not find antiderivatives for antiderivative's sake, but rather because they provide the solution to some type of problem. The following chapter introduces us to a number of different problems whose solution is provided by integration.


    • Gregory Hartman (Virginia Military Institute). Contributions were made by Troy Siemers and Dimplekumar Chalishajar of VMI and Brian Heinold of Mount Saint Mary's University. This content is copyrighted by a Creative Commons Attribution - Noncommercial (BY-NC) License.

    • Integrated by Justin Marshall.