TITLE: Solution to a non-exact ODE
QUESTION [1 upvotes]: The ODE I want to solve is 
$$ \cos(x) dx + (4ye^{-y} + \sin(x)) dy = 0 $$
with the initial value $ y( \pi )= 0 $
The ODE is not exact because
$P(x,y)= \cos(x) $
$\frac{\partial P(x,y) }{ \partial y} =0 $
and 
$Q(x,y)= 4ye^{-y} + \sin(x) $
$\frac{\partial Q(x,y) }{ \partial x} =\cos(x) $
So I need an integrable factor $M$:
 $$ \frac{ \partial}{ \partial y}[ M( \cos(x) )]= \frac{ \partial }{ \partial x} [M(4ye^{-y}+ \sin(x)] $$
$$\leftrightarrow M \cos(x) = \frac{ \partial M}{ \partial y} \cos(x) - \frac{ \partial M }{ \partial x} (4ye^{-y}+ \sin(x)$$
I choose  $ \frac{ \partial M }{ \partial x}=0 $
So it comes to 
$M \cos(x) = \frac{ \partial M }{ \partial y} \cos(x) \leftrightarrow M'=M \rightarrow M(y)= e^y + c$
So it comes to the exact ODE
$$ \cos(x) e^y dx +( 4e^ye^{-y}+ \sin(x) e^y) dy =0 $$
Integration leads to
$$ \int \cos(x) e^y dx= e^y \sin(x) + c \\ \int 4+ \sin(x)e^y dy = \sin(x)e^y+4y+c $$
So I can choose $ F(x,y)= \sin(x)e^y+4y $
Is this right so far?
How do I solve it with the initial values?

REPLY [0 votes]: $$\cos(x) dx + (4ye^{-y} + \sin(x)) dy = 0$$
$$d\sin x + \sin(x)dy+ 4ye^{-y}dy  = 0$$
Multiply by $e^y$:
$$(e^yd\sin x + \sin(x)de^y)+4ydy = 0$$
$$(de^y\sin x) + 2dy^2  = 0$$
Integration gives:
$$e^y \sin x +2y^2=C$$
You made a little mistake for $y$. You wrote:
$$ \int 4+ \sin(x)e^y dy = \sin(x)e^y+4y+c$$
It should be:
$$\int \color{red}{4y}+ \sin(x)e^y dy = \sin(x)e^y+\color{red}{2y^2}+c$$
{"set_name": "stack_exchange", "score": 1, "question_id": 3682401}