Solution to $\frac{\operatorname{d}x(t)}{\operatorname{d}t} = -\sin(x(t))$? 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.
 A: $$\frac{dx}{dt}=-\sin x \implies \int \frac{dx}{\sin x}=- \int dt \implies \ln \tan (x/2)=-t+C$$
$$\implies x(t)=2\tan^{-1}[D e^{-t}] \implies x(0)=2\tan^{-1} D \implies D=\tan(x_0/2).$$ So finally we have 
$$x(t)=2 \tan^{-1}[\tan(x_0/2)~ e^{-t}].$$
A: Rearrange the equation to become $$
-\frac{x'(t)}{\sin(x(t))} = 1 
$$
and antidifferentiate both sides to obtain $$
\log\left(\cot\left(\frac{x(t)}{2}\right)\right) = t + c
$$
The initial value of $x(0) = x_0$ gives us $c=\log(\cot(x_0/2))$.
Solving for $x(t)$, we get $$
x(t) = 2\mathrm{arccot}(e^{t+c}) = 2\mathrm{arccot}\left(e^t\cot(x_0/2)\right)
$$
You have to choose the appropriate branch of the inverse cotangent so that $\mathrm{arccot}(\cot(x_0/2)) = x_0/2$ otherwise you'll be off by some multiple of $\pi$.
A: 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}$$
