Using U Substitution on 1/(3x) Say I want to find the indefinite integral of 1/(3x).
I can pull out the (1/3) so now I just have 1/x to integrate and I get (1/3)(lnx) as my final answer. This is the correct answer.
But now I'm learning U substitution and I'm wondering why I can't apply this method on this question. So I have 1/(3x) and I make u=3x, du=3dx and I plug back in and get du/(3u). Now if I do the exact same thing as I did in my first solution, pull out (1/3) and I have to integrate 1/u which is ln(u) = ln(3x) my final answer is (1/3)(ln(3x)) which is not the same as (1/3)(ln(x)). Am I not understanding U substitution correctly or is U sub not applicable here and if not then why?

Let's do our u-substitution on the integral
$$\int \frac{1}{3x} \ dx$$
Let $u=3x$, therefore $du=3 \ dx$.
$$\int \frac{1}{3x} \ dx$$
$$=\int \frac{1}{u} \cdot \frac{1}{3} \ du$$
$$=\frac{1}{3} \int \frac{1}{u} \ du$$
$$=\frac{1}{3}\ln|u|+C$$
Now we reverse our substitution:
$$\frac{1}{3}\ln|3x|+C$$
But wait! Remember the log rule
$$\ln{xy}=\ln{x}+\ln{y}$$
We can rewrite our antiderivative like this:
$$\ln(3)+\ln|x|+C$$
Well, $\ln(3)$ is a constant as well. When added to $C$, the sum will still be a constant. Therefore our antiderivative is really $\frac{1}{3}\ln|x|+C$.
$$\color{green}{\therefore \int \frac{1}{3x} \ dx=\frac{1}{3}\ln|x|+C}$$
