Let's consider the ODE $$t\cdot x'(t)=x(t)$$.
First approach:
$$\frac{x'(t)}{x(t)}=1/t,\quad\text{for }t\ne 0$$
$$\int\frac{x'(t)}{x(t)}dt= \int \frac1 t dt$$
$$\log(x(t))=\log|t|+C$$
$$\iff x(t)=\underbrace{e^C}_{=:C_1}|t|$$.
Second approach:
$dx(t)/dt=x(t)/t$ for $t\ne 0$ \begin{align} \int \frac 1 x dx = \int \frac 1 t dt&\iff \log|x(t)|=\log|t| + C\\ &\iff |x(t)|=\underbrace{e^C}_{=C_1}|t|\\ &\iff x(t)=C_1t. \end{align}
You see only the second approach is the solution of this ODE. Why do we not obtain the same result in both approaches?
For any real valued function we have that
$$\int\frac{x'(t)}{x(t)}\,\mathrm dt=\ln(|x(t)|)+ C$$
Then if $x$ is real-valued your first solution is wrong.