<s>[INST] How can we take the derivative of this function: $y = \frac{x}{x^2+1}$ from first principles (using the limit definition of the derivative)? I was taking the derivative of the function: $y = \frac{x}{x^2+1}$. I know that we can solve it by the quotient rule. But I tried using the limit definition of differentiation. This is how I did it:
$$\lim_{h \to 0} \frac{(x+h)/\left((x+h)^2+1\right) - x/(x^2+1)}{h}$$
$$=\lim_{h \to 0}\frac{(x+h)/(x^2+h^2+2xh+1) - x/(x^2+1)}{h}$$
Then I multiplied both the denominator and numerator by the common factor $(x^2+h^2+2xh+1)(x^2+1)$ and expanded:
$$=\lim_{h \to 0} \ \Biggl(\frac{x^3+x+x^2h+h - x^3-xh^2-2x^2h-x}{x^4+x^2h^2+2x^3h+x^2+x^2+h^2+2xh+1}\Biggr) \cdot \frac{1}{h}$$
I then simplified the expression:
$$=\lim_{h \to 0} \  \frac{h-x^2h-xh^2}{x^4h + x^2h^3+2x^3h^2+2x^2h+h^3+2xh^2+h}$$
Now what is to be done? It seems that I am very far from the actual derivative.
 [/INST] You are almost there, check that
$$f'(x)=\lim_{h \to 0} \frac{h-x^2h-xh^2}{x^4h + x^2h^3+2x^3h^2+2x^2h+h^3+2xh^2+h}$$
Divide by $h$ up and down:
$$f'(x)=\lim_{h \to 0}\frac{1-x^2-xh}{(x^4+2x^2+1)+x^2h^2+2x^3h+h^2+2xh}$$ $$\implies f'(x)=\frac{1-x^2}{(1+x^2)^2}$$
</s>