Solve $(\tan(x) - 2 y + 5) dx + (\sin(2 x) + (4 - y) \cos^2(x)) dy = 0$ on $(-\pi/2, \pi/2)$ Solve $(\tan(x) - 2 y + 5)  dx + (\sin(2 x) + (4 - y) \cos^2(x))  dy = 0$ on $(-\pi/2, \pi/2)$
I got stuck here
I'm not looking for a full solution, just a way of solving.
 A: $(\tan x-2y+5)~dx+(\sin2x+(4-y)\cos^2x)~dy=0$
$(\tan x+5-2y)~dx=((y-4)\cos^2x-2\sin x\cos x)~dy$
$(y-4-2\tan x)\dfrac{dy}{dx}=\sec^2x\tan x+5\sec^2x-2y\sec^2x$
This belongs to an Abel equation of the second kind.
Let $u=y-4-2\tan x$ ,
Then $y=u+2\tan x+4$
$\dfrac{dy}{dx}=\dfrac{du}{dx}+2\sec^2x$
$\therefore u\left(\dfrac{du}{dx}+2\sec^2x\right)=\sec^2x\tan x+5\sec^2x-2(u+2\tan x+4)\sec^2x$
$u\dfrac{du}{dx}+2u\sec^2x=-2u\sec^2x-3(\tan x+1)\sec^2x$
$u\dfrac{du}{dx}=-4u\sec^2x-3(\tan x+1)\sec^2x$
Let $t=\tan x$ ,
Then $\dfrac{du}{dx}=\dfrac{du}{dt}\dfrac{dt}{dx}=\sec^2x\dfrac{du}{dt}$
$\therefore u\sec^2x\dfrac{du}{dt}=-4u\sec^2x-3(\tan x+1)\sec^2x$
$u\dfrac{du}{dt}=-4u-3(\tan x+1)$
$u\dfrac{du}{dt}=-4u-3(t+1)$
$\dfrac{du}{dt}=-4-\dfrac{3(t+1)}{u}$
Luckily this becomes a first-order homogeneous ODE.
Let $v=\dfrac{u}{t+1}$ ,
Then $u=(t+1)v$
$\dfrac{du}{dt}=(t+1)\dfrac{dv}{dt}+v$
$\therefore(t+1)\dfrac{dv}{dt}+v=-4-\dfrac{3}{v}$
$(t+1)\dfrac{dv}{dt}=-v-4-\dfrac{3}{v}$
$(t+1)\dfrac{dv}{dt}=-\dfrac{v^2+4v+3}{v}$
$\dfrac{v}{(v+3)(v+1)}~dv=-\dfrac{dt}{t+1}$
$\int\left(\dfrac{3}{2(v+3)}-\dfrac{1}{2(v+1)}\right)~dv=-\int\dfrac{dt}{t+1}$
$\dfrac{3\ln(v+3)-\ln(v+1)}{2}=-\ln(t+1)+c$
$(v+3)^3(t+1)^2=C(v+1)$
$\left(\dfrac{u}{t+1}+3\right)^3(t+1)^2=C\left(\dfrac{u}{t+1}+1\right)$
$(u+3t+3)^3(t+1)^2=C(u+t+1)$
$(y+\tan x-1)^3(\tan x+1)^2=C(y-\tan x-3)$
