$$\def\ans#1{\bbox[border:1px solid green,6pt]{#1}}$$

# Improper Integrals

So far, to evaluate $$\displaystyle\int_a^b f(x) \ dx$$, we've made two assumptions (though you may not have seen these stated):

1. The interval $$[a,b]$$ is finite.
2. The function $$f(x)$$ is continuous on the interval $$[a,b]$$.

The question now is: what if one (or both) of these assumptions does not hold? If that is the case, we'll end up having to use a limit to evaluate the integral. For some of these limits, we'll need to use L'Hopital's Rule, so we'll start with a quick review of that. Then we'll break each of the two assumptions here in turn and see how to deal with the integral in that case.

## Review L'Hopital's Rule

L'Hopital's Rule deals with limits of indeterminate form. Specifically, $\text{if } \lim_{x \to c} \dfrac{f(x)}{g(x)} = \dfrac{0}{0} \text{ or } \lim_{x \to c} \dfrac{f(x)}{g(x)} = \dfrac{\infty}{\infty} \text{, then } \lim_{x \to c} \dfrac{f(x)}{g(x)} = \lim_{x \to c} \dfrac{f'(x)}{g'(x)}$

Evaluate $$\displaystyle\lim_{x \to 3} \dfrac{x^2+2x-15}{x-3}$$.

#### Solution

Note that $\lim_{x \to 3} \dfrac{x^2+2x-15}{x-3} = \dfrac{0}{0},$ so by L'Hopital's Rule, $\lim_{x \to 3} \dfrac{x^2+2x-15}{x-3} = \ans{\lim_{x \to 3} \dfrac{2x+2}{1} = 8}$

#### Try it yourself:

(click on the problem to show/hide the answer)

$$\displaystyle\lim_{x \to \infty} \dfrac{x+1}{x^2}$$
$$0$$

Evaluate $$\displaystyle\lim_{x \to 0} \dfrac{\sin x}{x}$$.

#### Solution

Since $\lim_{x \to 0} \dfrac{\sin x}{x} = \dfrac{0}{0},$ $\lim_{x \to 0} \dfrac{\sin x}{x} = \ans{\lim_{x \to 0} \dfrac{\cos x}{1} = 1}$

## Infinite Limits of Integration

Consider, for example, the following integral: $\int_1^\infty \dfrac{1}{x^2} \ dx.$ The indefinite integral poses no problem, but trying to evaluate the antiderivative at the upper limit of $$\infty$$ is the problematic part. Take a look at the graph below to see how we'll handle this. Try dragging the slider for $$b$$ up and down; note that $$A$$ is the area under the curve from 1 to $$b$$.

Since we can't evaluate an integral that goes all the way up to $$\infty$$, we make the upper limit variable, like in the graph above, and then let that variable tend toward infinity: $\int_1^\infty \dfrac{1}{x^2} \ dx = \lim_{t \to \infty} \int_1^t \dfrac{1}{x^2} \ dx.$

At this point, we can evaluate the integral: \begin{align} \lim_{t \to \infty} \int_1^t \dfrac{1}{x^2} \ dx &= \lim_{t \to \infty} \left[-\dfrac{1}{x}\right]_1^t\\ \\ &= \lim_{t \to \infty} \left[-\dfrac{1}{t} + \dfrac{1}{1}\right]\\ \\ &= 1 \end{align}

This illustrates the way that we handle integrals with an infinite limit of integration: \begin{align} \int_a^\infty f(x) \ dx &= \lim_{t \to \infty} \int_a^t f(x) \ dx\\ \\ \int_{-\infty}^b f(x) \ dx &= \lim_{t \to -\infty} \int_t^b f(x) \ dx \end{align}

Okay, but what if both limits are infinite? The trick in that case is to split the integral at any point between $$-\infty$$ and $$\infty$$: \begin{align} \int_{-\infty}^\infty f(x) \ dx &= \int_{-\infty}^c f(x) \ dx + \int_c^\infty f(x) \ dx\\ &= \lim_{t \to -\infty} \int_t^c f(x) \ dx + \lim_{t \to \infty} \int_c^t f(x) \ dx \end{align}

Evaluate $$\displaystyle\int_1^\infty \dfrac{1}{x} \ dx$$.

#### Solution

\begin{align} \int_1^\infty \dfrac{1}{x} \ dx &= \lim_{t \to \infty} \int_1^t \dfrac{1}{x} \ dx = \lim_{t \to \infty} \bigg[\ln x\bigg]_1^t\\ &= \lim_{t \to \infty} \left[\ln t - \ln 1\right]\\ &= \infty \end{align} This integral is $$\bbox[border:2px solid #0D47A1, 4pt]{\text{divergent}}$$ because the limit is infinite.

#### Try it yourself:

(click on the problem to show/hide the answer)

$$\displaystyle\int_{-\infty}^{-1} xe^{-x^2} \ dx$$
$$-\dfrac{1}{2e}$$

Evaluate $$\displaystyle\int_1^\infty \dfrac{1}{(3x+1)^2} \ dx$$.

#### Solution

\begin{align} \int_1^\infty \dfrac{1}{(3x+1)^2} \ dx &= \lim_{t \to \infty} \int_1^t \dfrac{1}{(3x+1)^2} \ dx\\ &= \lim_{t \to \infty} \left[-\dfrac{1}{3} \cdot \dfrac{1}{3x+1}\right]_1^t\\ &= \lim_{t \to \infty} \left[-\dfrac{1}{3} \cdot \dfrac{1}{3t+1} + \dfrac{1}{3} \cdot \dfrac{1}{3(1)+1}\right]\\ &= 0 + \dfrac{1}{3} \cdot \dfrac{1}{4}\\ &= \ans{\dfrac{1}{12}} \end{align}

This integral is convergent (it converges to 1/12).

#### Note:

The integral $$\displaystyle\int_1^\infty \dfrac{1}{x^p} \ dx$$ is convergent when $$p>1$$ and divergent when $$p\leq 1$$.

## Integrating Over Discontinuities

### a. Discontinuity at an Endpoint

Just like with infinite limits of integration, if the function is discontinuous at an endpoint, we can't evaluate the antiderivative there, but we can approach that endpoint. The key is that we'll use a one-sided limit, from the appropriate side. So if the discontinuity is as the upper (right) endpoint, we'll use a left-sided limit, approaching the endpoint from the left (inside the interval), and vice versa.

\begin{align} &\text{If } f(x) \text{ has a discontinuity at } x=b, \int_a^b f(x) \ dx = \lim_{t \to b^-} \int_a^t f(x) \ dx\\ \\ &\text{If } f(x) \text{ has a discontinuity at } x=a, \int_a^b f(x) \ dx = \lim_{t \to a^+} \int_t^b f(x) \ dx \end{align}

Evaluate $$\displaystyle\int_2^5 \dfrac{1}{\sqrt{x-2}} \ dx.$$

#### Solution

Notice that this function has a discontinuity at $$x=2$$, the lower endpoint. Therefore, \begin{align} \int_2^5 \dfrac{1}{\sqrt{x-2}} \ dx &= \lim_{t \to 2^+} \int_t^5 \dfrac{1}{\sqrt{x-2}} \ dx\\ \\ &= \lim_{t \to 2^+} \bigg[2\sqrt{x-2}\bigg]_t^5\\ \\ &= \lim_{t \to 2^+} 2\sqrt{3} - 2\sqrt{t-2}\\ \\ &= \ans{2\sqrt{3}} \end{align}

### b. Discontinuity in the Interior (at $$x=c$$, where $$a < c < b$$)

If the discontinuity occurs in the interior of the interval, we split the integral at the discontinuity and handle each piece according to what we just did.

\begin{align} \int_a^b f(x) \ dx &= \int_a^c f(x) \ dx + \int_c^b f(x) \ dx\\ \\ &= \lim_{t \to c^-} \int_a^t f(x) \ dx + \lim_{t \to c^+} \int_t^b f(x) \ dx \end{align}

Evaluate $$\displaystyle\int_1^5 \dfrac{x}{x-4} \ dx.$$

#### Solution

Before we do anything else, we'll evaluate the indefinite integral. I'll skip the details (but you should take the time to fill them in), but using u-substitution, we can show that $\int \dfrac{x}{x-4} \ dx = x-4 + 4\ln|x-4| + C$ (although, of course, we won't need the $$+C$$ since we'll be doing a definite integral, and technically, we don't need the $$-4$$ either for the same reason).

This function has a discontinuity at $$x=4$$, which is between the limits of integration. Therefore, split the integral at 4 and set up the two limits:

\begin{align} \int_1^5 \dfrac{x}{x-4} \ dx &= \int_1^4 \dfrac{x}{x-4} \ dx + \int_4^5 \dfrac{x}{x-4} \ dx\\ \\ &= \lim_{t \to 4^-} \int_1^t \dfrac{x}{x-4} \ dx + \lim_{t \to 4^+} \int_t^5 \dfrac{x}{x-4} \ dx\\ \\ &= \lim_{t \to 4^-} \bigg[x-4 + 4\ln|x-4|\bigg]_1^t + \lim_{t \to 4^+} \bigg[x-4 + 4\ln|x-4|\bigg]_t^5\\ \\ &= \lim_{t \to 4^-} \bigg[\left(t-4 + 4\ln|t-4|\right) - \left(1-4 + 4\ln|1-4|\right)\bigg]_1^t\\ &+ \lim_{t \to 4^+} \bigg[\left(5-4 + 4\ln|5-4|\right) - \left(t-4 + 4\ln|t-4|\right)\bigg]_t^5\\ \\ &= \left(\lim_{t \to 4} 4\ln(t-4) + 3 - 4\ln 3\right) + \left(1-\lim_{t \to 4} 4\ln(t-4)\right)\\ \\ &= \ans{4-4\ln 3} \end{align}

#### Try it yourself:

(click on a problem to show/hide its answer)