You are given $\tan(\tan^{-1} x) = x$. Take a derivative of that to get $\displaystyle \sec^2(\tan^{-1} x) \cdot \frac{d}{dx} \left(\tan^{-1} x\right) = 1$.
Now, consider a right triangle with adjacent length $1$ and opposite length $x$, so that the triangle has an angle $\theta$ such that $\tan \theta = x$. Now we take $\displaystyle \sec \theta = \frac{1}{\cos \theta} = \frac{1}{\frac{1}{\sqrt{x^2+1}}} = \sqrt{x^2+1}$. So, $\sec^2 (\tan^{-1} x) = \sec^2 \theta = x^2+1$. Plugging this back into the original equation, we get $$\frac{d}{dx} \left(\tan^{-1} x\right) = \frac{1}{x^2+1}.$$