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$?
 A: 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}$$
A: Why it doesn't work can be seen by quantifying how accurate the approximation $f(x+y) \approx f(x)$ is. This is rightfully a zeroth order Taylor expansion,
$$ f(x+dx) = f(x) + O(dx) $$
for the function $f(x)=1/x$, we see
$$ \frac1{x+dx}-\frac1x = O(dx)$$
and therefore
\begin{align*}
\frac{\frac{1}{x+dx} - \frac{1}{x}}{dx} &=\left(\frac{1}{x+dx} - \frac{1}{x} \right) \frac{1}{dx} \\
&= O(dx)\frac1{dx} \\&= O(1).
\end{align*}
$O(1)$ quantities are not zero as $dx\to0$, so we cannot conclude as you did. Instead, we need to use a more accurate expansion like a first order Taylor expansion (but that's a little circular), or be more careful in your algebraic manipulations like the other answers.
A: $$\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}$$
A: The view of standard analysis has been clarified well.
Here is a explanation in the view of non-standard analysis.
If $a\approx b$, is $\frac{1}{a}\approx \frac{1}{b}$?
$a\approx b$ means that $|a-b|$ is small enough. After multiplying $|\frac{1}{ab}|$, we get $|\frac{1}{a}-\frac{1}{b}|$. But one cannot assure that this is also sufficiently small, this is because $|\frac{1}{ab}|$ can be infinitely large.
To be precise, small enough means smaller than any $\frac{1}{n}$, where $n$ is a positive integer, and large enough means that larger than any positive integers.
The only small enough (or, say infinitesimal) element in the real number is nothing but $0$, but there are more in the hyperreal number.
