My textbook says the antiderivative of $\frac{1}{1+x^2}$ is $\tan^{-1}(x)$.
To confirm this to myself I took the derivative of $\tan^{-1}(x)$ expecting to get $\frac{1}{1+x^2}$ , but instead I ended up with $-\frac{1}{\sin^2(x)}$. So why is $\tan^{-1}(x)$ the antiderivative of $\frac{1}{1+x^2}$ if the derivative of $\tan^{-1}(x)$ is not $\frac{1}{1+x^2}$? Shouldn't the derivative of the antiderivative of a function give you the original function?