This is the edited version of the original problem, hopefully presented in a clearer manner. (I have also renamed this post with a more befitting title)
Problem: y'(x) = 2\sin\left(\frac{y(x)}{2}\right) subjected to boundary conditions: $\lim\limits_{x\to−\infty}y(x)=0$ and $\lim\limits_{x\to+\infty}y(x)=k$ for some constant $k$
Annoying bits:
After integration, I seem to get $y(x)=4\operatorname{arccot}(c\exp(x))$ which has limits $\lim\limits_{x\to−\infty}y(x)=2\pi$ and $\lim\limits_{x\to+\infty}y(x)=0$.
But then I can't fit the boundary conditions of the problem! (This is driving me insane!) Please help. Thanks in advance!
RESOLVED: I have stupidly left out a minus sign, should be $y(x)=4\operatorname{arccot}(c\exp(-x))$