---
title: The Logarithm, Exponential, and Improper Integrals
module: The Riemann Integral
moduleNumber: 6
lessonNumber: 5
order: 605
summary: >
  The integral defines transcendental functions. The logarithm is the area under
  1/t, the exponential is its inverse, and their calculus properties follow from
  the fundamental theorem. Improper integrals extend integration to unbounded
  intervals and unbounded integrands as limits of proper integrals, with a
  p-test, a comparison test, absolute versus conditional convergence, and the
  integral test linking integrals to series.
topics: [The Riemann Integral]
draft: false
sources:
  - book: Lebl
    ref: "§5.4 The logarithm and the exponential; §5.5 Improper integrals (p-test, comparison, integral test)"
  - book: Shkoller
    ref: "§1.12 Improper integrals (absolute vs. conditional convergence)"
---

The [fundamental theorem](/real-analysis/riemann-integration/fundamental-theorem)
guarantees that every continuous function has an antiderivative, even when no
elementary formula exists. This makes the integral a tool for _defining_
functions. The logarithm and exponential, taken for granted in calculus, are built
here from the integral of $1/t$. Improper integrals then push integration past its
original setting — bounded functions on bounded intervals — to unbounded domains
and unbounded integrands.

## The logarithm as an integral

Define a function by the area under the hyperbola $1/t$, starting at $t = 1$.

> **Definition (Natural logarithm).** For $x > 0$,
> $$
> \ln x \coloneqq \int_1^x \frac{1}{t}\, \d t.
> $$
> The area is signed: for $x < 1$ the integral runs backward and $\ln x < 0$.

$$
% caption: The logarithm as signed area under $1/t$. For $x > 1$, $\ln x$ is the
% caption: area from $1$ to $x$; for $x < 1$ the orientation reverses and the value
% caption: is negative. The curve is $y = 1/t$.
\begin{tikzpicture}[scale=1.0, >=stealth, font=\small]
\definecolor{acc}{HTML}{4A6FA5}
% region 1..4 under 1/t
\fill[acc!16] (1,0) -- (1,1.8) .. controls (1.8,1.0) and (2.6,0.72) .. (4,0.45) -- (4,0) -- cycle;
\draw[acc, very thick] (0.55,3.27) .. controls (0.9,2.0) and (1.8,1.0) .. (4.6,0.39);
\draw[->] (-0.15,0) -- (5.1,0) node[right, font=\footnotesize] {$t$};
\draw[->] (0,-0.15) -- (0,3.5);
\foreach \x/\lab in {1/1, 4/x}
  \draw (\x,0.07) -- (\x,-0.07) node[below, font=\footnotesize] {$\lab$};
\node[acc, font=\footnotesize] at (2.3,0.6) {$\ln x$};
\node[acc, font=\footnotesize, anchor=west] at (2.8,1.7) {$y = \tfrac{1}{t}$};
\end{tikzpicture}
$$

Its defining properties come straight from the integral.[^lebl-log]

- **Base point and derivative.** $\ln 1 = 0$, and by the differentiation form
  $\ln$ is differentiable with $\dfrac{\d}{\d x}\ln x = \dfrac{1}{x}$.
- **Monotone bijection.** Since $\ln' x = 1/x > 0$, $\ln$ is strictly increasing,
  hence injective, and $\ln : (0, \infty) \to \mathbb{R}$ is onto with
  $\lim_{x \to 0^+}\ln x = -\infty$ and $\lim_{x \to \infty}\ln x = +\infty$.
- **Functional equation.** $\ln(xy) = \ln x + \ln y$, proved by the substitution
  $u = yt$ in the defining integral.
- **Powers.** $\ln(x^q) = q\ln x$ for rational $q$.

> **Worked example (The functional equation from the integral).** Fix $y > 0$.
> Substituting $u = yt$ (so $\d u = y\,\d t$ and $\tfrac{1}{t}\,\d t =
> \tfrac{1}{u}\,\d u$) in the defining integral sends $t \in [1, x]$ to
> $u \in [y, xy]$:
> $$
> \ln x = \int_1^x \frac{1}{t}\, \d t
> = \int_y^{xy} \frac{1}{u}\, \d u
> = \int_1^{xy} \frac{1}{u}\, \d u - \int_1^{y} \frac{1}{u}\, \d u
> = \ln(xy) - \ln y,
> $$
> which rearranges to $\ln(xy) = \ln x + \ln y$.[^lebl-log] The power rule is the
> same computation with $t = s^q$: then $\d t = q\,s^{q-1}\,\d s$ and
> $\tfrac{1}{t} = s^{-q}$, so
> $$
> \ln(x^q) = \int_1^{x^q} \frac{1}{t}\, \d t
> = \int_1^{x} s^{-q}\, q\, s^{q-1}\, \d s
> = q \int_1^x \frac{1}{s}\, \d s = q \ln x.
> $$

Surjectivity uses that $\ln 2 = \int_1^2 \tfrac{1}{t}\,\d t \ge \tfrac12$, so
$\ln(2^n) = n\ln 2 \to \infty$; the
[Archimedean property](/real-analysis/foundations/ordered-fields-completeness) and
the [intermediate value theorem](/real-analysis/continuity/evt-ivt) then hit every
real value.[^lebl-log] Uniqueness is a corollary of the evaluation form: any
function with $L(1) = 0$ and $L' = 1/x$ must equal $\int_1^x \tfrac{1}{t}\,\d t$.

## The exponential as the inverse

Because $\ln$ is a strictly monotone differentiable bijection, it has a
differentiable [inverse](/real-analysis/differentiation/inverse-function-1d).

> **Definition (Exponential).** Let $\exp : \mathbb{R} \to (0, \infty)$ be the
> inverse of $\ln$. Set $e \coloneqq \exp(1)$, so that $\ln e = 1$.

The inverse-function rule turns $\ln' x = 1/x$ into the defining differential
equation of the exponential.[^lebl-log]

> **Proposition (Properties of $\exp$).**
> $$
> \exp(0) = 1,
> \quad
> \exp'(x) = \exp(x),
> \quad
> \exp(x + y) = \exp(x)\exp(y),
> $$
> and $\exp$ is a strictly increasing bijection with
> $\lim_{x\to -\infty}\exp(x) = 0$ and $\lim_{x\to\infty}\exp(x) = \infty$.

The two functions are mirror images across the diagonal, with reciprocal slopes at
corresponding points — a slope $1/x$ for $\ln$ at $x$ becomes a slope $x$ for
$\exp$ at $\ln x$.

$$
% caption: The exponential is the logarithm mirrored across the line $y = x$. A
% caption: point where $\ln$ has slope $1/x$ maps to a point where $\exp$ has the
% caption: reciprocal slope, so the two graphs cross the diagonal at right angles
% caption: to each other's tangents.
\begin{tikzpicture}[scale=1.0, >=stealth, font=\small]
\definecolor{acc}{HTML}{4A6FA5}
\definecolor{sec}{HTML}{7A6A9A}
\draw[black, dashed] (-1.6,-1.6) -- (3.0,3.0);
\node[black, font=\footnotesize] at (2.7,2.45) {$y = x$};
% log curve: passes (1,0),(e,1); domain positive
\draw[acc, very thick] (0.2,-1.6) .. controls (0.6,-0.4) and (1.4,0.4) .. (3.0,1.1);
\node[acc, font=\footnotesize, anchor=west] at (2.6,0.75) {log};
% exp curve: reflection
\draw[sec, very thick] (-1.6,0.2) .. controls (-0.4,0.6) and (0.4,1.4) .. (1.1,3.0);
\node[sec, font=\footnotesize, anchor=south] at (1.3,2.6) {exp};
\draw[->] (-1.8,0) -- (3.2,0);
\draw[->] (0,-1.8) -- (0,3.2);
\fill[black] (1,0) circle (1.2pt);
\fill[black] (0,1) circle (1.2pt);
\node[font=\footnotesize, anchor=north] at (1,-0.05) {$1$};
\node[font=\footnotesize, anchor=east] at (-0.05,1) {$1$};
\end{tikzpicture}
$$

With $\exp$ in hand, irrational powers can be defined: for $x > 0$ set
$x^y \coloneqq \exp(y\ln x)$, extending the rational-exponent rules by continuity,
and $e^x = \exp(x)$ since $\ln e = 1$.[^lebl-log] The general power and exponential
laws follow by differentiating the composition:
$$
\frac{\d}{\d x}\, x^y = y\,x^{y-1} \quad (x > 0),
\qquad
\frac{\d}{\d x}\, b^x = b^x \ln b \quad (b > 0),
$$
the first fixing $y$ and varying $x$, the second fixing the base $b$. The classical
limit definition of the exponential is recovered from the logarithm: since
$\ln$ has derivative $1$ at $x = 1$,
$$
\lim_{n \to \infty}\left(1 + \frac{x}{n}\right)^n = e^x,
$$
the continuous-compounding limit, obtained by taking logarithms and using
$n\ln(1 + \tfrac{x}{n}) \to x$.[^lebl-log]

## Improper integrals

The Riemann integral is defined only for bounded functions on bounded intervals.
Two extensions, each a limit of proper integrals, cover unbounded domains and
unbounded integrands.

> **Definition (Improper integral).** If $f$ is integrable on $[a, c]$ for every
> $c$, define
> $$
> \int_a^\infty f \coloneqq \lim_{c \to \infty} \int_a^c f,
> \qquad
> \int_a^b f \coloneqq \lim_{c \to b^-} \int_a^c f
> $$
> (the second for $f$ unbounded near $b$), and say the integral **converges** if
> the limit exists and **diverges** otherwise.

$$
% caption: An improper integral over $[a, \infty)$ is the limit of proper integrals
% caption: out to a moving bound $c$. When the tail area past $c$ shrinks to zero,
% caption: the total area converges to a finite value.
\begin{tikzpicture}[scale=1.0, >=stealth, font=\small]
\definecolor{acc}{HTML}{4A6FA5}
\fill[acc!16] (0.6,0) -- (0.6,2.2) .. controls (1.6,0.9) and (2.8,0.5) .. (3.4,0.42) -- (3.4,0) -- cycle;
\draw[acc, very thick] (0.6,2.2) .. controls (1.6,0.9) and (3.2,0.42) .. (5.0,0.28);
\draw[->] (-0.15,0) -- (5.3,0) node[right, font=\footnotesize] {$x$};
\draw[->] (0,-0.15) -- (0,2.7);
\foreach \x/\lab in {0.6/a, 3.4/c}
  \draw (\x,0.07) -- (\x,-0.07) node[below, font=\footnotesize] {$\lab$};
\draw[->, black] (3.6,0.9) -- (4.7,0.9);
\node[black, font=\footnotesize, anchor=south] at (4.15,0.9) {grows};
\node[acc, font=\footnotesize] at (1.7,0.6) {area to $c$};
\end{tikzpicture}
$$

The prototype family sets the convergence threshold. The exponent $p$ determines
whether the tail area is finite.[^lebl-imp]

> **Proposition ($p$-test).**
> $$
> \int_1^\infty \frac{\d x}{x^p}
> \;\text{converges} \iff p > 1,
> \qquad
> \int_0^1 \frac{\d x}{x^p}
> \;\text{converges} \iff p < 1.
> $$

> **Proof.** Both follow from the evaluation form:
> $\int_1^b x^{-p}\,\d x = \tfrac{1 - b^{1-p}}{p-1}$ for $p \ne 1$, which converges
> to $\tfrac{1}{p-1}$ as $b \to \infty$ exactly when $1 - p < 0$; the boundary
> $p = 1$ gives $\ln b \to \infty$. Near $0$ the same antiderivative gives
> $\int_\epsilon^1 x^{-p}\,\d x = \tfrac{1 - \epsilon^{1-p}}{1-p}$, finite in the
> limit exactly when $1 - p > 0$.

At infinity the integrand must decay faster than $1/x$; near $0$ the singularity
must be milder than $1/x$.

| Integral | Converges when | Diverges when | Value on convergence |
| --- | --- | --- | --- |
| $\int_1^\infty x^{-p}\,\d x$ | $p > 1$ | $0 < p \le 1$ | $\frac{1}{p-1}$ |
| $\int_0^1 x^{-p}\,\d x$ | $0 < p < 1$ | $p \ge 1$ | $\frac{1}{1-p}$ |

> **Worked example (One of each kind).** Over an unbounded interval,
> $$
> \int_0^\infty e^{-x}\,\d x = \lim_{c \to \infty}\big[1 - e^{-c}\big] = 1,
> $$
> the exponential decaying fast enough to enclose a unit area. For an unbounded
> integrand near an endpoint,
> $$
> \int_0^1 \ln x\, \d x = \lim_{\epsilon \to 0^+}\big[x\ln x - x\big]_\epsilon^1 = -1,
> $$
> finite because $\epsilon\ln\epsilon \to 0$; the singularity of $\ln$ at $0$ is
> mild enough to integrate.

## The comparison test

Convergence of a hard integral often follows from a simpler dominating one, just
as for [series](/real-analysis/sequences-series/series-convergence).

> **Proposition (Comparison test).** Suppose $|f(x)| \le g(x)$ for all
> $x \ge a$, with both integrable on every $[a, b]$. If $\int_a^\infty g$
> converges, so does $\int_a^\infty f$, and $\int_a^\infty f \le \int_a^\infty g$.
> If $\int_a^\infty f$ diverges, so does $\int_a^\infty g$.

> **Proof.** For nonnegative $f$, the partial areas $\int_a^x f$ increase, so
> convergence is just boundedness above — supplied by $g$.[^lebl-imp]

> **Worked example (An oscillating integrand dominated).** The integral
> $$
> \int_1^\infty \frac{\sin(x^2)(x+2)}{x^3 + 1}\, \d x
> \quad\text{converges},
> \qquad\text{since}\qquad
> \left|\frac{\sin(x^2)(x+2)}{x^3+1}\right| \le \frac{x + 2x}{x^3} = \frac{3}{x^2}
> $$
> for $x \ge 1$ (using $|\sin| \le 1$, $2 \le 2x$, and $x^3 + 1 \ge x^3$), and
> $\int_1^\infty 3x^{-2}\,\d x = 3$ converges by the $p$-test.[^lebl-imp]

> **Worked example (The Gaussian tail).** The integral
> $\int_0^\infty e^{-x^2}\,\d x$ converges, although $e^{-x^2}$ has no elementary
> antiderivative. Split at $1$: the piece $\int_0^1 e^{-x^2}\,\d x$ is a proper
> integral of a continuous function. On the tail, $x \ge 1$ gives $x^2 \ge x$, so
> $$
> 0 \;\le\; e^{-x^2} \;\le\; e^{-x}
> \qquad\text{and}\qquad
> \int_1^\infty e^{-x}\,\d x = e^{-1},
> $$
> so the tail converges by comparison, bounded by $e^{-1}$.[^lebl-imp]

$$
% caption: Tail comparison for the Gaussian. Beyond $x = 1$ the curve
% caption: $f(x) = e^{-x^2}$ drops below $g(x) = e^{-x}$, whose tail area is
% caption: $e^{-1}$; the shaded Gaussian tail is squeezed underneath it, so
% caption: $\int_0^\infty e^{-x^2}\,\d x$ converges by comparison.
\begin{tikzpicture}[scale=1.0, >=stealth, font=\small]
\definecolor{acc}{HTML}{4A6FA5}
\definecolor{sec}{HTML}{7A6A9A}
% shaded gaussian tail beyond x=1.4
\fill[acc!16] (1.4,0) -- (1.4,0.92) .. controls (2.0,0.28) and (2.6,0.07) .. (3.2,0.02)
  -- (4.2,0.01) -- (4.2,0) -- cycle;
% gaussian curve f
\draw[acc, very thick] (0,2.5) .. controls (0.5,2.35) and (0.9,1.7) .. (1.4,0.92)
  .. controls (2.0,0.28) and (2.6,0.07) .. (3.2,0.02) -- (4.2,0.01);
% exponential curve g
\draw[sec, very thick] (0,2.5) .. controls (0.6,1.55) and (1.0,1.2) .. (1.4,0.92)
  .. controls (2.2,0.5) and (3.2,0.24) .. (4.2,0.12);
\fill[black] (1.4,0.92) circle (1.3pt);
\draw[black, dashed] (1.4,0) -- (1.4,0.92);
\draw[->] (-0.15,0) -- (4.7,0) node[right, font=\footnotesize] {$x$};
\draw[->] (0,-0.15) -- (0,2.8);
\draw (1.4,0.06) -- (1.4,-0.06) node[below, font=\footnotesize] {$1$};
\node[acc, font=\footnotesize, anchor=west] at (0.95,1.75) {$f$};
\node[sec, font=\footnotesize, anchor=west] at (3.4,0.42) {$g$};
\node[acc, font=\footnotesize, anchor=south] at (2.5,0.12) {tail};
\end{tikzpicture}
$$

Splitting an improper integral before establishing convergence
is invalid: $\int_2^\infty \tfrac{2}{x^2 - 1}\,\d x$ converges, but rewriting it as
$\int \tfrac{1}{x-1} - \int \tfrac{1}{x+1}$ produces $\infty - \infty$, since each
piece diverges.[^lebl-imp]

## Absolute versus conditional convergence

An improper integral can converge through cancellation without converging
absolutely — the continuous analogue of a
[conditionally convergent series](/real-analysis/sequences-series/absolute-conditional-rearrangement).

> **Definition (Absolute convergence).** $\int_a^\infty f$ **converges
> absolutely** if $\int_a^\infty |f|$ converges. Absolute convergence implies
> convergence; the reverse can fail.

> **Worked example ($\int \operatorname{sinc}$ — conditional convergence).** The
> integral $\int_1^\infty \tfrac{\sin x}{x}\, \d x$ converges, but
> $\int_1^\infty \big|\tfrac{\sin x}{x}\big|\, \d x = \infty$. Convergence follows
> from integration by parts:
> $$
> \int_1^L \frac{\sin x}{x}\,\d x
> = \frac{\cos 1}{1} - \frac{\cos L}{L} - \int_1^L \frac{\cos x}{x^2}\,\d x,
> $$
> and the last integral converges absolutely by comparison with
> $x^{-2}$.[^shk-imp] Divergence of the absolute integral comes from
> $\int_{(i-1)\pi}^{i\pi}|\sin x|\,\d x = 2$ and the bound
> $\big|\tfrac{\sin x}{x}\big| \ge \tfrac{|\sin x|}{i\pi}$ on the $i$-th arch,
> which sums to a multiple of the harmonic series
> $\sum 1/i = \infty$.[^shk-imp]

The alternating signs of $\sin x$ provide the same cancellation as in the
alternating harmonic series.

## The integral test for series

A decreasing nonnegative function ties the convergence of a series to the
convergence of an integral, because its terms and its area sandwich each other.

> **Proposition (Integral test).** Let $f : [k, \infty) \to \mathbb{R}$ be
> nonnegative and decreasing. Then
> $$
> \sum_{n=k}^\infty f(n) \;\text{converges} \iff \int_k^\infty f \;\text{converges},
> $$
> and in the convergent case
> $$
> \int_k^\infty f \;\le\; \sum_{n=k}^\infty f(n) \;\le\; f(k) + \int_k^\infty f.
> $$

$$
% caption: The integral test. The area under a decreasing $f$ is bounded below by
% caption: the right-endpoint bars $f(2) + f(3) + \cdots$ and above by the
% caption: left-endpoint bars $f(1) + f(2) + \cdots$, so the series and the
% caption: integral converge together.
\begin{tikzpicture}[scale=1.0, >=stealth, font=\small]
\definecolor{acc}{HTML}{4A6FA5}
% decreasing curve
\draw[acc, very thick] (1,2.3) .. controls (2.2,1.3) and (3.5,0.85) .. (5.2,0.6);
% right-endpoint (lower) bars, shaded
\foreach \a/\h in {1/1.55, 2/1.1, 3/0.82, 4/0.66}{
  \fill[acc!16] (\a,0) rectangle ({\a+1},\h);
  \draw[black] (\a,0) rectangle ({\a+1},\h);
}
\draw[->] (-0.15,0) -- (5.5,0) node[right, font=\footnotesize] {$x$};
\draw[->] (0,-0.15) -- (0,2.7);
\foreach \x in {1,2,3,4,5}
  \draw (\x,0.07) -- (\x,-0.07) node[below, font=\footnotesize] {$\x$};
\node[acc, font=\footnotesize, anchor=south west] at (1.05,1.55) {$f(2)$};
\end{tikzpicture}
$$

The estimate is quantitative, not just qualitative: it brackets a sum to within
$f(k)$.

> **Worked example (Estimating $\sum 1/n^2$).** Using
> $\int_k^\infty x^{-2}\,\d x = 1/k$, the integral-test bracket gives
> $$
> \frac{1}{k} + \sum_{n=1}^{k-1}\frac{1}{n^2}
> \;\le\; \sum_{n=1}^\infty \frac{1}{n^2}
> \;\le\; \frac{1}{k^2} + \frac{1}{k} + \sum_{n=1}^{k-1}\frac{1}{n^2},
> $$
> so the partial sum plus $1/k$ estimates the total to within $1/k^2$. At $k = 10$
> this pins the sum between $1.6397\ldots$ and $1.6497\ldots$, bracketing the true
> value $\pi^2/6 \approx 1.6449$.[^lebl-imp]

The same test recovers the $p$-series
result — $\sum n^{-p}$ converges exactly when $\int_1^\infty x^{-p}\,\d x$ does,
i.e. for $p > 1$.

| Object | Convergence tool | Threshold example |
| --- | --- | --- |
| $\int_1^\infty x^{-p}\,\d x$ | $p$-test | converges iff $p > 1$ |
| $\int_a^\infty f$, $\lvert f\rvert \le g$ | comparison test | dominated by convergent $g$ |
| $\int_1^\infty \frac{\sin x}{x}\,\d x$ | parts + comparison | conditional, not absolute |
| $\sum_{n} f(n)$, $f \downarrow$ | integral test | matches $\int f$ |

[^lebl-log]: **Lebl**, _Basic Analysis I_, §5.4 — the logarithm as $\int_1^x \tfrac{1}{t}\,\d t$ with its five characterizing properties (Prop. 5.4.1), the exponential as its inverse with $E' = E$ (Prop. 5.4.2), and the definition $x^y = \exp(y\ln x)$.
[^lebl-imp]: **Lebl**, _Basic Analysis I_, §5.5 — improper integrals (Def. 5.5.1), the $p$-test (Prop. 5.5.2), the comparison test (Prop. 5.5.5) with the $\tfrac{\sin(x^2)(x+2)}{x^3+1}$ and $\tfrac{2}{x^2-1}$ examples, and the integral test with the $\sum 1/n^2$ estimate (Prop. 5.5.13, Example 5.5.14).
[^shk-imp]: **Shkoller**, _MAT125B Lecture Notes_, §1.12 — improper integrals, absolute versus conditional convergence (Def. 1.45), and the proof that $\int_1^\infty \tfrac{\sin x}{x}\,\d x$ is conditionally but not absolutely convergent (Example 1.47).
