Differentiate $\tan ^{-1}\left(\frac{1+a x}{1-a x}\right)$ with respect to $\sqrt{1+a^{2} x^{2}}$.
Let $u=\tan ^{-1}\left(\frac{1+\operatorname{ax}}{1-2 x}\right)$ and $v=\sqrt{1+a^{2} x^{2}}$
We need to differentiate $u$ with respect to $v$ that is find $\frac{d u}{d v}$.
We have $u=\tan ^{-1}\left(\frac{1+a x}{1-a x}\right)$
By substituting $a x=\tan \theta$, we have
$\mathrm{u}=\tan ^{-1}\left(\frac{1+\tan \theta}{1-\tan \theta}\right)$
$\Rightarrow \mathrm{u}=\tan ^{-1}\left(\frac{\tan \frac{\pi}{4}+\tan \theta}{1-\tan \frac{\pi}{4} \tan \theta}\right)$
$\Rightarrow \mathrm{u}=\tan ^{-1}\left(\tan \left(\frac{\pi}{4}+\theta\right)\right)\left[\because \tan (\mathrm{A}+\mathrm{B})=\frac{\tan \mathrm{A}+\tan \mathrm{B}}{1-\tan \mathrm{A} \tan \mathrm{B}}\right]$
$\Rightarrow u=\frac{\pi}{4}+\theta$
$\Rightarrow u=\frac{\pi}{4}+\tan ^{-1}(a x)$
On differentiating $u$ with respect to $x$, we get
$\frac{d u}{d x}=\frac{d}{d x}\left[\frac{\pi}{4}+\tan ^{-1}(a x)\right]$
$\Rightarrow \frac{\mathrm{du}}{\mathrm{dx}}=\frac{\mathrm{d}}{\mathrm{dx}}\left(\frac{\pi}{4}\right)+\frac{\mathrm{d}}{\mathrm{dx}}\left[\tan ^{-1}(\mathrm{ax})\right]$
We know $\frac{\mathrm{d}}{\mathrm{dx}}\left(\tan ^{-1} \mathrm{x}\right)=\frac{1}{1+\mathrm{x}^{2}}$ and derivative of a constant is 0 .
$\Rightarrow \frac{d u}{d x}=0+\frac{1}{1+(a x)^{2}} \frac{d}{d x}(a x)$
$\Rightarrow \frac{d u}{d x}=\frac{1}{1+a^{2} x^{2}}\left[a \frac{d}{d x}(x)\right]$
$\Rightarrow \frac{d u}{d x}=\frac{a}{1+a^{2} x^{2}} \frac{d}{d x}(x)$
We know $\frac{\mathrm{d}}{\mathrm{dx}}(\mathrm{x})=1$
$\Rightarrow \frac{d u}{d x}=\frac{a}{1+a^{2} x^{2}} \times 1$
$\therefore \frac{d u}{d x}=\frac{a}{1+a^{2} x^{2}}$
Now, we have $v=\sqrt{1+a^{2} x^{2}}$
On differentiating $v$ with respect to $x$, we get
$\frac{d v}{d x}=\frac{d}{d x}\left(\sqrt{1+a^{2} x^{2}}\right)$
$\Rightarrow \frac{d v}{d x}=\frac{d}{d x}\left(1+a^{2} x^{2}\right)^{\frac{1}{2}}$
We know $\frac{\mathrm{d}}{\mathrm{dx}}\left(\mathrm{x}^{\mathrm{n}}\right)=\mathrm{n} \mathrm{x}^{\mathrm{n}-1}$
$\Rightarrow \frac{d v}{d x}=\frac{1}{2}\left(1+a^{2} x^{2}\right)^{\frac{1}{2}-1} \frac{d}{d x}\left(1+a^{2} x^{2}\right)$
$\Rightarrow \frac{d v}{d x}=\frac{1}{2}\left(1+a^{2} x^{2}\right)^{-\frac{1}{2}}\left[\frac{d}{d x}(1)+\frac{d}{d x}\left(a^{2} x^{2}\right)\right]$
$\Rightarrow \frac{d v}{d x}=\frac{1}{2 \sqrt{1+a^{2} x^{2}}}\left[\frac{d}{d x}(1)+a^{2} \frac{d}{d x}\left(x^{2}\right)\right]$
We know $\frac{\mathrm{d}}{\mathrm{dx}}\left(\mathrm{x}^{\mathrm{n}}\right)=\mathrm{n} \mathrm{x}^{\mathrm{n}-1}$ and derivative of a constant is 0 .
$\Rightarrow \frac{d v}{d x}=\frac{1}{2 \sqrt{1+a^{2} x^{2}}}\left[0+a^{2}\left(2 x^{2-1}\right)\right]$
$\Rightarrow \frac{d v}{d x}=\frac{1}{2 \sqrt{1+a^{2} x^{2}}}\left[2 a^{2} x\right]$
$\therefore \frac{d v}{d x}=\frac{a^{2} x}{\sqrt{1+a^{2} x^{2}}}$
We have $\frac{\mathrm{du}}{\mathrm{dv}}=\frac{\frac{\mathrm{du}}{\mathrm{dv}}}{\frac{\mathrm{dv}}{\mathrm{dx}}}$
$\Rightarrow \frac{d u}{d v}=\frac{\frac{a}{1+a^{2} x^{2}}}{\frac{a^{2} x}{\sqrt{1+a^{2} x^{2}}}}$
$\Rightarrow \frac{d u}{d v}=\frac{a}{1+a^{2} x^{2}} \times \frac{\sqrt{1+a^{2} x^{2}}}{a^{2} x}$
$\therefore \frac{d u}{d v}=\frac{1}{a x \sqrt{1+a^{2} x^{2}}}$
Thus, $\frac{d u}{d v}=\frac{1}{a x \sqrt{1+a^{2} x^{2}}}$