# How to do calculus with $a^x$

Every time you’re asked to differentiate $a^x$ and you say $xa^{x-1}$, a kitten dies. A kitten that had been raised lovingly by an orphan, her only friend in the whole wide word - DEAD, just because you couldn’t be bothered to learn how to do calculus properly. I hope the image of tears streaming down the poor orphan’s little face haunts you forever, you cruel, heartless - yes, I’d go so far as to say vindictive - bastard.

Repeat after me: you cannot (easily) do calculus with $a^x$ as it stands. $e^x$, yes, easy. $x^n$, yes, that’s easy too. But $a^x$ - any number to the power of $x$ - that’s tricky.

There’s a simple trick to turn it into something you can work with, though. Here are the steps:

- You know from C2 that a is the same thing as $e^{\ln (a)}$.
- You know from C1 that $(a^b)^c = a^{bc}$.
- So $a^x$ is $e^{x \ln (a)}$. You can see that, right? Take a moment - it follows from 1 and 2.
- $\ln(a)$ is just a number, so when you differentiate, you multiply by it; when you integrate, you divide.
**The derivative of $e^{x \ln (a)}$ is $(\ln (a)) e^{x \ln(a)}$ - or even better, $(a^x) \ln (a)$.****The integral of $e^{x \ln(a)}$ is $\frac{e^{x \ln (a)}}{ \ln (a)}$ - or $\frac{1}{\ln(a)} a^x$**

Just… learn these things. They don’t come up all that often, but when they do… well. Just learn them.

Or else the bereaved orphan kitten-owners of the world with wreak their tearful, bloody revenge on you - and we don’t want that to happen now, do we?

No animals were harmed during the production of this article. Honestly.

(Image from tachyondecay used under a CC-BY licence.)