Use the exponential and logarithm functions to rewrite
[tex]y=a^x=e^{\ln a^x}=e^{x\ln a}[/tex]
Then by the chain rule,
[tex]\dfrac{\mathrm dy}{\mathrm dx}=e^{x\ln a}\dfrac{\mathrm d(x\ln a)}{\mathrm dx}=e^{x\ln a}\ln a=a^x\ln a[/tex]
[tex]\dfrac{\mathrm d^2y}{\mathrm dx}=e^{x\ln a}\ln a\dfrac{\mathrm d(x\ln a)}{\mathrm dx}=e^{x\ln a}(\ln a)^2=a^x(\ln a)^2[/tex]
and so on, with
[tex]\dfrac{\mathrm d^ny}{\mathrm dx^n}=a^x(\ln a)^n[/tex]