Introduction
A derivative involving exponentials or logarithms can combine several familiar rules at once. A base may depend on \(x\), an exponent may depend on \(x\), and either may contain a nested function. A product or quotient may add more factors to manage.
The main task in this workshop is to choose a reliable sequence of rules. For a variable power, taking a logarithm often turns the exponent into a factor. For a product or quotient, logarithms turn multiplication and division into addition and subtraction. In every case, the domain matters: the real logarithm requires a positive input.
The Variable-Power Rule
Let \(a(x)\) and \(b(x)\) be differentiable functions on an interval, and suppose \(a(x)>0\) there. The positive-base variable power \(y=a(x)^{b(x)}\) can be written using the exponential function as \(y=\exp(b(x)\ln(a(x)))\). Differentiating this representation gives the rule below.
The condition \(a(x)>0\) is what permits the real logarithm \(\ln(a(x))\). It also makes the real-valued definition \(a(x)^{b(x)}=\exp(b(x)\ln(a(x)))\) available for arbitrary real-valued \(b(x)\).
Why the Rule Works
Here is the derivation, including the chain-rule steps. Write \(y=a(x)^{b(x)}\) on an interval where \(a(x)>0\). Then \(y>0\), so taking natural logarithms is valid.
In the second line, the product rule differentiates \(b(x)\ln(a(x))\), and the chain rule gives \(\frac{d}{dx}\ln(a(x))=\frac{a'(x)}{a(x)}\). Substituting \(y=a(x)^{b(x)}\) gives the stated formula. The two terms in the parentheses record the change in the exponent and the change in the base, respectively.
A Reliable Rule Sequence
Before differentiating, identify the outer structure and check where the expression is real-valued. Then apply the rules from the outside inward. For a variable power, the following sequence keeps the two sources of change distinct.
For a general real variable exponent, require the base \(a(x)\) to be positive wherever the logarithmic method is used.
Set \(y=a(x)^{b(x)}\), then identify \(a'(x)\) and \(b'(x)\), using the chain rule for nested inputs.
Use \(b'(x)\ln(a(x))\) for the changing exponent and \(b(x)a'(x)/a(x)\) for the changing base.
The derivative is the original power multiplied by the sum of those contributions.
Worked Examples
Worked Example: A Shifted Base and a Quadratic Exponent
Differentiate \(y=(3x+2)^{x^2}\) on its real-valued domain. For a general real exponent, the base must be positive: \(3x+2>0\), so \(x>-\frac23\).
Set \(a(x)=3x+2\) and \(b(x)=x^2\). Then \(a'(x)=3\) and \(b'(x)=2x\). Applying the variable-power rule gives
Check at \(x=0\), which lies in the domain. The original function gives \(y(0)=2^0=1\). The derivative formula gives \(y'(0)=1(0+0)=0\). This agrees with the logarithmic rate of change: at \(x=0\), both \(b'(0)\) and \(b(0)\) are zero, so the derivative contributions vanish.
Worked Example: A Logarithm in the Exponent
Differentiate \(y=(x^2+4)^{\ln(x+1)}\). The base \(x^2+4\) is positive for every real \(x\), while the logarithm in the exponent requires \(x+1>0\). Thus the real-valued domain is \(x>-1\).
Let \(a(x)=x^2+4\) and \(b(x)=\ln(x+1)\). Their derivatives are \(a'(x)=2x\) and \(b'(x)=\frac1{x+1}\). Therefore
To check, evaluate at \(x=0\). The original function is \(4^{\ln 1}=4^0=1\). In the derivative formula, the first term in parentheses is \(\ln 4\), and the second is zero, so \(y'(0)=\ln 4\). This also follows from the logarithmic derivative: \(\frac{y'}y=\frac{\ln 4}{1}+0=\ln 4\), and \(y(0)=1\).
Worked Example: Logarithmic Differentiation of a Quotient
Differentiate \(y=\frac{(x-1)^3\sqrt{x+2}}{(2x+1)^2}\) on its real-valued domain. The square root requires \(x\geq -2\), and the denominator requires \(2x+1\ne0\). However, the logarithmic differentiation below takes \(\ln y\), so it applies where \(y>0\). The factor \((x-1)^3\) makes \(y>0\) when \(x>1\), which is the interval used for this calculation.
Take the logarithm and use the laws for products, quotients, and powers:
Differentiate each term. The chain rule gives \(\frac{d}{dx}\ln(2x+1)=\frac{2}{2x+1}\), so
Multiplying by the original \(y\) yields
Check at \(x=2\). The original function is \(y(2)=\frac{1\cdot2}{25}=\frac2{25}\). The logarithmic derivative is \(3+\frac18-\frac45=\frac{120+5-32}{40}=\frac{93}{40}\). Hence \(y'(2)=\frac2{25}\cdot\frac{93}{40}=\frac{93}{500}\). The derivative formula gives the same value after substituting \(x=2\).
Worked Example: Nested Logarithms in a Variable Power
Differentiate \(y=(\ln(x^2+1))^{\cos x}\). For the base to be positive, we need \(\ln(x^2+1)>0\), equivalent to \(x^2+1>1\), or \(x\ne0\). Thus the real-valued domain is \(\mathbb R\setminus\{0\}\).
Take \(a(x)=\ln(x^2+1)\) and \(b(x)=\cos x\). By the chain rule, \(a'(x)=\frac{2x}{x^2+1}\), while \(b'(x)=-\sin x\). The derivative is
Check at \(x=1\). The base is \(\ln2>0\), and the exponent is \(\cos1\). Substitution gives \(y'(1)=(\ln2)^{\cos1}\left[-\sin1\ln(\ln2)+\frac{\cos1}{\ln2}\right]\). The logarithmic derivative of the original function is exactly the bracketed expression, so multiplying it by \(y(1)=(\ln2)^{\cos1}\) reproduces the derivative above.
Products and Quotients: What Logarithms Contribute
For a positive differentiable function \(y\), the logarithmic derivative is \(\frac{y'}y\), the rate of change of \(y\) relative to its current value. If \(y\) is a product of positive differentiable factors, taking \(\ln y\) turns the product into a sum. For a quotient, it turns division into subtraction. Differentiating that sum or difference can be simpler than applying repeated product and quotient rules directly.
When factors are not all positive, logarithms of their absolute values can be used on intervals where none of the factors is zero. In that setting, \(\frac{d}{dx}\ln|u(x)|=\frac{u'(x)}{u(x)}\) wherever \(u(x)\ne0\). The original function's domain still needs to be checked separately. Logarithmic differentiation does not make an undefined factor valid or allow division by zero.
A Common Mistake
A frequent error is to differentiate \(x^x\) as though it were an ordinary power with constant exponent, writing \(x\cdot x^{x-1}\). That rule applies to \(x^n\) when \(n\) is constant, not when the exponent also varies. For \(x^x\), the real-valued logarithmic method requires \(x>0\). Taking logarithms gives \(\ln y=x\ln x\), so
The incorrect expression gives \(4\) at \(x=2\), whereas the correct derivative gives \(4(\ln2+1)\). The difference comes from ignoring the derivative of the exponent. A useful check is to ask whether the result includes both contributions: the change in the exponent and the change in the base.
Why Domain Checks Matter
The variable-power rule is especially convenient because it handles arbitrary differentiable exponents, but its real-valued logarithmic form requires a positive base. An expression can have a larger domain in special cases—for example, a negative base raised to a fixed integer power—but that does not justify applying the general variable-exponent rule there. Check the original expression first, then state the interval on which the chosen differentiation method is valid.
For a nested expression, check each layer. In \((\ln(x^2+1))^{\cos x}\), the outer variable power requires \(\ln(x^2+1)>0\); the inner logarithm itself requires \(x^2+1>0\). The stronger requirement is \(x\ne0\). Keeping these conditions explicit prevents a formally correct differentiation from being presented on points where the original function is not defined.
Check Your Understanding
For each question, identify the relevant domain before differentiating or simplifying.
- Differentiate \(y=(2x+5)^{x^3}\). On what interval is the general real variable-power rule applicable?
- For \(y=(x^2+1)^{\ln x}\), state the real-valued domain and write the derivative using the variable-power rule.
- Explain why differentiating \(x^x\) as \(x\cdot x^{x-1}\) omits a term.
- For a positive differentiable function \(y\), what does \(\frac{y'}y\) represent in logarithmic differentiation?
- When using \(\ln|u(x)|\), what condition on \(u(x)\) is needed at the point of differentiation?