Let

(a)y=ax,a>0.

Taking the natural logarithm (= logarithm to the base e) of both sides, we get
lny=xlna
or
x=lnylna=1lnalny.
Differentiating with respect to y, we get
(b)dxdy=1lna1y.
It follows from the Derivative Rule for Inverses that
dydx=lnay or dydx=lnaax. Hence, (c)ddxax=lnaax. When a=e, lna=lne=1, and the formula becomes (d)ddxex=ex.

Now consider y=uv, where u and v are functions of x. To find y, we take natural logarithm of both sides:

lny=vlnu

Now we can use logarithmic differentiation or write the above equation as

y=evlnu,

and then apply (d) and the chain rule:

dydx=evlnuddx(vlnu)=uv[dvdxlnu+vddxlnu]=uv[dvdxlnu+v(ddulnududx)]=uv[dvdxlnu+v(1ududx)]=lnuuvdvdx+vuv1dudx.

Hence, (e)ddxuv=lnuuvdvdx+vuv1dudx

The derivative of a function with a variable exponent is equal to the sum of the two results obtained by first differentiating, regarding the exponent as constant, and again differentiating regarding the function as constant.

Example 1
If y=a3x2, where a is a constant, find dy/dx.
Solution
Placing v=3x2, and using (c) and the chain rule, we have dydx=dydvdvdx=lnaavdvdx=lnaa3x2ddx(3x2)=6xlnaa3x2.
Example 2
Differentiate y=bec2+x2 with respect to x.
Solution
Let v=c2+x2. Using (c) and the chain rule, we have dydx=dydvdvdx=bec2+x2ddx(c2+x2)=2bxec2+x2.
Example 3
Differentiate y=x(ex) with respect to x.
Solution
Method (a): Let u=x and v=ex. Now using (e), we get dydx=lnxx(ex)ddx(ex)+exx(ex1)ddx(x)=lnxexx(ex)+exx(ex1)1=exx(ex)(lnx+1x). Method (b): Taking natural logarithm of both sides: lny=lnx(ex)=exlnx Now we can differentiate both sides: 1ydydx=dexdxlnx+ex(ddxlnx)=exlnx+ex1x [Recall that (uv)=uv+uv and (lnx)=1/x.] Multiplying both sides by y yields dydx=y=x(ex)(exlnx+exx)=x(ex)ex(lnx+1x).
Example 4
Find dy/dx if y=(x2x2+1)sinx.
Solution
Method (a): We may use formula (e). Here u=x2/x2+1 and v=sinx. Therefore, dydx=(lnx2x2+1)(x2x2+1)sinxcosx +sinx(x2x2+1)sinx1(2xx2+1x2(2x)2x2+1x2+1)=(lnx2x2+1)(x2x2+1)sinxcosx +sinx(x2x2+1)sinx1(2xx2+1x3(x2+1)32).

Method (b): Let y=(x2x2+1)sinx. Then take the natural logarithm of both sides lny=ln[(x2x2+1)sinx]=sinxlnx2x2+1=sinx[lnx2lnx2+1]=sinx[2lnx12ln(x2+1)] Now differentiate both sides yy=cosx[2lnx12ln(x2+1)]+sinx[2x12(x2+1)ddx(x2+1)]=cosx[lnx2x2+1]+sinx[2xxx2+1]. So y=y(cosx[lnx2x2+1]+sinx[2xxx2+1])=(x2x2+1)sinxcosx lnx2x2+1 +(x2x2+1)sinxsinx [2xxx2+1].

The result of the second method is actually the same as the result of the first method; we just need to notice that (x2x2+1)sinxsinx [2xxx2+1]=(x2x2+1)sinxsinx [2xxx2+1](x2x2+1x2x2+1)=sinx(x2x2+1)sinx1[2x2xx2+1x3(x2+1)3/2]