Can you have different integration constants for functions like $1/x^2$, one on each component of its domain?

I was just griping about this yesterday, coincidentally, for a similar function. Calculus books will almost universally say that $$\int \frac{dx}{x} = \ln\lvert x\rvert + C,$$ as though the addition of the absolute value is an improvement in generality. In fact, just as you describe, it is actually incorrect, because $1/x$ and, correspondingly, $\ln \lvert x \rvert$, have asymptotes at 0 and this decouples the constant of integration somewhat.

The reason is that the notation $\int f(x) \, dx$ is wrong, or at least, bad. It suggests that the limits of integration don't matter, because "they only add a constant". In fact, the difference between the integrals $$\int_a^x \frac{dt}{t}$$ for $a > 0$ and $a < 0$ is complete: there is no value of $x$ for which both are defined. They only differ by a constant if the integrand is integrable across the interval between two different values of $a$. So for $a > 0$ and $a < 0$ you are, in effect, defining two completely unrelated functions, not one single function $\ln \lvert x \rvert + C$ for a single constant $C$.


Yes, you have the choice of a constant of integration on each component of the domain of the integrand function.