This function has two different integrals? $f(x)=∫\frac{1}{x^2}dx$
Integrating by u-substitution:
$u=x^2$ 
$du=2dx$
$\frac{1}{2}du = dx$
$∫\frac{1}{x^2}dx=$ $∫\frac{1}{u}\times\frac{1}{2}du$
$\frac{1}{2}$∫ $\frac{1}{u}du$
$=\frac{1}{2}ln u+c$ 
$=\frac{1}{2}ln x^2+c$ 
$=lnx+c$
Another way:
$∫\frac{1}{x^2}dx=∫x^{-2}dx $
$∫x^{-2}dx$
$=\frac{x^{-1}}{-1} + c$
$=-\frac{1}{x} + c$
Where have I gone wrong?

If $u=x^2$, then $\mathrm du=2x\,\mathrm dx$.
