Justify the fact that antiderivative of $\frac{1}{x}$ is $\ln |x|$ not $\ln x$ Justify the fact that antiderivative of $\frac{1}{x}$ is $\ln |x|$ not $\ln x$
Does the derivatives domain $have$ to be the $same$ as the original functions?
$\frac{1}{x} \neq 0$, but $\ln x >0$. Their domains don't agree, but how can this prove that the derivative is $not$ $\frac{1}{x}.$

I $can$ prove that derivative of $\ln |x|$ is in fact $\frac{1}{x}$, but why does simple $\ln x$ not work?
 A: An antiderivative of a function $f(x)$ is a function $F(x)$ such that $F'(x)=f(x)$ for every point in the domain of $f$. So yes, the domain of the antiderivative should be the same. 
The domain of $\ln x$ is $x>0$ whereas the domain of $1/x$ is all of $\mathbb{R}\setminus 0$, which is strictly larger (it includes the negative axis $x<0$). Therefore $\ln x$ cannot be the antiderivative on the entire domain $\mathbb{R}\setminus 0$; we must find a way to extend the function to the larger domain.
The part of $1/x$ defined on the negative real axis has an antiderivative too, it is $\ln(-x),$ since the domain of $\ln(-x)$ is $x<0$ and $\frac{d(\ln(-x))}{dx}=\frac{1}{-x}\cdot\frac{d(-x)}{dx}=\frac{1}{x}$. 
We can capture both functions on the larger domain with the absolute value $\ln|x|$, which is just $\ln x$ on the positive axis, $\ln(-x)$ on the negative axis.
Note that while $\ln|x|$ is an antiderivative of $1/x$, it's not the most general one, nor even is $\ln|x|+C$ for any constant $C$. Because of the disconnected domain, you may choose different constants, so the most general antiderivative defined on the whole domain of $1/x$ is
$$
\begin{cases}
\ln x + C_1, & \text{if }x\ > 0 \\
\ln(-x) + C_2, & \text{if } x < 0 \\
\end{cases}
$$
and $C_1$ need not equal $C_2$. Thanks to MathematicsStudent1122 for reminding me of this fact.
