<s>[INST] derivative of arctan(u) Im trying to find the derivative of $\arctan(x-\sqrt{x^2+1})$ here are my steps if someone could point out where I went wrong.
$$\begin{align}
\frac{\mathrm d~\arctan(u)}{\mathrm d~x} \;& =\; {1\over{1+u^2}}\cdot \frac{\mathrm d~u}{\mathrm d~x}
\\[1ex]
& =\; {1-{x\over{\sqrt{x^2+1}}}\over{1+(x-\sqrt{x^2+1})^2}}
\end{align}$$
Everything after this turns into a huge mess I don't know how to simplify. Is there a trick I missed or something I don't see?
 [/INST] It seems about right.
$$\begin{align}
\frac{\mathrm d~\arctan(u)}{\mathrm d~x} \;& =\; {1\over{1+u^2}}\cdot \frac{\mathrm d~u}{\mathrm d~x}
\\[1ex]
& =\; {1-{x\over{\sqrt{x^2+1}}}\over{1+(x-\sqrt{x^2+1})^2}}
\\[1ex]
 & =\; \frac{\sqrt{x^2+1}-x}{\sqrt{x^2+1}\;(1+x^2-2x\sqrt{x^2+1}+x^2+1)}
\\[1ex]
 & =\; \frac{\sqrt{x^2+1}-x}{2\sqrt{x^2+1}\;(1+x^2-x\sqrt{x^2+1})}
\\[1ex]
 & =\; \frac{(\sqrt{x^2+1}-x)\sqrt{x^2+1}\;(1+x^2+x\sqrt{x^2+1})}{2(x^2+1)\;((1+x^2)^2-x^2(x^2+1))}
\\[1ex]
 & =\; \frac{(x^2+1-x\sqrt{x^2+1})\;(1+x^2+x\sqrt{x^2+1})}{2(x^2+1)\;((1+x^2)^2-x^2(x^2+1))}
\\[1ex]
 & =\; \frac{((1+x^2)^2-x^2(x^2+1))}{2(x^2+1)\;((1+x^2)^2-x^2(x^2+1))}
\\[2ex]
 & =\; \frac{1}{2(x^2+1)}
\end{align}$$
[edit]okay, turns out it is a neat derivative[/edit]
</s>