There are two ways you can take the derivative of a^x.
1)
Let y = a^x now we're trying to find dy/dx
2)
ln(y) = xln(a) take logs of both sides and use log rules
3)
(dy/dx)*(1/y) = ln(a) take the derivative of both sides using the chain rule on the left hand side.
4)
dy/dx = ln(a)*y multiply both sides by y
5)
dy/dx = ln(a) *a^x realise y= a^x and replace it
Now we're done!
Alternatively we could realise that any exponent can be written as e to the power of something with a log in it.
So
1)
y = a^x = (e^ln(a))^x just rewritting 'a'
2)
y = e^xln(a) multiplying exponent rule
3)
dy/dx = ln(a)*e^xln(a) take the derivative of both sides using the chain rule for the right hand side
4)
dy/dx = ln(a)*a^x substitute back to get desired result