Solving differential equation using an integrating factor

ordinary differential equations

The equation is as follows: $$(\cos(x)e^x+xy+4y^2-y)dx+(-x-8y)dy=0$$

I have worked out that it isn't exact and I have worked out the integrating factor to be $e^x$

I have then multiplied the original equation by $e^x$ to get
$$(\cos (x)e^{2x}+xye^x+4y^2e^x-ye^x)dx+(-xe^x-8ye^x)dy=0$$

I am stuck trying to find the solution in terms of $f(x,y)=c$

Best Answer

$$(\cos xe^x+xy+4y^2-y)dx+(-x-8y)dy=0$$ Rearrange some terms: $$\cos xe^xdx-(d(xy)-xydx)+(4y^2dx-8ydy)=0$$ Factor integrating is $e^{-x}$ not $e^x$: $$\cos xdx-d(e^{-x}xy)-e^{-x}(-4y^2dx+8ydy)=0$$ $$\cos xdx-d(e^{-x}xy)-4d(e^{-x}y^2)=0$$ Integrate. $$\sin x-e^{-x}xy-4e^{-x}y^2=C$$