<s>[INST] substitution in $y' = \cos(y-x)$ equation I have one simple DE with separable variables to test substitutions skill:
$$\begin{align*}
y' &= \cos(y-x) \\
\frac{dy}{dx} &= \cos(y-x) \\
t &= y -x \\
\frac{dy}{dx} &= \cos t
\end{align*}$$
But what should I do next? I mean I do not know if there's an algorithm to handle substitutions in DEs or no 
 [/INST] $y-x=u$ derive $y'-1=u'\to y'=u'+1$
The equation becomes
$u'+1=\cos u$
$\dfrac{du}{dx}=\cos u-1$
$\dfrac{du}{\cos u-1}=dx$
$\int dx=x+C$
$\cos u=\dfrac{1-t^2}{1+t^2}$ substituting $t=\tan\frac{u}{2}$ 
$u=2\arctan t$ and $du=\dfrac{2dt}{1+t^2}$
$$\int \frac{1}{\cos u-1} \, du=\int \frac{2}{\left(\frac{1-t^2}{1+t^2}-1\right) \left(t^2+1\right)} \, dt=\int -\frac{1}{t^2} \, dt=\dfrac{1}{t}=\cot\frac{u}{2}$$
$x+C=\cot\dfrac{u}{2}$
$x+C=\cot\dfrac{y-x}{2}$
$y=x+2\,\text{arccot}(x+C)$
Hope this helps
</s>