# Why does my professor say that writing $\int \frac 1x \mathrm{d}x = \ln|x| + C$ is wrong?

My professor says that writing this is convenient $$\int \frac 1x \mathrm{d}x = \ln|x| + C\tag{1}$$ but wrong, since it should be written as: $$\int \frac 1x \mathrm{d}x = \begin{cases}\ln x + C &x > 0\quad(\star)\\[0.2em] \ln(-x) + C &x < 0\end{cases}$$

I was wondering why is that the case. I thought that the two were equivalent, as one can see by the definition of absolute value. In $(\star)$ the equality sign is dropped because the logarithm is not defined in $0$, but that would be the case with $(1)$ as well.

• Notice that the integral only exists, if $0$ is not in the interval $[a,b]$ – Peter Nov 22 '14 at 20:33
• Yes, the formula $F(b)-F(a)$ gives a value here, but if $0$ is in the interval [a,b], the value is false because the integral does not exist. – Peter Nov 22 '14 at 20:38
• @Winther: Well he probably wrote two different constant and I didn't pay enough attention (the class is huge and I'm a bit far). Ivo's observation makes sense. – rubik Nov 22 '14 at 20:45
• @Winther If we disregard the unfortunate indefinite integral notation for a moment, the point of the teacher most likely is that the family of primitives of $\frac{1}{x}$ on its domain $\mathbb{R}\setminus \{0\}$ is not $\log \lvert x\rvert + C$, but $\log \lvert x\rvert + C + D\cdot \operatorname{sgn} (x)$. – Daniel Fischer Nov 22 '14 at 20:50
• @Dr.SonnhardGraubner Using $D\cdot \operatorname{sgn} (x)$ is just a convenient way to avoid writing the case distinction here in the comments. – Daniel Fischer Nov 22 '14 at 21:05

I don't see anything wrong with what you wrote there. I could only imagine a rigorous teacher commenting about the constant... it need not be the same in each interval, as in: $$\int \frac 1x \mathrm{d}x = \begin{cases}\ln x + C_1 &x > 0\\[0.2em] \ln(-x) + C_2 &x < 0\end{cases}$$
The notation $\int \frac 1x dx$ is already ambiguous. If $f$ is defined on some open set of the real numbers, the notation $$\int f(x) dx = RHS$$ (without borns of integration) means that the primitives on $f$ in its open set of definition are the functions that are parametrized by the RHS.
If $f$ is defined on an inverval, this simply gives $$\int f(x)dx = F(x) + C, C \in \mathbb{R}.$$ If $f$ is defined on a union of disjoint intervals, then you should be more precised. In my opinion, it is better in this case to write a sentence of the kind:
The primitives of $\frac 1x$ on $\mathbb{R}^\ast$ are the functions defined by $\ln(-x) + C_1$ for $x < 0$ and $\ln(x) + C_2$ for $x > 0$, where $C_1$ and $C_2$ are arbitrary real constants.