How to find $y$ from $y' = e^{2x}-e^x y$? The problem asks me to find $y(x)$ from the equation
$$y' = e^{2x}-e^x y$$
The $y'$ is $dy/dx$ right, so wouldn't the correct step be to integrate right away? If not, should I change some terms before integrating? I'm fairly new to this, and am unaware of rules so please be clear in explanation, thank you very much.
 A: You can use the method of integrating factors. First write
$$y' + e^x y = e^{2x}.$$
An integrating factor for the equation is $\exp(\int e^x\, dx) = e^{e^x}$. So we multiply both sides by $e^{e^x}$.
$$e^{e^x}y' + e^x e^{e^x}y = e^{2x}e^{e^x}.$$
The left hand side is $(e^{e^x} y)'$. So 
$$(e^{e^x}y)' = e^{2x}e^{e^x}.$$
By integration,
$$e^{e^x} y = \int e^{2x} e^{e^x}\, dx + c,$$
where $c$ is a constant. Let $u = e^x$. Then $du = e^x\, dx$, thus
$$\int e^{2x}e^{e^x}\, dt = \int e^x e^{e^x} e^x\, dx = \int ue^u\, du = (u - 1)e^u + c' = (e^x - 1)e^{e^x} + c',$$
where $c'$ is constant. Hence
$$e^{e^x}y = (e^x - 1)e^{e^x} + C,$$
where $C$ is a constant. So 
$$y = e^x - 1 + Ce^{-e^x}.$$
A: this is a non homogeneous differential equation. we can rewrite is as 
$$\frac{dy}{dx} + e^x y = e^{2x} $$ the integrating factor turns out to be $e^{e^x}$ so multiplying by it we get 
$$ e^{2x+e^x}=e^{e^x}\left(\frac{dy}{dx} + e^x y\right) = \frac{d}{dx}\left(e^{e^x}y\right) $$ integrating this give you 
$$ e^{e^x}y = \int e^{2x+e^x} \, dx$$
$\bf edit:$ here is how i found the integration factor of $$\frac{dy}{dx} + e^x y = f$$  you are looking for a function $a$ such that $$a\frac{dy}{dx} + ae^x y $$ will be an exact differential $$\frac{d}{dx} \left(ay\right) = a \frac{dy}{dx} + y\frac{da}{dx} $$ that is you want $a$ to satisfy $$ \frac{da}{dx} = ae^x.$$
