The derivative of #arctanx# is #d/dxarctanx=1/(1+x^2)#, so the chain rule tells us that when we have a function inside the arctangent function, #d/dxarctanu=1/(1+u^2)(du)/dx#.
Thus:
#d/dxarctan(x-sqrt(1+x^2))=1/(1+(x-sqrt(1+x^2))^2)d/dx(x-sqrt(1+x^2))#
Note that #(x-sqrt(1+x^2))^2=x^2-2xsqrt(1+x^2)+(1+x^2)#.
Also note that #d/dxsqrt(1+x^2)=d/dx(1+x^2)^(1/2)=1/2(1+x^2)^(-1/2)(2x)=x/sqrt(1+x^2)#.
#=1/(2x^2-2xsqrt(1+x^2)+2)(1-x/sqrt(1+x^2))#
#=1/2*1/(x^2-xsqrt(1+x^2)+1)((sqrt(1+x^2)-x)/sqrt(1+x^2))#
#=(sqrt(1+x^2)-x)/(2sqrt(1+x^2)(x^2-xsqrt(1+x^2)+1))#