# Technology Musings

### General / The derivative of u^v

JB

I don't know why this isn't listed as a standard rule.  The differential of the exponent function, u^v (u raised to the v power), is pretty basic, and you can use it to formulate the other exponent rules for differentiation. However, for some reason it seems to be left off of most rules for differentiation.

The basic rule is this:

`d(u^v) = v*u^(v-1)*du + u^v*ln(u)*dv`

This can be clearly seen to be a more general form of u^n, because if n is a constant, this becomes:

`d(u^n) = n*u^(n - 1)*du + u^v*ln(u)*0`

And that zero drops it to the rule we all know and love:

`d(u^n) = n*u^(n - 1)*du`

This can be derived as follows:

`z = u^vln(z) = ln(u^v)`

Using log rules, we get:

`ln(z) = v*ln(u)`

Now take the differential of both sides:

`d(ln(z) = d(v*ln(u))`

Differentiating both sides, we get:

`dz/z = v*du/u + ln(u) * dv`

Then we multiply by z:

`dz = z*v*du/u + z * ln(u) * dv`

Substituting in z = u^v:

`dz = u^v * v * du / u + u^v * ln(u) * dv`

Now, u^v/u simplifies to u^(v-1), giving us:

`dz = v*u^(v-1)*du + u^v*ln(u)*dv`

Since z = u^v, dz = d(u^v), so

`d(u^v) = v*u^(v-1)*du + u^v*ln(u)*dv`

### General / Explanation of Liebniz Notation of the Second Derivative

#### JB

The notation for the second (and higher) derivatives in Liebniz notation has always troubled me.  The second derivative is usually notated as d^y/dx^2.  And I always wondered, why is the the 2 in relation to the d on the top, but in relation to the whole term on the bottom?

This puzzled me for a while, and I looked through at least 10 Calculus textbooks to find the answer, all to no avail.  Finally, I put pen to paper and figured it out.  The answer was straightforward, and I am sure that whoever invented the 2nd derivative Liebniz notation knew why they did it that way, it's just that every Calculus book since then seems to have forgotton.

Anyway, the usual notation for the derivative operation id d/dx.  I eventually came to realize that this is not a single operation, but TWO operations in one.  The first is to take the differential (not derivative) of the equation.  For that, I mean, let's say you have the equation y = 2x.  The differential of that equation is dy = 2xdx.  Doing a differential instead of a derivative is powerful, because it allows a more natural approach to both implicit differentiation and multivariable differentiation.

Now, the derivative is simply the differential divided by dx.  So, if our differential is dy = 2xdx, then when we divide by dx we get our normal notation dy/dx = 2x.

Now, let's leave off dividing by dx, and just look at the differential.  What happens if we take a second differential?

In this case, we have to treat dy as a separate variable.  So, if the differential of y is dy, what is the differential of dy?  This is where the d^2y comes in.  The 2 is by the "d" not because it is "d squared", but it is "d applied twice".  So, if we take our initial differential dy = 2xdx and take another differential, what do we have?

By the product rule, we get:

d^2y = 2((x)(d^2x) + (dx)(dx))

Now, since we want the second derivative, we divide both sides by dx twice (once for the first derivative, and once for the second), which is the same as dividing by dx^2.

That gives us:

d^2y / dx^2 = 2((x)(d^2x) + (dx)(dx)) / dx^2

The (dx)(dx) simplifies to dx^2, and we can separate this out at the plus sign to give us:

d^2y / dx^2 = 2(x)(d^2x)/dx^2 + 2(dx^2)/dx^2

This further simplifies to:

d^2y / dx^2 = 2(x)(d^2x)/dx^2 + 2

Now, we know that the second derivative is 2, so that means that 2(x)(d^2x)/dx^2 must equal zero.  But why?

Well, let's rewrite this term a little:

2x * (d^2x)/(dx^2)

d^2x/dx^2 is simply the second derivative of x with respect to itself!

To understand why this must be zero, first imagine the first derivative of x with respect to itself: dx/dx

This must always be 1!  Another way of stating this is that "for every change in x, the corresponding change in x is equivalent", which seems obvious.

Now, 1 is a constant, so the second derivative must be zero!  This zeroes out the whole term, leaving:

d^2y/dx^2 = 2

Thus, we have the notation of the derivative from first principles.

Another way to look at this is to use the quotient rule.

If we start with dy/dx, then take the differential, what do we get?

((dx)(d^2y) - (dy)(d^2x)) / dx^2

If we separate, we get:

(dx)(d^2y) / dx^2 - (dy)(d^2x)/dx^2

The first term simplifies to d^2y / dx.  The second term is our second derivative of x with respect to itself again, so it becomes (dy)*0, giving us:

d^2y/dx - (dy)*0

Which gives us just

d^2y/dx

Now, the second step of the derivative is to divide by dx.  Doing so gives us:

d^2y/dx^2

Which is our second derivative!