Logarithmic differentiation: variable powers, products, and worked problems

Original publication: Updated:

Why logarithms help

When both the base and exponent depend on xx, neither the constant-power rule nor the constant-base exponential rule applies on its own. On an interval where f(x)>0f(x)>0, let

h(x)=f(x)g(x).h(x)=f(x)^{g(x)}.

Taking natural logarithms gives ln⁡h=gln⁡f\ln h=g\ln f. Differentiate using the chain and product rules:

h′h=g′ln⁡f+gf′f.\frac{h'}h=g'\ln f+g\frac{f'}f.

Therefore

h′=fg(g′ln⁡f+gf′f).\boxed{h'=f^g\left(g'\ln f+g\frac{f'}f\right).}

Natural logarithms keep the derivative formula simple. Other logarithm bases are possible but introduce conversion factors. The notation ln⁡\ln throughout this article makes the natural base explicit.

Three useful situations

A constant base: recover the exponential derivative

For y=axy=a^x with constant a>0a>0, ln⁡y=xln⁡a\ln y=x\ln a, so

y′y=ln⁡a,y′=axln⁡a.\frac{y'}y=\ln a,\qquad\boxed{y'=a^x\ln a.}

The case a=1a=1 gives zero as it should. This derivation presumes that the logarithm, its derivative, and the relevant inverse-function differentiation rules have already been established. It should not be used circularly to establish those same starting facts.

Both base and exponent vary

For f(x)=xxf(x)=x^x on x>0x>0,

ln⁡f=xln⁡x,\ln f=x\ln x,

hence

f′(x)=xx(ln⁡x+1).\boxed{f'(x)=x^x(\ln x+1).}

Treating the exponent as a constant and writing x⋅xx−1x\cdot x^{x-1} would miss the change in the exponent.

Many products and powers

Example. Differentiate the real fifth-root function

y=(x−1)(x+3)3(x+2)45.y=\sqrt[5]{\frac{(x-1)(x+3)^3}{(x+2)^4}}.

The original real function is defined for x≠−2x\ne-2. To take a logarithm, also work away from the zeros x=−3,1x=-3,1 and use an absolute value:

ln⁡∣y∣=15{ln⁡∣x−1∣+3ln⁡∣x+3∣−4ln⁡∣x+2∣}.\ln|y|=\frac15\{\ln|x-1|+3\ln|x+3|-4\ln|x+2|\}.

Differentiate:

y′y=15(1x−1+3x+3−4x+2)=125(x−1)(x+3)(x+2).\frac{y'}y=\frac15\left(\frac1{x-1}+\frac3{x+3}-\frac4{x+2}\right)=\frac{12}{5(x-1)(x+3)(x+2)}.

Thus, for x∉{−3,−2,1}x\notin\{-3,-2,1\},

y′=125(x−1)(x+3)(x+2)(x−1)(x+3)3(x+2)45.\boxed{y'=\frac{12}{5(x-1)(x+3)(x+2)}\sqrt[5]{\frac{(x-1)(x+3)^3}{(x+2)^4}}.}

The points x=−3,1x=-3,1 require separate analysis rather than substitution into this formula. Locally the function behaves like a nonzero constant times a signed power of order 3/53/5 or 1/51/5, respectively, so it has no finite derivative there. The point x=−2x=-2 is outside the original domain entirely.

Taking ln⁡∣y∣\ln|y| accommodates negative values of yy; it does not make a logarithm of zero permissible.

An equivalent shortcut: write the power as an exponential

For a positive base,

f(x)g(x)=eg(x)ln⁡f(x).f(x)^{g(x)}=e^{g(x)\ln f(x)}.

The chain rule immediately gives the same derivative. For instance,

(xx)′=(exln⁡x)′=exln⁡x(ln⁡x+1).(x^x)'=(e^{x\ln x})'=e^{x\ln x}(\ln x+1).

This is a shorter presentation of the same reasoning, not a different rule that avoids the domain condition.

Problem 1: minimize x to the power x

Problem. Find the minimum of xxx^x for x>0x>0.

Since xx>0x^x>0, the sign of its derivative is the sign of 1+ln⁡x1+\ln x. This is negative for 0<x<e−10<x<e^{-1}, zero at x=e−1x=e^{-1}, and positive for x>e−1x>e^{-1}.

The function therefore decreases and then increases, giving the global minimum

e−1/e=(1e)1/e,x=1e.\boxed{e^{-1/e}=\left(\frac1e\right)^{1/e},\qquad x=\frac1e.}

Problem 2: two bounds for e

The following problem is attributed in the original article to the University of Tokyo's 2016 science-track paper.

Problem. Define ee by

e=lim⁡t→∞(1+1t)t.e=\lim_{t\to\infty}\left(1+\frac1t\right)^t.

Prove that for every real x>0x>0,

(1+1x)x<e<(1+1x)x+1/2.\boxed{\left(1+\frac1x\right)^x<e<\left(1+\frac1x\right)^{x+1/2}.}

The exponent on the right is x+1/2x+1/2, which is important for the sharper upper bound.

Take logarithms and define

F(x)=xln⁡(1+1x),G(x)=(x+12)ln⁡(1+1x).F(x)=x\ln\left(1+\frac1x\right),\qquad G(x)=\left(x+\frac12\right)\ln\left(1+\frac1x\right).

Both tend to 11 as x→∞x\to\infty. Direct differentiation gives

F′(x)=ln⁡(1+1x)−1x+1,F′′(x)=−1x(x+1)2<0,F'(x)=\ln\left(1+\frac1x\right)-\frac1{x+1},\qquad F''(x)=-\frac1{x(x+1)^2}<0,

and

G′(x)=ln⁡(1+1x)−12x−12(x+1),G′′(x)=12x2(x+1)2>0.G'(x)=\ln\left(1+\frac1x\right)-\frac1{2x}-\frac1{2(x+1)},\qquad G''(x)=\frac1{2x^2(x+1)^2}>0.

Both first derivatives tend to zero at infinity. Since F′F' is strictly decreasing toward zero, it is positive. Since G′G' is strictly increasing toward zero, it is negative. Thus FF increases strictly toward 11 and GG decreases strictly toward 11:

F(x)<1<G(x).F(x)<1<G(x).

Exponentiation, which preserves inequalities, proves both bounds.

Problem 3: a variable exponent, a graph, and two roots

This problem is attributed in the source to Ochanomizu University's 2018 paper. Let

f(x)=xx2,x>0.f(x)=x^{x^2},\qquad x>0.
  1. Find f′f' and f′′f''.
  2. Sketch the curve, including its behavior as x→0+x\to0^+ and that of its derivative. You may use xln⁡x→0x\ln x\to0 as x→0+x\to0^+; the coordinates of inflection points are not required.
  3. Find the real values of kk for which f(x)=kf(x)=k has two distinct positive roots.

Part 1: derivatives

Since ln⁡f=x2ln⁡x\ln f=x^2\ln x,

f′(x)=x(2ln⁡x+1)xx2.\boxed{f'(x)=x(2\ln x+1)x^{x^2}.}

Another differentiation gives

f′′(x)={3+2ln⁡x+x2(2ln⁡x+1)2}xx2.\boxed{f''(x)=\{3+2\ln x+x^2(2\ln x+1)^2\}x^{x^2}.}

Part 2: limits and monotonicity

As x→0+x\to0^+, x2ln⁡x=x(xln⁡x)→0x^2\ln x=x(x\ln x)\to0, so

f(x)→1,f′(x)=(2xln⁡x+x)f(x)→0.f(x)\to1,\qquad f'(x)=(2x\ln x+x)f(x)\to0.

The point (0,1)(0,1) is approached but is not in the domain. The derivative is negative for 0<x<e−1/20<x<e^{-1/2} and positive for x>e−1/2x>e^{-1/2}. The minimum is

m=f(e−1/2)=e−1/(2e)=(1e)1/e.m=f(e^{-1/2})=e^{-1/(2e)}=\left(\frac1{\sqrt e}\right)^{1/e}.

As x→∞x\to\infty, f(x)→∞f(x)\to\infty. These facts give the graph's endpoint behavior, unique minimum, and increasing branch. The second derivative is negative sufficiently close to zero and positive at the minimum, consistent with a change of concavity before that minimum.

The curve y=x to the power x squared, approaching the excluded point (0,1), decreasing to its minimum at x=1/square root of e, and then increasing without bound.

Part 3: count the intersections with y = k

The decreasing branch takes precisely the values m<y<1m<y<1, while the increasing branch takes every value above mm. At y=my=m the two branches meet in one point. Therefore two distinct positive roots occur exactly when

e−1/(2e)<k<1.\boxed{e^{-1/(2e)}<k<1.}

At k=1k=1, only the increasing branch contributes, since the endpoint x=0x=0 is excluded. At k=mk=m there is one root, and below mm none.

This final step is a parameter-separation and graphical root-counting problem. Logarithmic differentiation supplies the graph; domain and endpoint checks determine the answer.

Related articles

About the author

Koki Saito

Physician and graduate of the University of Tokyo Faculty of Medicine. Drawing on his entrance-exam experience, he explains how to choose mathematical methods and construct complete solutions.

Full profile →

Have a question or spotted an error? Contact us.