If you have a function $f:(\infty,0)\cup(0,\infty)\rightarrow\mathbb{R}$ defined by $$f(x)=\begin{cases}\ln(-x)+A&x\lt0\\\ln(x)+B&x\gt0\end{cases}$$ for fixed $A,B\in\mathbb{R},$ then $$\forall{x\in(\infty,0)\cup(0,\infty)},\;f'(x)=\frac1{x}.$$ As such, we say that $$\int\frac1{x}\,\mathrm{d}x=\begin{cases}\ln(-x)+A&x\lt0\\\ln(x)+B&x\gt0\end{cases}.$$ On the other hand, if $$f(x)=\begin{cases}-\frac1{x}+A&x\lt0\\-\frac1{x}+B&x\gt0\end{cases}$$ for fixed $A,B\in\mathbb{R},$ then $$\forall{x\in(\infty,0)\cup(0,\infty)},\;f'(x)=\frac1{x^2}.$$ As such, we say that $$\int\frac1{x^2}\,\mathrm{d}x=\begin{cases}-\frac1{x}+A&x\lt0\\-\frac1{x}+B&x\gt0\end{cases}.$$ In fact, for the general case, what you will have is that $$\int{x^n}\,\mathrm{d}x=\begin{cases}\frac{x^{n+1}}{n+1}+A&n\neq-1,\,x\lt0\\\frac{x^{n+1}}{n+1}+B&n\neq-1,\,x\gt0\\\ln(-x)+A&n=-1,\,x\lt0\\\ln(x)+B&n=-1,\,x\gt0\end{cases}.$$ This is because there is no $A,n$ such that if $f(x)=Ax^n,$ then $$f'(x)=\frac1{x}.$$ On the other hand, notice that $$\frac{x^{n+1}}{n+1}=\frac{e^{\ln(x)(n+1)}}{n+1}=\frac{1+\ln(x)(n+1)+\sum_{m=2}^{\infty}\frac{\ln(x)^m(n+1)^m}{m!}}{n+1}$$ $$=\frac1{n+1}+\ln(x)+\ln(x)\sum_{m=1}^{\infty}\frac{\ln(x)^m(n+1)^m}{(m+1)!}.$$ What this implies is that $$\lim_{n\to-1}\frac{x^{n+1}}{n+1}-\frac1{n+1}=\ln(x),$$ and notice that $$\lim_{n\to-1}\frac{x^{n+1}}{n+1}-\frac1{n+1}=\lim_{n\to-1}\int_1^xt^n\,\mathrm{d}t,$$ so $$\lim_{n\to-1}\int_1^xt^n\,\mathrm{d}t=\ln(x).$$