I have a function $$f(x)=\frac{\arctan(2 \tan (x))}{x}$$
or in general for some $c\in \mathbb{R}$ $$f(x)=\frac{\arctan(c \tan (x))}{x}$$
Is there a way to define it so that it is continuous on interval $0\le x \le 2\pi$ avoiding piecewise definition?
Here is the plot of it:
But if I plot all instances of multivalued function $\tan ^{-1}(x)=\{\arctan(x)+\pi k\mid k\in \mathbb {Z} \}$ I get this:
I want the definition of the middle orange-green-blue-red-violet curve.




The question is about the simplest value for the multi-valued function
$$ y = f(x) := \text{arctan}(2\tan(x))/x. \tag1 $$
A natural place to start is to define the two-variable function
$$ g(x, y) = \tan(x\,y)-2\tan(x) \tag2 $$
so that
$$ 0 = g(x, f(x)). \tag3 $$
Notice that $\,f(0) = 2\,$ and that $\,f(n\pi/2) = 0\,$ for all integer $\,n.\,$
The power series expansions centered at the multiples of $\,\pi/2\,$ can be found using equation $(3)$ and the method of undetermined coefficients.
Some examples:
$$ f(x) = 2 - 2x^2 + 4x^4 - \frac{142}{15}x^6 + \frac{4612}{189}x^8 - \frac{312644}{4725}x^{10} + \dots. \tag4 $$
\begin{align*} f\Big(\frac{\pi}2(1+x)\Big) &= 1 - \frac{1-x}2\Big(x + (1-p)x^3 + (1-p-p^2)x^5 \\ &+\Big(1-p-p^2 -\frac{11}{15}p^3\Big)x^7 + \Big(1-p-p^2-\frac{11}{15}p^3-\frac{25}{189}p^4\Big)x^9 +\dots\Big) \tag5 \end{align*}
where $\,p := (\pi/4)^2.\,$
\begin{align*} f(\pi(1+x)) &= 1 + (1-x)\Big(x + (1-2p)x^3 +(1-2p+4p^2)x^5 \\ &+\Big(1-2p+4p^2-\frac{142}{15}p^3\Big)x^7 +\Big(1-2p+4p^2-\frac{142}{15}p^3+\frac{4612}{189}\Big)x^9 \dots\Big) \tag6 \end{align*}
where $\,p := \pi^2.\,$
The series expansions for other multiples of $\,\pi/2\,$ are very similar. For example the series expansion for $\,3\pi/2\,$ is the same as equation $(5)$ with $\,p := (3\pi/4)^2.\,$ This is due to the period $\,\pi\,$ for the tangent function.
By the way, a Wolfram Mathematica nice plot of the implicit equation is