If $$y=\cot ^{-1}\left(\frac{1+x}{1-x}\right)$$ then $\dfrac{\mathrm d y}{\mathrm d x}=?$
By taking $x=\tan y$ ,then
$y=\cot ^{-1}\left(\dfrac{1+\tan y}{1-\tan y}\right)$
$y=\cot ^{-1}\left(\dfrac{\cot y+1}{\cot y-1}\right)$
$y=\cot ^{-1}\left(\cot\left(y-\dfrac{\pi}{4}\right)\right)$
$y'=\dfrac{1}{1+x^2}$
But if we differentiate directly(by chain rule) then we get answer $-\dfrac{1}{1+x^2}$ ?
thankyou
The very first thing you did wrong was substituting $x=\tan y$. How can you do that when $y$ is itself a function of $x$?
Secondly, when you apply the chain rule, you should get it's derivative as $y'=-\dfrac{1}{1+x^2}$.
Now if you want to proceed via a substitution, substitute $x=\tan \theta$ and since $x \in \mathbb{R}-\{1\}$, we have $\theta \in \left(-\dfrac{\pi}{2},\dfrac{\pi}{2}\right)-\{\dfrac{\pi}{4}\}$ so that you finally get $$y=\cot ^{-1}\left(\cot\left(\dfrac{\pi}{4}-\theta\right)\right)=\begin{cases}\dfrac{\pi}{4}-\theta~~~~ \text{for} ~\theta\in \left(-\dfrac{\pi}{2},\dfrac{\pi}{4}\right) \\ \dfrac{5\pi}{4}-\theta ~~~~\text{for} ~\theta \in \left(\dfrac{\pi}{4},\dfrac{\pi}{2}\right)\end{cases}$$ and since we have $\dfrac{\mathrm d y}{\mathrm d \theta}=-1$ for both situations and we had from $x=\tan \theta$, $\dfrac{\mathrm{d}x}{\mathrm{d}\theta}=1+x^2$, we get $y'=-\dfrac{1}{1+x^2}$.