Why Small Errors Change the Derivative
Logarithmic differentiation can turn a complicated product, quotient, or variable power into a manageable sum. Its steps are compact, however, and that makes it easy to drop a term or factor. A correct calculation must account for both the changing base and the changing exponent, and it must return from the logarithm to the original function.
There is also a domain condition: the real natural logarithm is defined only for positive inputs. Taking a logarithm of a base that is zero or negative is not a valid real-valued step, even when the original expression happens to be defined.
The Basic Identity and Its Conditions
If \(y=f(x)\) is differentiable and \(f(x)\ne 0\), the chain rule applied to \(\ln|f(x)|\) gives
When \(f(x)>0\), this can be written as \(\frac{d}{dx}\ln f(x)=f'(x)/f(x)\). The absolute-value version is useful for a nonzero function that may be negative, but it does not make the logarithm of a negative number valid: \(\ln|f(x)|\) logs the positive quantity \(|f(x)|\).
For a variable power \(y=u(x)^{v(x)}\), the usual real-valued logarithmic method requires \(u(x)>0\) on an open interval and differentiable functions \(u\) and \(v\) there. Then \(y>0\), so we may take its logarithm:
Differentiating both sides and then solving for \(y'\) gives the formula below. Its two terms come from differentiating the exponent and the base, respectively.
This is a formula for the derivative of the original power, not just the derivative of its logarithm. The factor \(u(x)^{v(x)}\) is essential.
Why the Variable-Power Formula Works
Here is the full derivation, including the step that is often missed. Because the base is positive, the power can be expressed using the exponential and natural logarithm:
Taking the natural logarithm of \(y\) is valid because \(y>0\). By the product rule and chain rule,
Multiplying the second equation by \(y\) yields \(y'=y\left(v'\ln u+v\,u'/u\right)\). Substituting \(y=u^v\) proves the stated formula. Thus the derivative has two contributions inside the parentheses, and the original power multiplies their sum.
Worked Example: Keeping the Exponent-Derivative Term
Worked Example: Keeping the Exponent-Derivative Term
Differentiate \(y=x^{2x}\) for \(x>0\), and evaluate the derivative at \(x=2\).
The base is positive on the stated domain. Set \(u(x)=x\) and \(v(x)=2x\), so \(u'(x)=1\) and \(v'(x)=2\). The variable-power formula gives
At \(x=2\), the original function is \(2^{4}=16\), while the quantity in parentheses is \(2\ln 2+2\). Therefore
Check by writing \(y=\exp(2x\ln x)\). Differentiating this expression gives \(y'=\exp(2x\ln x)(2\ln x+2)\), which is the same result because \(\exp(2x\ln x)=x^{2x}\) for \(x>0\).
Common wrong calculation: Omitting the term involving \(\ln x\), as if the exponent were constant, leaves only the base contribution: $$ y'_{\text{wrong}}=x^{2x}\left(2x\frac1x\right)=2x^{2x}. $$ At \(x=2\), this gives \(32\), not \(32(\ln 2+1)\). The missing term is \(2x^{2x}\ln x\), which comes from differentiating the exponent \(2x\).
Worked Example: Multiplying Back by the Original Function
Worked Example: Multiplying Back by the Original Function
Differentiate \(y=(x+1)^x\) for \(x>-1\), and find \(y'(1)\).
Since \(x+1>0\) on this interval, take logarithms:
Differentiate the right side using the product rule:
This equation gives \(y'/y\), not \(y'\). Multiply by \(y=(x+1)^x\):
At \(x=1\), \(y=2^1=2\), and the expression in parentheses is \(\ln 2+\frac12\). Thus
To check, write \(y=\exp\bigl(x\ln(x+1)\bigr)\). Differentiating gives \(y'=\exp\bigl(x\ln(x+1)\bigr)\left(\ln(x+1)+x/(x+1)\right)\). At \(x=1\), this is \(2(\ln 2+1/2)=2\ln2+1\), as above.
Common wrong calculation: Reporting \(y'/y=\ln(x+1)+x/(x+1)\) as the derivative omits the factor \(y\). At \(x=1\), that incorrect answer is \(\ln 2+1/2\), whereas the derivative is \(2\ln 2+1\).
Worked Example: Do Not Log a Nonpositive Base
Worked Example: Do Not Log a Nonpositive Base
Differentiate \(y=(-x)^2\) for \(x>0\). This example is deliberately simple: the original expression is defined even though its displayed base is negative.
The real logarithm of the base \(-x\) is not defined for \(x>0\), so the equation \(\ln y=2\ln(-x)\) is not a valid real equation. Differentiate the original expression using the chain rule instead:
Check by simplifying first: \((-x)^2=x^2\), and differentiating \(x^2\) also gives \(2x\). For \(x>0\), one may alternatively take the logarithm of the whole positive function: \(y=x^2>0\), so \(\ln y=2\ln x\). Differentiating gives \(y'/y=2/x\), hence \(y'=x^2(2/x)=2x\).
Common wrong calculation: Writing \(\ln((-x)^2)=2\ln(-x)\) applies the logarithm-of-a-power rule to a negative base. The left side is defined, since \((-x)^2>0\), but the right side is not defined as a real expression. The valid logarithmic route logs the positive whole function, or one can differentiate directly.
What to Check Before Accepting a Result
These errors are avoidable if the calculation is checked in a fixed order. For a variable power, make sure each of the following is settled before simplifying:
For the real logarithmic method applied to \(u(x)^{v(x)}\), verify \(u(x)>0\) on the interval being considered.
From \(\ln y=v\ln u\), the product rule produces \(v'\ln u+v\,u'/u\). Neither contribution can be discarded unless it is actually zero.
The equation after differentiating is \(y'/y=\cdots\). Multiply both sides by \(y=u^v\) to obtain \(y'\).
Where practical, rewrite the power as \(\exp(v\ln u)\) and differentiate with the chain and product rules. The result should agree.
These checks also distinguish an invalid method from an incomplete calculation. A negative base can define a power when the exponent is a fixed integer, but that does not authorize taking the logarithm of the base. In such a case, use a direct differentiation rule or an equivalent expression whose logarithm is defined. Likewise, if the whole function reaches zero, \(\ln y\) cannot be used at that point; logarithmic differentiation may still work on an interval where \(y>0\), but its conclusion must not be extended through a point where its conditions fail without a separate argument.
Why These Corrections Matter
The logarithmic derivative \(y'/y\) describes a derivative divided by the original function. It is an intermediate quantity, not generally the derivative itself. Missing the original function changes the scale of the answer. Dropping one of the terms in the logarithmic derivative changes how the result responds to variation in either the base or the exponent. Using a logarithm outside its domain makes the reasoning invalid even if later algebra appears plausible.
For any proposed logarithmic differentiation, ask three precise questions: Was every logarithm taken of a positive quantity? Did the product rule differentiate both factors? Was the equation for \(y'/y\) converted back into an equation for \(y'\)? Answering all three correctly catches the most common errors before they spread through a longer calculation.
Check Your Understanding
For each question, identify the condition or step that determines whether the calculation is valid.
- For \(y=x^{3x}\) on \(x>0\), write both terms in the logarithmic derivative \(y'/y\). Which term would be lost by treating the exponent as constant?
- If logarithmic differentiation gives \(y'/y=5/x\), what additional factor is required to state \(y'\)?
- For \(y=(-x)^4\) with \(x>0\), is \(\ln(-x)\) defined as a real number? Give a valid way to differentiate \(y\).
- Why must the base \(u(x)\) be positive when deriving the real-valued formula for \(u(x)^{v(x)}\) by taking \(\ln u(x)\)?
- Describe one independent check for a derivative obtained by logarithmic differentiation.