TITLE: Solving $xe^{-x}+2e^{-x}=0$
QUESTION [5 upvotes]: While I was studying my maths book, I came across this equation:
$$
xe^{-x}+2e^{-x}=0
$$
I tried to solve it in different ways, but each time I break up some rule. My best try was this:
Let's $u=e^{-x}$, thus we have:
$$
xu+2u=0
$$
By taking $u$ as a common factor we get:
$$
u(x+2)=0
$$
By dividing both side by $(x+2)$ we get:
$$
u=0
$$
But $u=e^{-x}$, then:
$$
e^{-x}=0 \\
ln(e^{-x}) = ln(0) ??
$$
$ln(0)$ is obviously wrong, where did I slip?

REPLY [10 votes]: When you divide by $x+2$ how do you know $x+2\neq 0$? Indeed you don't! 
Thats why you should get $u=0$ or $x+2=0$. The first equation has no solutions as $u=e^{-x}>0$. The second gives $x=-2$. 
You write $e^{-x}=0$. This equation has no solutions. But you can't write $\ln (e^{-x})=\ln (0)$!!!! This is because $\ln (0)$ is not defined!

REPLY [9 votes]: If $xe^{-x}+2e^{-x}=0$, then divide across by $e^{-x}$ (which is non-zero) to get $x+2=0$, which has the solution $x=-2$.

REPLY [2 votes]: $a\cdot b=0\implies a=0\text{ or }b=0$ so $u=0\text{ or }x+2=0$.
You deduced $u\neq0$ hence $x+2=0$. That is $x=-2$