Differentiating w. r. t. $x$ 
Differentiate $$ \text{arccot} \frac{1-x}{1+x} $$ with respect to $x$

After putting $x= \cos \theta$, I got $$\text{arccot} \left(\tan^2 \frac{\theta}{2}\right)$$
Then how do I reach the answer?
Thank you in advance
 A: Method $1:$
HINT:
Putting $x=\tan \theta \implies \theta=\arctan x$
$$\frac{1-x}{1+x}=\frac{1-\tan\theta}{1+\tan\theta}=\frac{\tan\frac\pi4-\tan\theta}{1+\tan\theta\tan \frac\pi4}\text{ as } \tan\frac\pi4=1$$
$$=\tan\left(\frac\pi4-\theta\right)=\cot\{\frac\pi2-\left(\frac\pi4-\theta\right)\}=\cot\left(\frac\pi4+\theta\right)=\cot\left(\frac\pi4+\arctan x\right)$$
Then,   $$ \text{arccot} \left(\frac{1-x}{1+x}\right) =?$$
Method $2:$
Let  $$ y= \text{arccot} \frac{1-x}{1+x}\implies \cot y=\frac{1-x}{1+x} $$
Applying Componendo and dividendo, $$x=\frac{1-\cot y}{1+\cot y}=\frac{\tan y-1}{1+\tan y} (\text{ multiplying the numerator & the denominator by}\tan y)$$
$$\implies x=\frac{\tan y-\tan\frac\pi4}{1+\tan\frac\pi4\tan y}=\tan\left(y-\frac\pi4\right)\text{ using }\tan(A-B)=\frac{\tan A-\tan B}{1+\tan A\tan B}$$
Differentiating wrt $y,$
$$ \frac{dx}{dy}=\frac{d  \tan\left(y-\frac\pi4\right)}{d(y-\frac\pi4)}\cdot\frac {d(y-\frac\pi4)}{dy}=\sec^2\left(y-\frac\pi4\right)=1+\tan^2\left(y-\frac\pi4\right)=1+x^2$$
Now use this
A: I think this helps: www.youtube.com/watch?v=xO8PZdQOpyg to calculate $\frac{df}{dv}$
if applying the chain rule with:
$$v=\frac{x+1}{x-1}$$ and $$f=\text{arccot}(v)$$ and
$$\frac{df}{dx}=\frac{df}{dv}\frac{dv}{dx}$$
The calculation of $\frac{dv}{dx}$ is left to your exercise.
A: Let $u = \frac{1 - x}{1 + x}$. We know that $$\frac{d}{du} arc\cot{u} = \frac{-1}{1 + u^{2}}.$$
Using chain rule, we will get
$$\frac{d}{dx} arc\cot\frac{1-x}{1+x} = \frac{d}{du} arc\cot{u}\cdot\frac{d}{dx}u$$
$$= \frac{-1}{1 + \frac{(1 - x)^{2}}{(1 + x)^2}}\frac{-2}{(1 + x)^{2}}$$
$$= \frac{1}{1 + x^{2}.}$$
