# Graphs of rational functions of sine and cosine

What do graphs of rational functions of sine and cosine generally look like? (A variety of different shapes, I know. A classification or catalog of them might answer the question, or maybe a theoretical statement of some kind.)

The domain can be regarded as a circle $[0,2\pi]$ by identifying the endpoints, and the codomain is the circle $\mathbb R\cup\{\infty\}$, the one-point compactification of the line. Hence the graphs live on a torus. The sine and cosine wind once around the torus the horizontal (domain) way and zero times around the vertical (codomain) way. The tangent goes around once the horizontal way and twice the vertical way. The secant and cosecant do as the sine and cosine do, but they're on the other half of the torus (and it is just half if you map the circle $\mathbb R\cup\{\infty\}$ to the ordinary Euclidean circle in a way that takes $0, 1, \infty, -1$ in that order to points differing by an arc of a quarter of the whole circle.

So I looked at the graph of $\theta\mapsto\sec\theta+\csc\theta$. I was a bit startled. Superficially, it looked something like this:

• Between $0$ and $\pi/2$ it looks similar to $2\sqrt{2}\csc(2\theta)$, i.e. it came down from $+\infty$ and went back up;
• Between $\pi/2$ and $\pi$, it looks similar to one period of the tangent function, again of course with twice the frequency of the natural tangent function;
• Between $\pi$ and $3\pi/2$ it looks like the other lobe of the cosecant graph;
• Between $3\pi/2$ and $2\pi$ it looks like minus the tangent function, but again with twice the frequency.

But the actual shape of those lobes resembling the secant graph is not identical to the shape of the actual secant graph. And similarly with the tangent, although plotting the values of a tangent function having a zero at $3\pi/4$ against those of $\sec+\csc$ on that interval gives something remarkably close to a straight line, although visibly different from it.

So its windings around the torus are thus: It goes once around in the horizontal direction, and a net zero times around in the vertical direction. But in winding zero times around the circle $\mathbb R\cup\{\infty\}$, it starts and $\infty$, goes almost half way around in the negative direction, then goes in the positive direction almost two whole turns around the circle before turing around and heading back the other way.

-

Here's $\sec\theta + \csc\theta$ graphed on the torus:
The $\theta$ "axis" runs counterclockwise around the outer "equator" of the torus; $\theta = 0$ is to the left, $\theta = \pi/2$ is at the top, and so forth. For the codomain, the point(s) at $\infty$ are along the inner equator; the value of $\pm1$ occurs along the closest/farthest circular contours (not shown). The four circles represent the asymptotes of the function.
I tried to make this clear with shading, but there are no windings (through the hole). From $\theta=0$, the curve pokes a through a little on this side of the hole, then dips in and comes around from the outer edge at $\theta = 3\pi/4$; at $\pi$, the curve pokes backward through the hole, then comes back. One can see(?) that the places where the curve pokes through the hole can be "un-poked" and continuously deformed to trace the $\theta$ axis (the outer equator) once.