How to solve $y=\tan(θ)$ for $θ$? If $\arctan(\tan(\theta))$ is not necessarily equal to $\theta$, how come if we are given $y=\tan(θ)$ the solution in terms of $\theta$ is $\theta=\arctan(y)$?
I'm trying to intergrate $1/(1+y^2)$ using trig substitution and I am trying to get my solution, $\theta$, in terms of $y$, $y=\tan(\theta)$

Hint
$$\tan x=\tan (x+k\pi), k\in \mathbb{Z}$$
$$\int \frac{dx}{1+x^2}=\arctan x + C.$$
$C$ plays the role of not having $\arctan(\tan \theta)=\theta$ depending on the range.
