I was thinking about $\int \frac{1}{x}dx$ and how it is defined because if $\int x^{n} dx = \frac{x^n+1}{n+1}$ where $n$ is a constant then: $$\int \frac{1}{x}dx = \frac{x^{-1+1}}{-1+1}$$ $$ = \frac{x^{0}}{0} $$ $$= \frac{1}{0}$$ since $x^{0} = 1$ and $\frac{1}{0}$ is not defined.
My question is how is it that $\int \frac{1}{x}dx$ exists if this is the result that I get?