Why am I getting derivative of $y = 1/x$ function as $0$? I was finding the derivative of the function: $y = 1/x$. I did the followed steps:
\begin{align*}
\frac{\frac{1}{x+dx} - \frac{1}{x}}{dx} &=\left(\frac{1}{x+dx} - \frac{1}{x} \right) \frac{1}{dx} \\
&= \frac{1}{x dx + (dx)^2} - \frac{1}{x dx}.
\end{align*}
Since, $(dx)^2$ would be extremely small, I removed it, so
$$\frac{1}{x dx} - \frac{1}{x dx}$$
which is equal to zero.
why am I getting the derivative of $y = 1/x$ as $0$?

Do not remove $(dx)^2$:
$$\frac{\frac{1}{x+dx} - \frac{1}{x}}{dx}=\frac{x-(x+dx)}{(x+dx)xdx}=-\frac{1}{x(x+dx)} \to -\frac{1}{x^2}$$
