The general solution of the differential equation $\dfrac{dy}{dx}=\cos(x+y)$, with $c$ as a constant, is

1. $y+\sin \left (x+y \right )=x+c \\$
2. $\tan \left (\dfrac{x+y}{2} \right)=y+c \\$
3. $\cos \left (\dfrac{x+y}{2} \right )=x+c \\$
4. $\tan \left (\dfrac{x+y}{2} \right )=x+c$