<s>[INST] 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$?
 [/INST] $$\frac{\,d}{\,dx} \frac{1}{x}=\lim_{h\rightarrow 0} \frac{\frac{1}{x+h}-\frac{1}{x}}{h}= \lim_{h\rightarrow 0}\frac{x-(x+h)}{hx(x+h)}=\lim_{h\rightarrow 0} -\frac{1}{x(x+h)}=-\frac{1}{x^2}$$
</s>