# Power rule

The power rule allows one to calculate the derivative of a power of a function in terms of the derivative of the function itself. The power rule states that

$\frac{d}{dx} (x^n) = nx^{n-1}$

for all integers n. This rule is useful when combined with the chain rule. As an example we can compute the derivative of f(x) = (sin(x))n as

$f'(x) = \frac{d}{dx} (\sin(x))^n = n(\sin(x))^{n-1}\cos(x)$

### Proof

The power rule is simple and elegant to prove with the definition of a derivative:

$f'(x) = \lim_{h\rarr0} \frac{f(x+h)-f(x)}{h}.$

Substituting f(x) = xn gives

$f'(x) = \lim_{h\rarr0} \frac{(x+h)^n-x^n}{h}.$

The two polynomials in the numerator can be factored out. It is left as a series, since n can be any integer.

$f'(x) = \lim_{h\rarr0} \frac{((x+h) - x)( (x+h)^{n-1} + (x+h)^{n-2}x + (x+h)^{n-3}x^2 + \dots + (x+h)x^{n-2} + x^{n-1})}{h}.$

Then if the first factor is eliminated:

$f'(x) = \lim_{h\rarr0} \frac{(h)( (x+h)^{n-1} + (x+h)^{n-2}x + (x+h)^{n-3}x^2\dots + (x+h)x^{n-2} + x^{n-1})}{h}.$

Now, the "h" can be eliminated. This is important, since the denominator cannot go to zero':

$f'(x) = \lim_{h\rarr0} (x+h)^{n-1} + (x+h)^{n-2}x + (x+h)^{n-3}x^2\dots + (x+h)x^{n-2} + x^{n-1}.$

With no "h" in the denominator, the limit can be evaluated by letting h=0.

$f'(x) = (x+0)^{n-1} + (x+0)^{n-2}x + (x+0)^{n-3}x^2\dots + (x+0)x^{n-2} + x^{n-1}.$:
$f'(x) = x^{n-1} + x^{n-1} + x^{n-1}\dots + x^{n-1} + x^{n-1}.$

We see that there are n terms, so:

f'(x) = nxn − 1.

QED