TITLE: Are indefinite integrals unique up to the constant of integration?
QUESTION [9 upvotes]: We often write e.g. $$\int x^2 dx=\tfrac{1}{3}x^3+c$$ for any $c \in \mathbb{R}$, where $c$ is the constant of integration.
We can show (via limits) that, if $g(x)=\frac{1}{3}x^3+c$, then $\frac{dg}{dx}=x^2$ for any $c \in \mathbb{R}$.  But this doesn't exclude the possibility that some function $f=f(x)$ that doesn't have the form $\tfrac{1}{3}x^3+c$ also has the derivative $\frac{df}{dx}=x^2$.  So...

Q: Are indefinite integrals unique up to the constant of integration?  If so, how do we know?

REPLY [11 votes]: It was mentioned that the domain must be connected.  Example:  Sometimes people write
$$
\int \frac{dx}{x} = \ln|x| + C .
\tag{1}$$
But of course an antiderivative on the domain $(-\infty,0)\cup(0,+\infty)$ could have different values of $C$ on the positive part and on the negative part of the domain.  Making (1) a questionable thing to write.