Solving differential equation using an integrating factor

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$$

• Do you mean $\cos(xe^x)$ or $\cos(x)e^x$? – callculus Mar 17 at 5:19
• @callculus its $e^x \cos x$ – Aryadeva Mar 17 at 5:55
• Look at the line where OP multiplied the DE with integrating factor @callculus – Aryadeva Mar 17 at 6:00
• @LostInSpace Good catch. – callculus Mar 17 at 6:01
• lol @callculus Thank you ..... – Aryadeva Mar 17 at 6:01

Let it be $$Mdx+Ndy=0, M=\cos x e^x+xy+4y^2-y, N=-x-8y$$ so Here $$\frac {\partial M}{\partial y}=x+8y-1, \frac{\partial N}{\partial x}=-1=$$ Integrating factor $$\mu(x)= \exp ~[\int \frac{[\frac{\partial M}{\partial y}-\frac{\partial N}{\partial x}] dx}{N}] =e^{-x}$$ So the soluytion of the ODE can be written as $$\int e^{-x} (\cos x e^x+xy+4y^2-y) dx \text{[treat y as constant]}+ \int 0 dy=C$$ $$\implies \sin x-e^{-x}y(x+4y)=C$$
$$(\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$$