Finding the limits while conversion from rectangular to polar coordinates (A very basic question) When converting rectangular coordinates into polar coordinates it is usually done by $$x=r\cos(\theta),~~~~~y=r\sin(\theta).$$ Where $(r,\theta)$ represent polar coordinates and $(x,y)$ represent rectangular coordinates. Now it is easy to see that $$r=\sqrt{x^2+y^2},~~~~\theta=\arctan(\frac{y}{x}).$$ Now if $-\infty \leq x\leq \infty$ and $-\infty \leq y\leq \infty$ then $0\leq r\leq\infty$. But how does $0\leq \theta \leq 2\pi$? I ask this question because $-\infty\leq(\frac{y}{x})\leq \infty$ and therefore $\theta$ should have limits $-\pi/2\leq \theta\leq \pi/2$ instead of $0\leq \theta\leq2\pi$. Which very basic point I am missing here? Please clarify with some explanation. Thanks in advance.
 A: The problem is created by your claim that

Now it is easy to see that $r=\sqrt{x^2+y^2}$, $\theta=\arctan\left(\frac{y}{x}\right)$.

The second one is definitely false. (If it's any consolation, this is a very popular misconception … which doesn't make it any more true, though.) And the first one may be true or false depending on an interpretation — some definitions of polar coordinates require $r\ge0$, while other definitions allow $r$ to be negative. Still, even if we stick with non-negative $r$, the second claim is wrong. And we start with a wrong premise, no wonder we end up confused and things don't work out and nothing makes sense.
The real definition of the polar angle $\theta$ is, roughly speaking, that it must point from the origin in the direction of the point $(x,y)$. So it naturally is very geometrical. From this definition, we can develop different formulas for $\theta$ depending on the location of the point $(x,y)$. In some cases — when $(x,y)$ lies in the first of the fourth quadrant (as well as on the $y$-axis or on the positive side of the $x$-axis) — we can take $\theta=\arctan(y/x)$. But in other cases this expression for $\theta$ can't possibly be true, simply because $\arctan$ returns values between $\left(-\frac{\pi}{2},\frac{\pi}{2}\right)$, i.e. within quadrants I and IV only, but the actual point isn't there!
Moreover, for each point $(x,y)$ there are infinitely many corresponding values of $\theta$, due to the periodic nature of revolving around the origin. Say, for the cartesian point $(1,1)$, some possible values of the polar angle are $\theta=\frac{\pi}{4},\frac{9\pi}{4},-\frac{7\pi}{4},\ldots$ and so on, and so forth. If we have any reasons for doing so, we can restrict $\theta$ to be within $0\le\theta<2\pi$, but we don't have to restrict it to that interval — generally, $\theta$ can be any real number.
So, to answer your question:

Which very basic point I am missing here?

You took a false statement as a definition, which lead to all this trouble.
