### Reader Survey: log|*x*| + *C*

#### Posted by Tom Leinster

The semester is nearly over here — just one more week of teaching to go! I’m profoundly exhausted, but as the end comes into sight, I feel my spirits lifting. As soon’s as it’s over, I’ll be heading to Ohio to spend a couple of weeks working with Mark Meckes. The trip is close enough now that I’m starting to get that excited anticipation; soon I’ll be back exploring the wide world of new ideas.

But not so fast: there’s one teaching-related matter to deal with first.

Have you ever taught calculus? If so, what did you tell your students was the answer to $\displaystyle\int \frac{1}{x} d x$?

Here we tell them that it’s $\log|x| + C$, where $C$ is the famous ‘constant of integration’. I’m pretty sure that’s what I was taught myself.

But it’s wrong. At least, it’s wrong if you interpret the question and the answer in what I think is the obvious way. It’s wrong for reasons that won’t surprise many readers, and although I’ll explain those reasons, I don’t think that’s such an interesting point in itself.

What I’m more interested in hearing about is the pedagogy. If you think it’s bad to teach students things that are flat-out incorrect, what do you do instead? I’m not talking about advanced students here: these are 17- and 18-year-olds, many of whom won’t take any further math courses. What do you tell them about $\displaystyle\int \frac{1}{x} d x$?

Here, we tell our students explicitly that to ‘solve’ an indefinite integral $\displaystyle\int f(x) d x$ is to find the general antiderivative of $f$, that is, to find the general solution $F$ to the differential equation $F' = f$. So, when one says that $\displaystyle\int \frac{1}{x} d x = \log|x| + C$, one is saying that the general solution $F$ to $F'(x) = 1/x$ is $F(x) = \log|x| + C$, where $C$ is a constant.

This is simply not the case. The general solution is

$F(x) = \begin{cases} \log|x| + C^- &\text{if } x \lt 0\\ \log|x| + C^+ &\text{if } x \gt 0 \end{cases}$

where $C^-$ and $C^+$ are constants. So, the space of solutions is two-dimensional, not one-dimensional.

It’s implicit here that $f$ and $F$ are supposed to be real-valued functions defined on $\mathbf{R}\setminus\{0\}$. Courses at this level don’t usually pay much attention to domains and codomains, but since the question itself involves a term $1/x$, it’s clear that the value $x = 0$ is forbidden.

If we ignore the concerns of teaching for a moment, probably the best way to
say it is that the general antiderivative of $1/x$ on
$U = \mathbf{R}\setminus\{0\}$ is $x \mapsto \log|x| + C$, where $C$ is not a
constant but a *locally constant function* on $U$.

More generally, if $U$ is an open subset of $\mathbf{R}$ then the functions $F\colon U \to \mathbf{R}$ satisfying $F' = 0$ are exactly the locally constant functions. The dimension of the space of solutions is, therefore, the number of connected-components of $U$. So, if $f\colon U \to \mathbf{R}$ is a function with at least one antiderivative, then the dimension of the space of antiderivatives is also the number of connected-components of $U$. In the case at hand, it’s two.

As I said, none of that is profound or difficult. All the same, it came as a bit of a shock to learn that the hallowed formula ‘$\log|x| + C$’ that I’ve carried around in my head for so long isn’t really the correct answer to anything — at least, not if $C$ is a constant.

So what do we do about it?

I’m all for giving informal explanations. I learned to differentiate before I knew the definition of differentiation, and I learned the definition of differentiation before I saw a rigorous treatment of the real numbers. That’s how teaching traditionally goes at this level. We don’t work our way through Bourbaki.

But I don’t like the idea of teaching things that are outright
wrong. So, I don’t want to tell my students that $\displaystyle\int \frac{1}{x} d x =
\log|x| + C$ where $C$ is a *constant*.

What do we do instead? Are we really going to tell these students — who, remember, might be 17 years old and not interested in mathematics at all — that the constant of integration $C$ is actually a ‘constant that varies’? Do we give them the explicit formula

$\int \frac{1}{x} d x = \begin{cases} \log|x| + C^- &\text{if } x \lt 0\\ \log|x| + C^+ &\text{if } x \gt 0 \end{cases}$

where $C^-$ and $C^+$ are constants? Or do we simply cop out, by avoiding integrating $1/x$ over disconnected domains?

I think I know what I think — but I want to hear your answers first.

## Re: Reader Survey: log|x| + C

Simplest thing to do, I think, is think of C as being locally constant, rather than globally constant. (After all, this is how one would need to generalise the fundamental theorem of calculus to disconnected domains anyway.)