<s>[INST] How do I solve $y' = \sin(x - y)$? How can I solve the differential equation:
$$y'=\sin(x-y)$$
Could I do this?
$$\frac{dy}{dx}= \sin x \cos y - \sin y \cos x$$
But, how would I continue?
 [/INST] Let $z = x - y$. Thus, $\dfrac{dy}{dx} = 1 - \dfrac{dz}{dx}$ and
$$
\dfrac{dy}{dx} = \sin(x - y) \quad \Rightarrow \quad \dfrac{dz}{dx} = 1 - \sin z \quad \Rightarrow \quad \int dx = \int \dfrac{dz}{1 -\sin z}
$$
The next step is to change $u = \tan(z/2)$ so that $dz = \dfrac{2du}{1 + u^2}$. Note that
$$
\sin z = \dfrac{2\sin(z/2)\cos(z/2)}{\cos^2(z/2) + \sin^2(z/2)} = \dfrac{2\tan(z/2)}{1 + \tan^2(z/2)} = \dfrac{2u}{1 + u^2}
$$
Thus,
$$
x = \int \dfrac{\dfrac{2du}{1 + u^2}}{1 -\dfrac{2u}{1 + u^2}} =2\int \dfrac{du}{1 + u^2 - 2u} = 2\int \dfrac{du}{(1-u)^2} = -\dfrac{2}{1-u} + C \quad \Rightarrow 
$$
$$
x = \dfrac{2}{\tan(z/2) - 1} + C = \dfrac{2}{\tan\biggl(\dfrac{x - y}{2}\biggr) - 1} + C
$$
</s>