All linear first order differential equations are of that form. Let's do a simpler example to illustrate what happens. Suppose we want to solve
$$y' + xy = 0.$$
Naturally, you would isolate $x$ and $y$ to get
$$\frac{y'}{y} = -x.$$
However we can recognize that $\dfrac{y'}{y}$ is nothing more than $\dfrac{d}{dx}\log|y(x)|$. (Check this via chain rule.) Then want we really want to solve is
$$\frac{d}{dx}\log|y(x)| = -x.$$
Since we know how to integrate, let's integrate both sides to get
$$\log|y(x)| = -\frac{x^2}{2}+C.$$
Exponentiating gives
$$|y(x)| = e^Ce^{-\frac{x^2}{2}}.$$
But since $e^{-\frac{x^2}{2}}$ is always positive, the $y$ must always be positive or negative so we can drop the absolute value (and incorporate it into the constant) so that our solution is actually $y(x) = C\exp\left(-\frac{x^2}{2}\right)$ (where we have rewritten $\text{sgn}(y)e^C$ as simply $C$ since we only care about the overall constant). That took quite a bit of work to do but let's see what happens when we plug our solution back into the equation. Firstly, $y'(x) = -Cx\exp\left(-\frac{x^2}{2}\right)$ (again, verify this). Substituting, we get
$$y'+xy \Longrightarrow -Cxe^{-\frac{x^2}{2}} + Cxe^{-\frac{x^2}{2}} = 0.$$
We found the solution! Our solution then looks like $Ce^{-\int x dx}$ which seems to mimic the $e^{\int P(x)dx}$ term you have written to a degree (but the sign is backwards). Let's investigate further to see what the actual situation is.
Notice I could have replaced $x$ with any function, call it $P(x)$ and we could have done the same thing. The only change would have been $\dfrac{d}{dx}\log|y(x)| = -P(x)$. If you solve this, you would get that
$$y(x) = Ce^{-\int P(x)dx}.\tag{1}$$
Before moving to the most general setting, let's try this integrating factor trick to see what happens. Let's haphazardly multiply our differential equation by $e^{\int P(x)dx}$ and see what happens. Well we would get
$$e^{\int P(x)dx}y' + P(x)e^{\int P(x) dx}y = 0.\tag{2}$$
However this form is very compelling. We can see that the following is true:
$$\left(e^{\int P(x) dx}y\right)' = e^{\int P(x)dx}y' + P(x)e^{\int P(x) dx}y = 0.$$
This says that $(2)$ is equivalent to the expression
$$\left(e^{\int P(x) dx}y\right)' = 0.$$
But we know how to find the solution now! Since the derivative of the term in parentheses is $0$, it has to be constant, which tells us that $e^{\int P(x)dx}y = C$, or $y(x) = Ce^{-\int P(x)dx}$. This corresponds exactly with what we got before.
With this in mind, let's look at the general equation you have: $y' + P(x)y = Q(x)$. Let's take cues from the case we just looked at and let's multiply everything by $e^{\int P(x)dx}$ (note the similarity to equation $(1)$..) and see what happens. We get
$$e^{\int P(x)dx} y' + P(x)e^{\int P(x)dx}y = e^{\int P(x)dx}Q(x).$$
You can see that this looks eerily similar to what we had before (and this is not by accident). From what we did before, we can rewrite the entire left side as simply
$$\left(e^{\int P(x)dx}y\right)' = e^{\int P(x)dx}Q(x).$$
This is almost a solution! All you then have to do is integrate both sides and then divide by $e^{\int P(x)dx}$ to get $y$ as a function of $x$.
(Note that the full, general solution also includes the solution $y =C e^{-\int P(x)dx}$.)
Here's an example:
$$y' + xy = x.$$
Doing our integrating factor trick, we would multiply both sides by $e^{\int x dx} = e^{\frac{x^2}{2}}$. Doing so, we get
$$\left(e^{\frac{x^2}{2}}y\right)' = xe^{\frac{x^2}{2}}.$$
If we integrate both sides, we get
$$e^{\frac{x^2}{2}}y = \int xe^{\frac{x^2}{2}}dx \stackrel{\text{chain rule}}{=} C + e^{\frac{x^2}{2}}.$$
Dividing both sides by $e^{\frac{x^2}{2}}$, we get that $y = Ce^{-\frac{x^2}{2}}+1$ which you can check by plugging back into the initial differential equation to verify. The piece $Ce^{-\frac{x^2}{2}}$ we can recognize as the solution to the "homogeneous" case (when $Q = 0$) that we did up above. So this technique, when done correctly, gives you the full solution all the time.
Best Answer
$$y'e^x + e^xy =xy^3e^x$$ Then make it separable: $$(ye^x)' =xy^3e^x$$ $$\dfrac {d(ye^x)}{y^3e^{3x}} =xe^{-2x}dx$$ And integrate: $$\int \dfrac {d(ye^x)}{(ye^{x})^3} =\int xe^{-2x}dx$$ Otherwise you can't evaluate the integral: $$I=\int y^3xe^xdx$$ Because $y$ is not a constant but a function of the variable $x$.