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?
 A: I will only add the solution of the integral,
$$\int\dfrac{1}{1-\sin x}dx$$ set $\tan(x/2)=u$ then you will have
$$\int\dfrac{1}{1-{2u\over{1+u^2}}} \dfrac{2}{u^2+1} du$$ 
As a result you will have $$\dfrac{2\sin(\dfrac x2)}{\cos(\dfrac x2)-\sin(\dfrac x2)}+c$$
A: 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
$$
A: If you substitute $y_1=y-x$ you get:
$$y_1'=y'-1$$
$$\sin(x-y)=\sin(x-y_1-x)=\sin(y_1)$$
So:
$$\sin(y_1)=y_1'+1$$
Next you get $1=\dfrac{y_1'}{\sin(y_1)-1}$ and you can integrate both sides.
You get:
$1)$ Left side: $$\int_{x_0}^{x} 1 dx=x-x_0$$
$2)$Right side (by changing variables): $$\int_{x_0}^{x} \frac{y_1'(x)}{\sin(y_1(x))-1} dx=\int_{y_1(x_0)}^{y(x)} \frac{1}{\sin x-1} dx$$
A: The easiest way I found to actually solve the DE is like this:
$$let\ \ u=x-y \iff y=x-u \iff \frac{dy}{dx}=1-\frac{du}{dx}$$
Substituting in:
$$1-\frac{du}{dx}=\sin(u)\\\iff \frac{du}{dx}=1-\sin(u)\\ \iff \frac{1}{1-\sin(u)}\cdot\frac{du}{dx}=1$$
Multiplying throughout with $\frac{1+\sin(u)}{1+\sin(u)}$:
$$\frac{1+\sin(u)}{1-\sin^2(u)} \cdot \frac{du}{dx}=1 \\ \iff \left( \frac{1}{\cos^2(u)}+\frac{\sin(u)}{\cos^2(u)} \right)\cdot\frac{du}{dx}=1\\\iff\left( \sec^2(u)+\sec(u)\tan(u) \right)\cdot\frac{du}{dx}=1$$
This is much easier to integrate. So integrating both sides:
$$\int \left( \sec^2(u)+\sec(u)\tan(u) \right)\cdot\frac{du}{dx} dx=\int dx\\\iff \tan(u)+\sec(u)=x+C$$
And substituting $u=x-y$ back in gives the implicit general solution:
$$\tan(x-y)+\sec(x-y)=x+C$$
I feel this one makes much more sense than doing it through the $z=\tan(\frac{u}{2})$ substitution, which I feel just came from plugging it into wolfram alpha or something similar instead of actually attempting it. Or I could just be missing why the other substitution is more intuitive.
