Maxima of sum of exponential. I want to find the maxima of $f=e^{-x}+e^{-2x}$, $x \ge 0$. I know the maximum happens at $x=0$, however when I differentiate and equate to zero I get : $\,e^{x}=-2$ which leads to $x=\ln(-2)$. Can any one point why the differentiation method doesn't lead to the correct answer? 
 A: Note that $$f'(x)=-e^{-x}-2e^{-2x}=-e^{-2x}(e^x+2)=-\frac{e^x+2}{e^{2x}}$$ is negative for all $x$ in the domain of definition of $f$, so $f$ is strictly decreasing. Then $f$ has a maximum precisely if its given domain of definition has a least element, in this case $0$.
We can only use the first derivative test (setting the first derivative equal to $0$ and solving) at points on the interior of the domain of definition. Indeed, your work shows that $f$ has no maximum on the positive numbers. However, if we look to the single boundary point of the domain of definition (namely $x=0$), we can manually show that $f$ has a maximum there (using an argument like the one I gave above). We simply can't apply the first derivative test there, and this example is an excellent reason why.
More generally, suppose $D\subseteq\Bbb R$, and that $g:D\to\Bbb R$ is a function that is differentiable in the interior of $D$ and continuous on $D$. Then if $g$ obtains a maximum, it will be either at a critical point in the interior of $D$, or at a point on the boundary of $D$.
A: Let $f(x)= e^{-x}+e^{-2x}$ then 
$$
f'(x)=-e^{-x}-2e^{-2x}=-e^{-x}( 1+2e^{-x})=0 
$$
implies 
$
( 1+2e^{-x})=0
$ or $
e^{-x}=0
$. But it's impossible.  Then $f(x)$  doesn't have a minimum in $\mathbb{R}$. And as we know that $f$ is decreasing, $f$ has no minimum in $(0,\infty)$!
