Why These Products Need Care
When an exponential function and a logarithmic function are multiplied, each factor contributes to the derivative. The product rule keeps those contributions separate, then combines them. The domain matters just as much: a logarithm is defined only for positive inputs, even though an exponential factor is defined for every real input.
For example, \(e^x\ln x\) is defined only when \(x>0\). On that domain, both factors are differentiable, so the product rule applies. The same check is necessary for \(a^x\log_a x\), where the base \(a\) must also satisfy the conditions for a logarithm.
The Product Rule and the Required Derivatives
If \(u\) and \(v\) are differentiable functions of \(x\), their product is differentiable, and the product rule states
For the products in this tutorial, we also need the derivatives of exponential and logarithmic functions. The natural exponential and natural logarithm satisfy \(\frac{d}{dx}e^x=e^x\) and \(\frac{d}{dx}\ln x=\frac{1}{x}\), with the logarithm formula applying for \(x>0\). For a real base \(a\), the other-base formulas are
The restriction \(a\ne 1\) is needed because \(\log_1 x\) is not a logarithmic function: \(1^y=1\) for every \(y\), so it cannot represent arbitrary positive \(x\). When \(0<a<1\), the formulas remain valid; in that case \(\ln a<0\).
Why the Product Rule Works
The product rule follows from the difference quotient. Suppose \(u\) and \(v\) are differentiable at \(x\). Add and subtract \(u(x+h)v(x)\) in the numerator of the difference quotient for their product, then group the terms:
As \(h\to 0\), differentiability of \(v\) makes the first difference quotient approach \(v'(x)\), and differentiability of \(u\) makes the second approach \(u'(x)\). Differentiability also implies continuity, so \(u(x+h)\to u(x)\). Therefore the limit is
which is the product rule. The two terms arise because the change in the product can be separated into a change in the first factor and a change in the second.
Worked Example: \(e^x\ln x\)
Worked Example: Differentiate \(e^x\ln x\)
Let \(f(x)=e^x\ln x\). First check the domain. The exponential \(e^x\) is defined for every real \(x\), but \(\ln x\) requires \(x>0\). Thus \(f\) and the derivative calculation are considered on \(x>0\).
Set \(u(x)=e^x\) and \(v(x)=\ln x\). Their derivatives are \(u'(x)=e^x\) and \(v'(x)=1/x\). Applying the product rule gives
Check the result at \(x=1\). Since \(\ln 1=0\) and \(e^1=e\), the product-rule terms give
The simplified derivative gives the same value: \(e^1(0+1)=e\). The domain includes \(x=1\), so this check uses a valid input.
Worked Example: \(3^x\log_3 x\)
Worked Example: Differentiate \(3^x\log_3 x\)
Let \(g(x)=3^x\log_3 x\). The base \(3\) is positive and not equal to \(1\), and the logarithm requires \(x>0\). The product is therefore defined for \(x>0\).
For the first factor, \(\frac{d}{dx}3^x=3^x\ln 3\). For the second, \(\frac{d}{dx}\log_3 x=1/(x\ln 3)\). Substituting these into the product rule gives
To check at \(x=3\), use \(\log_3 3=1\) in the unsimplified product-rule expression:
The simplified formula gives \(3^3(\ln 3+1/(3\ln 3))=27\ln 3+9/\ln 3\), as required. Notice that the terms involving \(\ln 3\) do not simply cancel from the entire derivative: they cancel in the first term, while the derivative of \(\log_3 x\) still contributes \(1/(x\ln 3)\).
Worked Example: \(2^x\ln x\)
Worked Example: Differentiate \(2^x\ln x\)
Let \(h(x)=2^x\ln x\). The factor \(2^x\) is defined for all real \(x\), while \(\ln x\) requires \(x>0\). Thus \(h\) is defined on \(x>0\).
Here the exponential and logarithmic factors have different bases. Their derivatives are \(\frac{d}{dx}2^x=2^x\ln 2\) and \(\frac{d}{dx}\ln x=1/x\). The product rule gives
Check at \(x=1\). The first product-rule term is \((2\ln 2)(0)=0\), and the second is \(2(1)=2\). The simplified formula also gives \(2(0+1)=2\). This check confirms both the derivative and the role of the \(\ln 2\) factor from differentiating the exponential.
A Useful Formula for Matching Bases
When the product is \(a^x\log_a x\), with \(a>0\), \(a\ne 1\), and \(x>0\), the logarithm and exponential use the same base. The change-of-base identity \(\log_a x=\ln x/\ln a\) simplifies the first product-rule term. The resulting formula is
This formula also covers \(a=e\), because \(\log_e x=\ln x\) and \(\ln e=1\). Substituting \(a=e\) gives \(e^x(\ln x+1/x)\), the derivative found in the first example. The domain condition \(x>0\) remains essential regardless of the exponential base.
Common Mistake: Differentiating Only One Factor
A frequent error is to differentiate the exponential factor but leave out the term from differentiating the logarithm. For instance, the incorrect calculation
uses the derivative of \(e^x\) but ignores the derivative of \(\ln x\). The product rule requires two terms: one from differentiating each factor in turn. The corrected calculation is
Another domain error is to give this derivative for \(x\le 0\). Neither \(\ln x\) nor \(e^x\ln x\) is defined there as a real-valued function. A derivative formula cannot extend the original function to inputs outside its domain.
A Reliable Procedure
For a product of an exponential and a logarithm, use the following sequence.
Require the logarithm’s argument to be positive. For \(\log_a x\), also require \(a>0\) and \(a\ne 1\).
Identify which factor is the exponential and which is the logarithm.
Include the factor \(\ln a\) when differentiating \(a^x\), and the factor \(1/\ln a\) when differentiating \(\log_a x\).
Write both terms, simplify only after they are present, and verify the result at a valid input when possible.
These derivatives are useful because they combine two basic function families while making the product rule visible. On an AP exam, carefully writing both terms and stating the valid domain helps prevent errors that can persist even when the algebra afterward is correct.
Check Your Understanding
For each question, state the relevant domain before or alongside the derivative.
- Differentiate \(e^x\ln x\), and evaluate the derivative at \(x=2\).
- Differentiate \(5^x\log_5 x\) for its full domain.
- Differentiate \(4^x\ln x\). Which factor in the derivative comes from differentiating \(4^x\)?
- Explain why \(2^x\log_2 x\) is not defined as a real-valued function at \(x=0\), even though \(2^x\) is defined there.
- Identify the missing term in the incorrect claim \(\frac{d}{dx}(3^x\ln x)=3^x(\ln 3)\ln x\), then write the correct derivative.