solving the differential equation$y'+\sin y+x \cos y+x=0.$ How to solve the following differential equation?
$$y'+\sin y+x \cos y+x=0.$$

HINT:
$$y'+\sin y+x \cos y+x=0 \implies \frac{dy}{dx}+\sin y=-x(1+\cos y)$$
$$\implies \frac{dy}{dx}\cdot\frac1{1+\cos y}+\frac{\sin y}{1+\cos y}=-x$$
Using $\cos 2z=2\cos^2z-1,\sin2z=2\sin z\cos z,$
$$\frac12\sec^2\frac y2 \frac{dy}{dx}+\tan\frac y2=-x$$
$$\implies  \frac{d\left(\tan\frac y2\right)}{dx}+\tan\frac y2 \cdot1=-x$$
Multiplying either sides by the Integrating factor   $e^{\int dx}=e^x,$
$$ e^x\cdot d\left(\tan\frac y2\right)+\tan\frac y2 \cdot e^xdx=-e^xxdx$$
so that the left hand side becomes $d\left(e^x\cdot\tan\frac y2\right)$
So, we have  $$d\left(e^x\cdot\tan\frac y2\right)=-e^xxdx$$
Now integrate
