Why Differentiate These Sums Term by Term?
An expression may combine several familiar functions by addition and subtraction. Its derivative can often be found without a new rule for the entire expression: differentiate each term, keep its coefficient, and combine the results.
This tutorial focuses on sums and differences built from \(e^x\), \(a^x\), \(\ln x\), and \(\log_a x\). The key is to use both parts of the method correctly: linearity tells us how to handle the sum, while each function's basic derivative formula tells us how to handle an individual term.
The Basic Derivative Formulas
For an exponential function with positive base \(a\), the derivative is \(a^x\ln a\). The special base \(e\) gives \(\frac{d}{dx}e^x=e^x\), because \(\ln e=1\). For logarithms, the input must be positive; for \(\log_a x\), the base must also be positive and different from \(1\).
The conditions matter. The exponential functions \(e^x\) and \(a^x\) are defined for every real \(x\) when \(a>0\). In contrast, \(\ln x\) and \(\log_a x\) are real-valued only for \(x>0\). A sum containing logarithms therefore has the common domain \(x>0\), unless the expression has been defined in some other way.
Linearity of Differentiation
A function is differentiable at \(x\) if its derivative exists there. If \(f\) and \(g\) are differentiable at \(x\), then their sum and difference are differentiable at \(x\), and their derivatives are the corresponding sums and differences. For any constant \(c\), multiplying a differentiable function by \(c\) multiplies its derivative by \(c\).
Here is why the sum rule works. By the definition of derivative, the derivative of \(f+g\), if it exists, is the limit of its difference quotient. At a point where both individual derivatives exist, that quotient separates into two quotients, whose limits are \(f'(x)\) and \(g'(x)\).
The limit of a sum equals the sum of the limits when both limits exist. Replacing \(g\) by \(-g\) gives the difference rule. For a constant multiple, the difference quotient is \(c\) times the difference quotient for \(f\), so its limit is \(cf'(x)\). Repeating these rules proves the result for any finite sum.
A Reliable Term-by-Term Process
Logarithmic terms require \(x>0\); each logarithm base must be positive and not equal to \(1\).
Keep every plus or minus sign and every constant coefficient attached to its term.
Use \(a^x\ln a\) for \(a^x\), \(1/x\) for \(\ln x\), and \(1/(x\ln a)\) for \(\log_a x\).
Write the result on the domain of the original expression, then verify each term against its formula.
Worked Examples
Worked Example: A Sum with All Four Function Types
Differentiate \(f(x)=4e^x-3\cdot2^x+5\ln x-2\log_3 x\), and state its domain.
The logarithms require \(x>0\); the exponential terms are defined for every real \(x\). Thus the domain of the whole function is \(x>0\). Differentiate each term, preserving its coefficient and sign:
Check each term: \(4e^x\) differentiates to \(4e^x\); \(-3\cdot2^x\) differentiates to \(-3\cdot2^x\ln2\); \(5\ln x\) differentiates to \(5/x\); and \(-2\log_3x\) differentiates to \(-2/(x\ln3)\). These are exactly the terms in the result, with the original signs and coefficients retained.
Worked Example: Evaluating a Derivative at a Point
Let \(g(x)=7^x+2\log_5x-\ln x-3e^x\). Find \(g'(1)\).
The logarithmic terms require \(x>0\), so \(x=1\) is in the domain. First differentiate the full expression:
Now substitute \(x=1\). Since \(7^1=7\) and \(e^1=e\),
Check the substitution term by term: the derivative of \(7^x\) contributes \(7\ln7\) at \(1\); the derivative of \(2\log_5x\) contributes \(2/\ln5\); that of \(-\ln x\) contributes \(-1\); and that of \(-3e^x\) contributes \(-3e\). The displayed value includes all four contributions.
Worked Example: A Logarithm with a Base Between Zero and One
Differentiate \(h(x)=6\cdot4^x-2\log_{1/2}x+3\ln x\), and find \(h'(1)\).
The base \(1/2\) is positive and is not \(1\), so \(\log_{1/2}x\) is valid when \(x>0\). This is also the domain of \(h\). Apply the formulas:
Because \(\ln(1/2)=-\ln2\), the logarithm term may also be written with a positive sign:
Therefore,
where \(\ln4=2\ln2\). For a check, at \(x=1\) the exponential derivative is \(6\cdot4\ln4=24\ln4\); the negative coefficient on the base-\(1/2\) logarithm produces a positive contribution \(2/\ln2\); and \(3\ln x\) contributes \(3\). The evaluated result matches all three terms.
Common Mistake: Dropping the Logarithm of the Base
A frequent error is to treat the derivative of \(a^x\) as \(a^x\) for every base. That is true for the special base \(e\), but not generally. For example, writing \(\frac{d}{dx}2^x=2^x\) would omit the factor \(\ln2\).
The correction is to apply the appropriate formula to each exponential separately:
The base factor is also essential for logarithms. In particular, \(\frac{d}{dx}\log_a x\) is not simply \(1/x\) unless the base is \(e\), in which case \(\log_e x=\ln x\). Keeping the formulas side by side helps prevent both errors.
| Function | Derivative | Condition |
|---|---|---|
| \(e^x\) | \(e^x\) | All real \(x\) |
| \(a^x\) | \(a^x\ln a\) | \(a>0\), all real \(x\) |
| \(\ln x\) | \(1/x\) | \(x>0\) |
| \(\log_a x\) | \(1/(x\ln a)\) | \(a>0\), \(a\ne1\), \(x>0\) |
Why the Domain Check Matters
Linearity does not make an undefined term valid. If an expression contains \(\ln x\) or \(\log_a x\), its real-valued domain excludes \(x\leq0\). A derivative formula for the sum is therefore stated only on the common domain where every original term is defined. For example, although \(e^x\) is defined for all real \(x\), the function \(e^x+\ln x\) is defined only for \(x>0\).
It is also important to distinguish a sum from a product. Linearity applies when terms are added or subtracted and when a term is multiplied by a constant. It does not say that the derivative of a product of two variable functions is the product of their derivatives. In this tutorial, expressions are handled term by term because their pieces are joined by addition or subtraction.
Check Your Understanding
For each question, state any domain restriction as well as the derivative where requested.
- Differentiate \(p(x)=3e^x+2^x\).
- Differentiate \(q(x)=4\ln x-5\log_2x\).
- For \(r(x)=3^x-\log_4x\), find \(r'(1)\).
- Differentiate \(s(x)=2\cdot5^x+3\log_{1/3}x\). Why can the logarithm derivative be expressed using a negative \(\ln(1/3)\)?
- Identify and correct the error in the claim \(\frac{d}{dx}(e^x+10^x)=e^x+10^x\).