How does differentiation of "more general exponential functions" work As I'm trying to improve my maths I've now reached the subject of differentiation of more general exponential functions.
I've already studied the so called "chain rule".
Now, my book tells me:
$$y=a^x \rightarrow y^{\prime}=a^x\ln(a)$$
Then, there's the following function:
$$f(x) = 10^{-x}$$
Applying the above rule, this would lead me to believe that 
$$f^{\prime}(x) = 10^{-x} \ln(10)$$
However, the book tells me it's
$$f^{\prime}(x) = -10^{-x} \ln(10)$$
Why's that? They say they also used the chain rule, but if I use the chain rule I get something totally different:
$$f(x) = 10^{-x}$$
$$f^{\prime}(x) = -x(10)^{-x-1}\cdot(-1*1)$$
$$f^{\prime}(x) = x(10)^{-x-1}$$
What am I doing wrong in all these cases?
 A: Let $N: \mathbb{R} \to \mathbb{R}$ be the negation function, i.e. $N(x) = -x$ and let $g(x) = 10^x$. Then it should be clear that your $f = g \circ N$.
$f'(x) = (g \circ N)'(x) = g'(N(x))N'(x) = \log 10 \cdot 10^{-x} \cdot (-1)$
PS: Learn to use $\LaTeX$ instead of code. It takes up less space and looks prettier.
A: The biggest problem here is that you seem to be confusing the chain rule with the power rule.
The power rule is as follows: Suppose you have some real number $n$. Then the function $f(x) =x^n$ has derivative $f'(x)=n\cdot x^{n-1}$. Notice that $n$ is fixed, but $x$ is variable. 
The chain rule is as follows: Given functions $f$ and $g$, the function $h(x)=(f\circ g)(x) = f(g(x))$ has derivative $h'(x)= (f'\circ g)(x)\cdot g'(x)= f'(g(x))\cdot g'(x)$.  
Now, the function you have is $f(x)=10^{-x}$. In this case, your exponent is variable, but $10$, obviously, is fixed. So the power rule does not apply; that is, we cannot simply bring down the exponent, multiply, and subtract one from the exponent, which is part of what you did in your work. 
Also, given an exponential function $g(x)=a^x$, the derivative is $g'(x)=a^x\cdot\ln{(a)}$. So why does this rule not apply directly to the function $f(x)=10^{-x}$? Well, notice that the exponent in your $f$ is actually itself a function, namely, $-x$. The exponent in the rule from your book is merely $x$. That's why we have to apply the chain rule; we technically have a function "inside" another function. From here, follow kahen's solution above.
I again want to emphasize that the power rule is not applied to your $f$ because $f$ is exponential: it has a fixed base of $10$ and a variable exponent $-x$ (which is also a function).
Lastly, I should note that the power rule and chain rule as I have written them are neither rigorous nor precise, but I sacrificed details for readability. 
