Simple differentiation from first principles problem I know this is really basic, but how do I differentiate this equation from first principles to find $\frac{dy}{dx}$:
$$
y = \frac{1}{x}
$$
I tried this:
$$\begin{align}
f'(x) = \frac{dy}{dx} & = \lim_{\delta x\to 0} \left[ \frac{f(x + \delta x) - f(x)}{\delta x} \right] \\
& = \lim_{\delta x\to 0} \left[ \frac{(x+\delta x)^{-1} - x^{-1}}{\delta x} \right] \\
& = \lim_{\delta x\to 0} \left[ \frac{1}{\delta x(x + \delta x )} - \frac{1}{x(\delta x)} \right] \\
& = \lim_{\delta x\to 0} \left[ \frac{1}{x(\delta x)} + \frac{1}{(\delta x)^2} - \frac{1}{x(\delta x)} \right] \\
& = 1
\end{align}$$
which is obviously wrong, since $f'(x) = - \frac{1}{x^2}$. Where am I going wrong?

$$\begin{align} f(x+h)-f(x) &= \dfrac{1}{x+h} - \dfrac{1}{x} \\ &=  \dfrac{x-h-x}{x(x+h)} \\ &= \dfrac{-h}{x(x+h)} \end{align}$$
