# certain trigonometric homeomorphisms

Are there any simple characterizations of rational functions $f(x,y)$ with real coefficients such that $\theta\mapsto f(\cos\theta,\sin\theta)$ is a homeomorphism from $\mathbb R\bmod 2\pi$ to $\mathbb R\cup\{\infty\}$ (the last set being the one-point compactification)?

(The fact that $\theta\mapsto\sec\theta+\tan\theta$ is such a homeomorphism despite the fact that each term separately is two-to-one onto its image and the first does not map onto the codomain, is what first made me think of this.)

-

The magic words are $\tan(\theta/2).$ That substitution reduces your question to asking which rational functions $\mathbb{R} \rightarrow \mathbb{R}$ are homeomorphisms. Those are precisely the functions whose derivative does not change sign, so differentiating our function we get a rational function which does not change sign. This is true if and only if both the numerator and denominator do not change sign, so let's just say they stay positive (or non-negative if you want homeo instead of diffeo). A polynomial is nonnegative on the real line if and only if it is the sum of (two) squares.

So, there you have it.

sum of two squares to express a nonnegative polynomial as a sum of two squares, factor it over $\mathbb{C}.$ It will have either real roots of even multiplicity or conjugate complex roots. A quadratic polynomial with no real roots can be written as a sum of two squares ("completing the square"), an even power of a polynomial can be written as a sum of two squares (one of which is $0$), and now note that the product of sums of two squares is likewise a sum of two squares (think of norms)

sigh to complete the answer, note that if the rational function has a pole, it can only have one simple pole (otherwise, the map is not $1$-$1$ at infinity), furthermore, the limits at $\pm \infty$ have to be equal and finite. Suppose that pole is at $x=a.$ Precompose your function by a linear fractional $\phi$ which sends infinity to $a$ - $x \mapsto \frac{a x}{x+ a + 1}$ is my personal favorite. Now, you have a rational function which sends infinity to infinity, so you can apply what I had said before.

-
Derivative of $-1/x-1/(x-1)$ does not change sign but this is not a homeomorphism. – Alexandre Eremenko Jul 21 '13 at 8:10
How can one express, say, $(x-a)^2+(x-b)^2+(x-c)^2$ as a sum of two squares? (just curiosity) – Qfwfq Jul 21 '13 at 15:34
@Qfwfq see the edit, though your case falls into the completing the square category ( notice that you have to take square roots to do this) – Igor Rivin Jul 21 '13 at 16:46
@AlexandreEremenko You are right, of course -- my answer is not quit complete, but this is not hard to fix... – Igor Rivin Jul 21 '13 at 16:50
@IgorRivin : Your later edit certainly clarifies things. If the only property of $\alpha\mapsto\tan\frac\alpha2$ that is relied on is that it is itself a homeomorphism from $\mathbb R\bmod2\pi$ to $\mathbb R\cup\{\infty\}$ then $\alpha\mapsto\sec\alpha+\tan\alpha$ also works (and no surprise there, since it is itself a tangent half-angle function, being equal to $\tan(\frac\pi4+\frac\alpha2)$), but also every function $\alpha\mapsto\text{some rational function of sine and cosine}$ that is itself such a homeomorphism will work just as well. – Michael Hardy Jul 21 '13 at 18:08