How taking a logarithm before differentiating turns long products and quotients into sums, handles functions like x to the power x, and which sign and domain conditions it needs.
Differentiating a product of five factors with the product rule produces five long terms and plenty of room for mistakes. Logarithms turn products into sums and powers into multiples, and sums are easy to differentiate. So it often pays to take the logarithm first, differentiate, and then undo the logarithm at the end.
Key terms
Logarithmic differentiation
Definition Let y=f(x) be differentiable at x with f(x)=0. Then
Logarithmic differentiation means taking ln∣y∣, simplifying with the laws of logarithms, differentiating with respect to x, and multiplying the result by y.
In plain words The quantity yy′ is the relative rate of change of y. It is often much easier to compute than y′ itself, and you recover y′ by multiplying by y.
Example For y=x5e3x with x=0, taking logarithms gives ln∣y∣=5ln∣x∣+3x. Differentiating gives yy′=x5+3, so
y′=x5e3x(x5+3)=(5x4+3x5)e3x.
The final formula also holds at x=0, as the product rule confirms.
Products
Definition If y=f1(x)f2(x)⋯fn(x) where each fi is differentiable at x and fi(x)=0, then
hold whenever u and v are nonzero real numbers and n is an integer. For a function u differentiable at x with u(x)=0, the derivative of ln∣u∣ at x is uu′. The resulting formula for y′ is proved only at points where every factor is nonzero. Points where a factor is zero must be checked separately.
In plain words The absolute value bars let you use the method even where y is negative, and they disappear from the answer because the derivative of ln∣u∣ is u′/u, with no bars.
Example Let y=x+1x−3 at x=0, where y=−3<0, so lny is undefined there. Use the absolute value instead.
ln∣y∣=ln∣x−3∣−ln∣x+1∣
Then
yy′=x−31−x+11=−31−1=−34,
so y′(0)=−3⋅(−34)=4. The quotient rule agrees, since y′=(x+1)24.
Variable exponents
Definition Let f and g be differentiable at x with f(x)>0. Wherever f>0 the function y=f(x)g(x) is defined as eg(x)lnf(x), and f stays positive near x because it is continuous there. Taking logarithms gives lny=g(x)lnf(x), and differentiating gives
y′=f(x)g(x)(g′(x)lnf(x)+g(x)f(x)f′(x)).
In plain words When both the base and the exponent change with x, neither the power rule (fixed exponent) nor the exponential rule (fixed base) applies. Taking a logarithm brings the exponent down where the product rule can handle it.
Example For y=xx with x>0, taking logarithms gives lny=xlnx, so yy′=lnx+1 and
y′=xx(lnx+1).
At x=2 this is 4(ln2+1)≈6.773.
Positive base assumptions
Definition When the exponent varies with x, the power f(x)g(x) is defined as eg(x)lnf(x), which requires f(x)>0. The formula for variable exponents therefore applies only on intervals where the base is positive. A negative base has a real power only for some exponents, namely integers and fractions in lowest terms with an odd denominator. For example (−8)1/3=−2, while (−8)1/2 is not real. Suppose the base is negative at a point and the exponent g is continuous and not constant on any open interval around that point. Then every such interval contains points where g is irrational and the base is still negative, so the power is undefined at points arbitrarily close to the point and cannot be differentiated there. The formula with lnf(x) makes no sense there either.
In plain words Check that the base is positive before you use the formula. If it is not, restrict to an interval where it is.
Example The base of y=(x2+1)x is always positive, so the formula holds on all of R. With lny=xln(x2+1),
y′=(x2+1)x(ln(x2+1)+x2+12x2).
At x=1 this is 2(ln2+1)≈3.386. In contrast, xx cannot be differentiated at any x<0. It has real values at some negative points, such as (−1)−1=−1, but not at others arbitrarily close to them, such as x=−21, where (−21)−1/2 is not a real number.
Check yourself
Differentiate y=xsinx for x>0.
Show the answer
Taking logarithms gives lny=sinxlnx, so yy′=cosxlnx+xsinx and
y′=xsinx(cosxlnx+xsinx).
Let y=x2(x−1)3(x+2). Use logarithmic differentiation to find y′(2).
Show the answer
At x=2 the value is y=4⋅1⋅4=16, and the relative rate is
yy′=x2+x−13+x+21=1+3+41=417.
So y′(2)=16⋅417=68.
Why do we write ln∣y∣ rather than lny for y=x+1x−3 near x=0?
Show the answer
Near x=0 the value of y is negative (it is −3 at x=0), and ln of a negative number is undefined. The absolute value makes the logarithm defined, and the derivative of ln∣u∣ is still uu′.
May we count page visits to understand which courses and learning features are useful? Cloudflare collects visit and performance statistics, without your account details or answers. Your choice does not affect access. Details