What is the solution to the solution to the differential equation
$$\frac{\operatorname{d}x(t)}{\operatorname{d}t} = -\sin(x(t))$$
for an arbitrary case where $x_0 \in \mathbb{R}$ and $t \in \mathbb{R}_{\geq 0}$?
$x(0) = x_0$ is given by the initial condition, and I know that
$$ \lim_{t\to\infty}x(t) = \left\{\begin{array}{ll} x_0, && \displaystyle\frac{x_0}{2\pi}+0.5 \in \mathbb{Z}\\ 2\pi\left\lfloor\displaystyle\frac{x_0}{2\pi}+0.5\right\rfloor, && \text{otherwise} \end{array}\right. $$
but it is what happens when $t \in (0,\infty)$ that is interesting.
The reason I came to think of this was that I wanted a simple formulation of a smooth (with respect to both $x_0$ and $t$) staircase function that is parameterizable with a continuous number, starts from the identity function and approaches a true (hard) staircase function as $t\to\infty$, and other suggestions either seemed to be non-smooth (i.e. not infinitely differentiable) or have a discrete parameter.
Rearrange and then integrate,
$$\frac{dx(t)}{\sin x(t) } = -dt\implies \int_{x(0)}^{x(t)}\frac{dx(t)}{\sin x(t) } = -\int_0^t dt$$
Use $[\ln \tan \frac u2]' = \frac1{\sin u}$ and the initial condition $x(0) = x_0$ to get
$$\ln\left(\tan\frac{x(t)}2\right)- \ln\left(\tan\frac{x_0}2\right)= -t$$
Thus, the solution is
$$\tan \frac{x(t)}2 = \tan\frac{x_0}2 \>e^{-t}$$