Why the Domain Matters
A derivative formula is not a license to substitute every number into its right-hand side. Before calculating, check that the function has a real value at the input and that the derivative is defined there. For the natural logarithm, this check is essential: \(\ln x\) is a real-valued function only when \(x>0\).
The familiar formula
is therefore a statement about positive inputs. Although the expression \(1/x\) can be calculated for negative \(x\), that fact does not make it the derivative of \(\ln x\) there. At a negative input, the real function \(\ln x\) itself has no value.
Why \(\ln x\) Requires a Positive Input
The natural logarithm is the inverse of the natural exponential function. In other words, \(\ln x\) is the real number \(y\) that satisfies \(e^y=x\). For every real \(y\), the exponential value \(e^y\) is positive. Conversely, every positive real number is \(e^y\) for exactly one real \(y\). Thus the exponential function takes real inputs to positive outputs, and its inverse takes positive inputs to real outputs.
This inverse relationship explains both sides of the domain issue. If \(x>0\), there is a real number whose exponential is \(x\), so \(\ln x\) is defined. If \(x=0\) or \(x<0\), there is no real \(y\) with \(e^y=x\), so \(\ln x\) has no real value.
For example, \(\ln 1=0\), because \(e^0=1\), and \(\ln e=1\), because \(e^1=e\). By contrast, \(\ln 0\) is not a real number: no real exponent makes \(e^y=0\). Nor is \(\ln(-2)\) a real number: no real exponent makes \(e^y=-2\). These are not unusual values of the logarithm; they are inputs outside the real logarithm’s domain.
The Domain of the Derivative
The derivative of a function at an input \(a\) is defined using a limit of difference quotients. In the standard AP Calculus definition, the function must be defined at \(a\) and at nearby inputs on both sides of \(a\). In particular, a derivative cannot exist at an input where the function itself has no value.
provided this two-sided limit exists. For \(f(x)=\ln x\), every \(a>0\) has a small open interval around it consisting entirely of positive numbers. The function is defined throughout that interval, and its derivative can be considered there. But \(a=0\) is not in the function’s domain, and no negative \(a\) is in the domain either. Consequently, neither zero nor a negative number can be an input at which the real function \(\ln x\) has a derivative.
The derivative rule has the same domain restriction as the function:
The expression \(1/x\), considered by itself, is defined for every \(x\ne 0\). That includes negative numbers. But the derivative claim is not about \(1/x\) by itself: it says that \(1/x\) gives the derivative of \(\ln x\). Since \(\ln x\) is not a real-valued function at negative inputs, that claim is valid only on the positive domain.
Why the Formula Gives \(1/a\) for Positive \(a\)
The derivative formula can be justified directly at any fixed \(a>0\). This also makes the restriction visible in the calculation. We use the inverse relationship between \(\ln\) and \(e^x\), the logarithm product rule, and the standard limit \(\lim_{u\to 0}(e^u-1)/u=1\).
The limit used in the last line follows from \(\lim_{u\to0}(e^u-1)/u=1\), taking reciprocals for nonzero \(u\) near zero. Thus the derivative exists at every \(a>0\) and equals \(1/a\). The argument begins by fixing \(a>0\), so that nearby values \(a+h\) remain in the domain. It does not provide a derivative at zero or at a negative input.
Worked Examples
Worked Example: Find the Tangent Line to \(\ln x\) at \(x=1\)
Let \(f(x)=\ln x\). First check the input: \(1>0\), so \(f(1)\) and \(f'(1)\) are defined. Since \(\ln 1=0\), the point on the graph is \((1,0)\). The derivative rule gives
The tangent line through \((1,0)\) with slope \(1\) is \(y-0=1(x-1)\), or \(y=x-1\). Check: this line passes through \((1,0)\), since \(1-1=0\), and its slope is \(1\), matching \(f'(1)\). Every step uses a positive input where the logarithm and its derivative are defined.
Worked Example: Evaluate the Derivative at \(x=e^2\)
For \(f(x)=\ln x\), the input \(e^2\) is positive, so the derivative rule applies. Substitution gives
As a check, \(f(e^2)=\ln(e^2)=2\). The derivative formula at this same input gives the slope \(e^{-2}\), which is positive and finite because \(e^2>0\). Thus the point on the graph is \((e^2,2)\), and the tangent line there can be written \(y-2=e^{-2}(x-e^2)\). Its slope is \(e^{-2}\), as required.
Worked Example: Diagnose Claims at Zero and at a Negative Input
Consider the claim \(f'(0)=1/0\) for \(f(x)=\ln x\). It is invalid. The value \(f(0)=\ln 0\) is undefined in the real numbers, so the difference quotient for \(f'(0)\) cannot be formed. In addition, \(1/0\) is undefined; it is not a derivative value or a finite number. The correct conclusion is that \(f'(0)\) does not exist as a real derivative because \(f\) is not defined at zero.
Now consider the claim \(f'(-3)=1/(-3)=-1/3\). The arithmetic \(1/(-3)=-1/3\) is correct, but the derivative claim is not: \(f(-3)=\ln(-3)\) is undefined as a real number. The rule \(f'(x)=1/x\) applies only for \(x>0\). Therefore \(f'(-3)\) is not defined for the real function \(f(x)=\ln x\). The valid positive-input check, for comparison, is \(f'(3)=1/3\).
This distinction separates two questions: whether an algebraic expression can be evaluated, and whether it represents a derivative of the stated function at that input. The first calculation at \(-3\) is possible; the second claim is not.
A Common Mistake: Extending a Formula Beyond Its Function
A frequent error is to see that \(1/x\) is defined for negative \(x\) and conclude that \((\ln x)'=1/x\) must also be valid there. This reverses the logic. The derivative formula describes the rate of change of a particular function on its domain; it does not create new values for that function.
For instance, the calculation “\((\ln x)'=1/x\), so \(f'(-2)=-1/2\)” skips the required domain check. The corrected reasoning is: \(f(-2)=\ln(-2)\) has no real value, so \(f'(-2)\) is not defined for this real function. Although \(1/(-2)=-1/2\), that number is not the derivative of \(\ln x\) at \(-2\).
Likewise, writing \(f'(0)=1/0\) is not a way to describe an infinite derivative. It is an invalid substitution into the formula, and the original function has no value at zero. In AP Calculus, keep the function’s domain attached to its derivative rule rather than treating the rule as an unrestricted algebraic expression.
Why the Restriction Is Useful
Keeping track of the domain prevents meaningless calculations and helps distinguish different functions. A logarithmic expression may have a restricted domain even when a formula that appears in its derivative is defined at more inputs. The domain check is therefore part of differentiation, not an optional preliminary step.
For \(\ln x\), the restriction also has a direct relationship to the graph. As \(x\) approaches zero from the right, \(\ln x\) decreases without bound; there is no finite function value at zero to which the graph can attach. From the left, the real logarithm is not defined at all. The derivative expression \(1/x\) likewise has no value at zero. These facts are consistent, but the decisive reason the derivative is unavailable at zero or negative inputs is that the real function \(\ln x\) is not defined there.
When checking any derivative statement involving the natural logarithm, use this order: identify the real function, check that its input is positive, and only then apply the formula \(1/x\). If the input fails the domain check, stop; there is no real derivative value to compute using that rule.
Check Your Understanding
For each question, distinguish the domain of the function from the algebraic domain of a displayed expression.
- Why does the inverse relationship between \(e^x\) and \(\ln x\) require the input to \(\ln\) to be positive?
- State the domain of \(f(x)=\ln x\) and the domain on which \(f'(x)=1/x\) is valid.
- Why is the statement \(f'(0)=1/0\) invalid for \(f(x)=\ln x\)?
- Is \(1/(-4)\) defined? Does that make it the derivative of \(\ln x\) at \(x=-4\)? Explain.
- Use the derivative rule to find \(f'(2)\) for \(f(x)=\ln x\), and state why the rule applies.