Antiderivative of $1/x$, why can $C_1$ and $C_2$ differ? I haven't taken calculus in a while so please bear with me if this is an elementary question. For the function,
$$
f(x) = 1/x
$$
its antiderivative can be written as the piece-wise function,
$$
F(x) =
\begin{cases}
\ln x + C_1, & \text{if } x > 0 \\
\ln (-x) + C_2, & \text{if } x < 0
\end{cases}
$$
Why are the constants defined as $C_1$ and $C_2$ instead of just $C$? That implies to me that they can differ, but I don't understand how they could be unequal. Can someone provide an example of $f(x)$ and $F(x)$ where $C_1 \ne C_2$?
 A: Here is an example:
Let
$$F(x) =
\begin{cases}
\ln x + C_1, & \text{if } x > 0 \\
\ln (-x) + C_2, & \text{if } x < 0
\end{cases}$$
Then derivating, you get $f(x)=\frac{1}{x}$ for $x\neq 0$.
The point of this is that we use the following theorem:
Theorem If $F_1'(x)=F_2'(x)$ on some interval $I$ then, there exists some constant $C$ such that $F_1=F_2+C$.
The theorem is true only over intervals. Since $\frac{1}{x}$ is defined on $(-\infty,0) \cup (0,\infty)$ you have to apply twice the theorem over each of the intervals, getting one (potentially different) constant for each of the two intervals.
A: Just for the sake of showing a different example, consider the function
$$f(x) =
\begin{cases}
1, & \text{if } x \not \in \Bbb Z \\
\text{undefined}, & \text{if } x \in \Bbb Z
\end{cases}$$
The integral will be
$$F(x) =
\begin{cases}
\cdots \\
x + C_0, & \text{if } x \in (0, 1) \\
x + C_1, & \text{if } x \in (1, 2) \\
x + C_2, & \text{if } x \in (2, 3) \\
\cdots \\
\text{undefined}, & \text{if } x \in \Bbb Z
\end{cases}$$
which you should be able to verify by taking the derivative. Try drawing a picture to see what's going on here.
A: It is helpful to think of the space of antiderivatives of a given function as a torsor. See the following: http://math.ucr.edu/home/baez/torsors.html
A: The function has two separate and independent ''branches''  and the slope $m=F'(x)$ of the two branches does not depends from the added constants but is, in  any case $ m=1/x$ . So, yes, the two constants are independent.
