<s>[INST] 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
 [/INST] 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
</s>