How to solve this exponential equation? I'm given this equation and i have to solve for the x.

$$ e^{2x} -(e^5 + e^2)e^x + e^7 = 0      $$

The results should be $x =2$ and $x = 5$. 

At first i thought it would be an easy task, substituting $e^x$ with $y$, but I can't get rid of the coefficients. I'm sorry if this question is too simple for this site but I'd be really grateful if you could explain me. Thanks for your kindness.
You can make $e^{2x}-(e^2+e^5)e^x+e^7=(e^x-e^2)(e^x-e^5)=0$. So we have the result.
We have $$e^{2x}-(e^5+e^2)e^x+e^7=0$$ $$(e^{x})^2-(e^5+e^2)e^x+e^7=0$$ Now, solving above quadratic equation for $e^{x}$ $$e^x=\frac{-(-(e^5+e^2))\pm\sqrt{(e^5+e^2)^2-4(1)(e^7)}}{2\cdot 1}$$ $$=\frac{(e^5+e^2)\pm\sqrt{(e^5+e^2)^2-4(1)(e^7)}}{2\cdot 1}$$ $$=\frac{e^2(e^3+1)\pm e^2\sqrt{e^6+1-2e^3}}{2}=\frac{e^2(e^3+1)\pm e^2\sqrt{(e^3-1)^2}}{2}$$ $$=\frac{e^2(e^3+1)\pm e^2(e^3-1)}{2}$$ $\color{red}{\text{Taking positive sign}}$ $$e^x=\frac{e^2(e^3+1)+ e^2(e^3-1)}{2}=\frac{2e^5}{2}=e^5\iff x=5$$ $\color{red}{\text{Taking negative sign}}$ $$e^x=\frac{e^2(e^3+1)- e^2(e^3-1)}{2}=\frac{2e^2}{2}=e^2\iff x=2$$ Hence, we have two values of $x$ given as $$\bbox[5px, border:2px solid #C0A000]{\color{red}{x=2\ \text {&amp;}\ x=5}}$$