What is right way to calculate this integral and why?
$$ \int\frac{1}{2x}\text dx $$
I thought, that this substitution is right: $$ t = 2x $$ $$ \text dt = 2\text dx $$ $$ \frac{\text dt}{2} = \text dx $$ $$ \int\frac{1}{2x}\text dx=\int\frac{1}{t}\frac{\text dt}{2}=\frac{1}{2}\ln|2x| + C . $$
But it's not right, because this is the correct answer: $$ \int\frac{1}{2x}\text dx=\frac{1}{2}\int\frac{1}{x}\text dx=\frac{1}{2}\ln|x| + C . $$
Can someone explain me, why is the first way wrong? When I derive both results, I get the same result.