How would you calculate a derivative of $ f(x)= \frac{\sqrt{x+1}}{2-x}$ by the limit definition?

Note that we have

$$\begin{align} \frac{\sqrt{x+1+h}}{2-x-h}-\frac{\sqrt{x+1}}{2-x}&=\frac{\sqrt{x+1+h}-\sqrt{x+1}}{2-x-h}+\frac{h\sqrt{x+1}}{(2-x-h)(2-x)}\\\\ &=\frac{h}{(2-x-h)(\sqrt{x+1+h}+\sqrt{x+1})}+\frac{h\sqrt{x+1}}{(2-x-h)(2-x)}\\\\ \end{align}$$

Now divide by $h$ and let $h\to 0$ to find

$$\frac{d}{dx}\left(\frac{\sqrt{x+1}}{2-x}\right)=\frac{1}{2(2-x)\sqrt{x+1}}+\frac{\sqrt{x+1}}{(2-x)^2}$$


We have that

$$\frac{\frac{\sqrt{(x+h)+1}}{2-(x+h)}-\frac{\sqrt{x+1}}{2-x}}h=\frac{\left(\frac{\sqrt{(x+h)+1}}{2-(x+h)}-\frac{\sqrt{x+1}}{2-x}\right)\left(\frac{\sqrt{(x+h)+1}}{2-(x+h)}+\frac{\sqrt{x+1}}{2-x}\right)}{h\left(\frac{\sqrt{(x+h)+1}}{2-(x+h)}+\frac{\sqrt{x+1}}{2-x}\right)}=$$

$$=\frac{\frac{(x+h)+1}{(2-(x+h))^2}-\frac{x+1}{(2-x)^2}}{h\left(\frac{\sqrt{(x+h)+1}}{2-(x+h)}+\frac{\sqrt{x+1}}{2-x}\right)}=\frac{\frac{((x+h)+1)(2-x)^2-(x+1)(2-(x+h))^2}{(2-(x+h))^2(2-x)^2}}{h\left(\frac{\sqrt{(x+h)+1}}{2-(x+h)}+\frac{\sqrt{x+1}}{2-x}\right)}=\ldots$$

and since (the cancellation in red is the crucial step)

$$((x+h)+1)(2-x)^2-(x+1)(2-(x+h))^2=$$

$$=\color{red}{(x+1)(2-x)^2}+h(2-x)^2\color{red}{-(x+1)(2-x)^2}+2h(x+1)(2-x)-h^2(x+1)=$$

$$=h(2-x)^2+2h(x+1)(2-x)-h^2(x+1)$$

we obtain

$$\ldots=\frac{\frac{h(2-x)^2+4h(x+1)(2-x)+h^2(x+1)}{(2-(x+h))^2(2-x)^2}}{h\left(\frac{\sqrt{(x+h)+1}}{2-(x+h)}+\frac{\sqrt{x+1}}{2-x}\right)}=\frac{(2-x)^2+2(x+1)(2-x)-h(x+1)}{\left(\frac{\sqrt{(x+h)+1}}{2-(x+h)}+\frac{\sqrt{x+1}}{2-x}\right)\left((2-(x+h))^2(2-x)^2\right)}\to$$

$$\to \frac{(2-x)^2+2(x+1)(2-x)}{\left(\frac{\sqrt{x+1}}{2-x}+\frac{\sqrt{x+1}}{2-x}\right)(2-x)^4}=\frac{(2-x)+2(x+1)}{2\sqrt{x+1}(x-2)^2}=\frac{x+4}{2\sqrt{x+1}(x-2)^2}$$


Taking the first definition : $$\lim_{h\to 0} \frac{\frac{\sqrt{(x+h)+1}}{2-(x+h)}-\frac{\sqrt{x+1}}{2-x}}h = \lim_{h\to 0} \frac{\sqrt{(x+h)+1}(2-x)-\sqrt{x+1}(2-(x+h))}{(2-(x+h))(2-x)h}$$$$= \lim_{h\to 0} \frac{(x+h+1)(2-x)^2-(x+1)(2-x-h)^2}{(2-x-h)(2-x)h( \sqrt{(x+h)+1}(2-x)+\sqrt{x+1}(2-(x+h)) )} $$

$$= \lim_{h\to 0} \frac{h^2(-x-1)+h(-x^2-2x+8)}{(2-x-h)(2-x)h( \sqrt{(x+h)+1}(2-x)+\sqrt{x+1}(2-(x+h)) )} $$ $$= \frac{-x^2-2x+8}{(2-x)^2\cdot(2\sqrt{x+1}(2-x))}=-\frac{x+4}{2(2-x)^2\sqrt{x+1}} $$

Too heavy calculations though, don't use the definition for such derivatives.