TITLE: What do you get when you differentiate a $e^{f(x)}$-like function
QUESTION [5 upvotes]: I need help with exponential functions. I know that the derivative of $e^x$ is $e^x$, but wolfram alpha shows a different answer to my function below. If you, for example, take the derivative of $e^{-2x}$ do you get $-2e^{-2x}$ or $e^{-2x}$?

REPLY [9 votes]: You have to apply the chain rule: if $f(x)$ is a differentiable function then the derivative of $e^{f(x)}$ is $f'(x)e^{f(x)}$.

REPLY [3 votes]: You have to use the chain rule here. Writing $f(x) = e^x$ and $g(x) = -2x$ we have $h(x) := f(g(x)) = e^{-2x}$, hence by the chain rule
$$ h'(x) = f'(g(x))g'(x) $$
Now $f'(x) = e^x$, hence $f'(g(x)) = e^{-2x}$, and $g'(x) = -2$, this gives
$$ h'(x) = f'(g(x))g'(x) = e^{-2x} \cdot (-2) = -2e^{-2x} $$