<s>[INST] Non-linear differential equation Let $ x \in \mathbb{R} $
Find all solutions of the following differential equation :
$$
y'=\tan(y+x) 
$$
 [/INST] Let $u = y + x$. Then $u' = y' + 1$, so the ODE can be written $$u' = 1 +  \tan(u),$$ which is a separable equation. We have $$\int \frac{du}{1 + \tan u} = \int dx,$$ which reduces to $$\frac{1}{2}(u + \log|\sin u + \cos u|) = x + C.$$ To see this, let $$I = \int \frac{du}{1 + \tan u}.$$ Then $$I = \int \left(1 - \frac{\tan u}{1 + \tan u}\right)\, du = u - \int \frac{\tan u}{1 + \tan u},$$ and 
\begin{align}-\int \frac{\tan u}{1 + \tan u}\, du &= \int -\frac{\sin u}{\cos u + \sin u}\, du = \int \frac{-\sin u + \cos u}{\cos u + \sin u}\, du - \int \frac{\cos u}{\sin u + \cos u}\, du\\ &= \log|\cos u + \sin u| - \int \frac{1}{1 + \tan u}\, du\\
&= \log|\cos u + \sin u| - I.\end{align}
Therefore
$$I = \frac{1}{2}(u + \log|\sin u + \cos u|) + C.$$
Certainly $\int dx = x + C$, so we have $\frac{1}{2}(u + \log|\cos u + \sin u|) = x + C$. Now revert back to $y$.
</s>