# Differentiation With 'x' Both in Base and in Exponent

1. Jul 12, 2009

### modulus

I have just begun studying differentiaition and I was getting confused with how to differentiate a function of x in which x is in the base and is in the exponent as well (for example, x^2x) with respect to a=hte cahnge in 'x'.
I remember my teacher telling me something about applying log, but, I got kinda drowsy... I wasn't able to learn it properly... now I need help.... hehehe...

2. Jul 12, 2009

### pbandjay

The easiest way that I know how to find this derivative is to re-write:
$$x = e^{\ln(x)}$$

So we have:
$$f(x) = x^{2x} = e^{2x\ln x}$$

$$f'(x) = \dfrac{d}{dx}e^{2x\ln x} = e^{2x\ln x}\dfrac{d}{dx}(2x\ln x) = x^{2x}(\frac{2x}{x} + 2\ln x) = 2x^{2x}(1 + \ln x)$$

Last edited: Jul 12, 2009
3. Jul 12, 2009

### HallsofIvy

to differentiate x2x, write y= x2x and take the natural logarithm of both sides: ln(y)= ln(x2x)= 2x ln(x). Now differentiate both sides. On the left, the derivative of ln(y), with respect to x, is (1/y) y'. On the right, use the product rule: (2x ln(x))'= (2) ln(x)+ (2x)(1/x)= 2ln(x)+ 2. So (1/y)y'= 2ln(x)+ 2 and y'= (2ln(x)+ 2)y= (2ln(x)+ 2)x2x.

A rather amusing point: There are two obvious mistakes one could make in differentiating f(x)g(x):

1) Treat g(x) as if it were a constant. Then you get (f(x)g(x))'= g(x)(f(x))g(x)-1f'(x)- which is, of course, wrong.

2) Treat f(x) as if it were a constant. Then you get (f(x)g(x))'= f(x)g(x) ln(f(x))g'(x)- which is also wrong.

To do it correctly, we can let y= f(x)g(x) so that ln(y)= ln(f(x)g(x))= g(x)ln(f(x) and differentiate both sides, using the product rule on the right.

(1/y) dy/dx= g'(x)ln(f(x)+ (1/f(x))g(x)f'(x) and, since y= f(x)g(x),
dy/dx= (f(x)g(x))'= f(x)g(x)ln(f(x)g'(x)+ f(x)g(x)-1f'(x),

the sum of the two mistaken derivatives!

4. Jul 12, 2009

### g_edgar

part of the general method called "the chain rule for partial derivatives" which you (the OP) will meet later.

Another one:
Two mistaken ways to differentiate a product $$f(x) g(x)$$ ... in one you think that $$f(x)$$ is constant, in the other you think that $$g(x)$$ is constant. BUT the product rule, the correct derivative, is just the sum of these two mistaken derivatives.

5. Jul 12, 2009

### pbandjay

One problem I have always liked a lot that is very similar to this one is
$$y=x^{x^{x^{.^{.^{.}}}}}$$

To differentiate we can re-write: y = xy and apply the logarithm.

y=xy
Re-write: ln(y) = y ln(x)
Differentiate: y'/y = y/x + y' ln(x)
Re-arrange: y'/y - y' ln(x) = y/x ==> y'(1/y - lnx) = y/x ==> y'(1 - y lnx) = y2/x
Isolate y': y' = y2/[x(1 - y lnx)]

We have
$$y'= \frac{(x^{x^{x^{.^{.^{.}}}}})^2}{x(1-(x^{x^{x^{.^{.^{.}}}}})\ln x)}$$