Solve the differential equation $(2x^3y+4x^3-12xy^2+3y^2-xe^y+e^{2x})dy+(12x^2y+2xy^2+4x^3-4y^3+2ye^{2x}-e^y)dx=0.$
I tried solving the problem like this:
We assume $M=(12x^2y+2xy^2+4x^3-4y^3+2ye^{2x}-e^y)$ and $N=(2x^3y+4x^3-12xy^2+3y^2-xe^y+e^{2x}).$ Now, we observe, $\frac{\partial M}{\partial y}=12x^2+4xy-12y^2+2e^{2x}-e^y$ and $\frac{\partial N}{\partial x}=6x^2y+12x^2-12y^2-e^y+2e^{2x}.$ We find, that if we considered $M=12x^2y+4x^3-4y^3+2ye^{2x}-e^y$ and $N=4x^3-12xy^2+3y^2-xe^y+e^{2x}$ then $\frac{\partial M}{\partial y}=12x^2-12y^2+2e^{2x}-e^y=\frac{\partial N}{\partial x}.$ So, we consider or rather write the given equation, as $(12x^2y+4x^3-4y^3+2ye^{2x}-e^y)dx+(4x^3-12xy^2+3y^2-xe^y+e^{2x})dy+2xy^2dx+2x^3ydy=0.$
Now, we consider the differential equation, $(12x^2y+4x^3-4y^3+2ye^{2x}-e^y)dx+(4x^3-12xy^2+3y^2-xe^y+e^{2x})dy=0.$ This equation is an exact differential equation. The solution is of this differential equation is $$\int (12x^2y+4x^3-4y^3+2ye^{2x}-e^y)dx+\int 3y^2dy=c_1\implies 4x^3y+x^4-4y^3x+ye^{2x}-e^yx+y^3=c_1.$$
Next we try to find the solution of the differential equation, $2xy^2dx+2x^3ydy=0.$ We write this differential equation as $\frac{dy}{dx}=\frac{2xy^2}{2x^3y}=\frac{y}{x^2}\implies \frac{dy}{y}=\frac{dx}{x^2}.$ On integrating, both sides of $\frac{dy}{y}=\frac{dx}{x^2},$ we obtain,
$\int\frac{dy}{y}=\int\frac{dx}{x^2}\implies \log y=-\frac 1x+c_2\implies \log y+\frac 1x=c_2.$
Now, we add the solutions, of both of the differential equation, $(12x^2y+4x^3-4y^3+2ye^{2x}-e^y)dx+(4x^3-12xy^2+3y^2-xe^y+e^{2x})dy=0$ and $2xy^2dx+2x^3ydy=0,$ to get the solution of the given differential equation, $$(2x^3y+4x^3-12xy^2+3y^2-xe^y+e^{2x})dy+(12x^2y+2xy^2+4x^3-4y^3+2ye^{2x}-e^y)dx=0$$ i.e
$$4x^3y+x^4-4y^3x+ye^{2x}-e^yx+y^3+\log y+\frac 1x=c_1+c_2=c.$$ So, the solution of the given differential equation is $4x^3y+x^4-4y^3x+ye^{2x}-e^yx+y^3+\log y+\frac 1x=c.$
It seems, that when I approach the problem like this, we get a solution of the given equation. But is this a legit way? I don't understand, this this way of solving differential equations is justified. Finally, I want to know whether the solution, I calculated is valid or not?
To see that your approach is not valid, let's make things a bit clearer. If you have the differential equation $(P_1+P_2)dx+(Q_1+Q_2)dy=0$, there's no reason that this should imply $P_1\,dx+Q_1\,dy=0$ and $P_2\,dx+Q_2\,dy=0$. The converse is true, yes, if we take the intersection of those solution sets. So you will get a possible solution, but far from the most general solution. You certainly cannot add respective solutions and expect to get a solution.
Just try a simple case: Can you solve $dx-c\,dy=0$ (for $c\ne 0$) by setting $dx=0$ and $c\,dy=0$? Of course not. (Note, in particular, that you completely lose track of the constant $c$.)