Derive the solution of the linear differential equation: $\frac {dy}{dx} + P(x) \cdot y=Q(x)$
Rewriting the given differential equation, we obtain: $(Py-Q) dx+1 \cdot dy=0$.
Let $M=Py-Q, N=1$. Then : $\dfrac {\partial M }{\partial y}=M_y=P$
and $\dfrac {\partial N}{\partial x}=N_x=0$.
Thus $\dfrac{M_y-N_x}{N}=P(x)$. Thus, the integrating factor is $I.F= e^{\int P dx}$. Therefore $e^{\int P dx}(Py-Q) dx+e^{\int P dx} \cdot dy=0$ is an exact differential equation.
The solution of this exact differential equation is $\int_{\text {treat y as constant} } M dx + \int \text{terms in N not containing x}~~ dy= $ constant
$\implies \int e^{\int P dx}(Py-Q)~ dx + 0=c$
$\implies y \int P~ e^{\int P dx}~dx = \int e^{\int P dx} Q ~dx + c.~$ But the solution of the differential equation in almost every textbook is given as $\implies y e^{\int P dx}~dx = \int e^{\int P dx} Q ~dx + c$
What is the error in the above steps. Thanks a lot for your help.