Example: Solve the following ODE:

$$y'+\sin(x+y)=\sin(x-y)$$

I have tried many ways to do this, but none of them worked. It isn't exact, and it isn't linear either. What should I do to move forward?

Any help appreciated.


Solution 1:

$$y'+\sin(x+y)=\sin(x-y)$$ $$y'=\sin(x-y)-\sin(x+y)=-2\cos x \sin y$$ $$\frac{dy}{dx}=-2\cos x \sin y$$ $$\frac{dy}{\sin y}=-2\cos x \,dx$$ $$\csc y\, dy=-2\cos x \,dx$$ Integrating both sides, we get $$\ln|\csc y-\cot y|=-2\sin x + c$$ where $c$ is a constant of integration.