How to arrange this equation to find the solution to this exact differential equation? Is there any rule for simplifying equations of this type, because I tried separating the variables and it doesn't work:
$x {\operatorname{d}\!y\over\operatorname{d}\!x} =2xe^x - y + 6x^2$
 A: $$xdy=2xe^xdx-ydx+6x^2dx$$
$$xdy+ydx=2xe^xdx+6x^2dx$$
$$(xy)'=2xe^xdx+6x^2dx$$
A: The homogeneous equation is
$$xy'+y=0$$ which is separable, and has the general solution $y=\dfrac cx$.
Then by the method of varation of constants, you solve
$$x\left(\frac cx\right)'+\frac cx=c'-\frac cx+\frac cx=2xe^x+6x^2.$$
A: I would say
$P(x,y)dx+Q(x,y)dy = (2xe^x-y+6x^2)dx -xdy$
$\frac{\partial P}{\partial x}=-1, \frac{\partial Q}{\partial x}=-1 \Rightarrow $ the equation is really exact $\Rightarrow$ the integrating factor is not to be :
$\Rightarrow $ simply directly integrate differential $\int P(x,y)dx+Q(x,y)dy $  
$\Rightarrow$ solution: $\displaystyle \int \left( (2xe^x-y+6x^2)dx -xdy\right) = \cdots = -2x^3+xy-2e^x(x-1)=C$
A: $\newcommand{\bbx}[1]{\,\bbox[8px,border:1px groove navy]{{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$

With $\ds{x \equiv \expo{t}}$:

\begin{align}
\totald{}{t} &= \totald{x}{t}\totald{}{x} = x\,\totald{}{x}\implies
\totald{y}{t} + y = \mrm{f}\pars{t} = 2\expo{t}\exp\pars{\expo{t}} + 6\expo{2t}
\\[5mm]
\totald{\pars{\expo{t}y}}{t} & = \expo{t}\mrm{f}\pars{t}\implies
\expo{t}y = \mbox{C} + \int\expo{t}\mrm{f}\pars{t}\,\dd t =
\mbox{C} + \int\pars{2x\expo{x} + 6x^{2}}\,\dd x
\end{align}
$$\bbx{%
xy = \mbox{C} + \int\pars{2x\expo{x} + 6x^{2}}\,\dd x}\,,\qquad
C:\ \mbox{constant}
$$
