Tutorials › AP Calculus › Differentiating Sums of Exponential and Logarithmic Functions

Trigonometric and Exponential Derivatives · Tutorial 154 of 999

Differentiating Sums of Exponential and Logarithmic Functions

Use the basic exponential and logarithmic derivative formulas term by term, with the correct coefficients and domain conditions.

Intermediate 9 min read

What You'll Learn

  • Apply the sum, difference, and constant-multiple rules to exponential and logarithmic terms
  • Differentiate \(e^x\) and \(a^x\) using the correct base-dependent formulas
  • Differentiate \(\ln x\) and \(\log_a x\) on their domains
  • Check the domain of a sum before stating its derivative
  • Identify and correct common errors with exponential and logarithmic derivatives

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.

Central rule: The derivative of a finite sum is the sum of the derivatives, and a constant coefficient remains as a factor. Apply this rule only where all the terms in the original expression are defined and differentiable.

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\).

Basic formulas: For \(a>0\) and \(x\in\mathbb{R}\), \(\frac{d}{dx}a^x=a^x\ln a\). For \(x>0\), \(\frac{d}{dx}\ln x=\frac{1}{x}\). If \(a>0\), \(a\ne1\), and \(x>0\), then \(\frac{d}{dx}\log_a x=\frac{1}{x\ln a}\).

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\).

Theorem: If \(f\) and \(g\) are differentiable at \(x\), and \(c\) is a constant, then $$ \frac{d}{dx}\bigl(f(x)+g(x)\bigr)=f'(x)+g'(x), \qquad \frac{d}{dx}\bigl(f(x)-g(x)\bigr)=f'(x)-g'(x), \qquad \frac{d}{dx}\bigl(cf(x)\bigr)=cf'(x). $$ The same rules apply repeatedly to any finite sum of differentiable terms.

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)\).

$$ \begin{aligned} \frac{(f+g)(x+h)-(f+g)(x)}{h} &= \frac{f(x+h)-f(x)}{h} + \frac{g(x+h)-g(x)}{h},\\ \lim_{h\to0}\frac{(f+g)(x+h)-(f+g)(x)}{h} &= \lim_{h\to0}\frac{f(x+h)-f(x)}{h} + \lim_{h\to0}\frac{g(x+h)-g(x)}{h}\\ &=f'(x)+g'(x). \end{aligned} $$

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

1
Check the domain.
Logarithmic terms require \(x>0\); each logarithm base must be positive and not equal to \(1\).
2
Separate the terms.
Keep every plus or minus sign and every constant coefficient attached to its term.
3
Apply the matching basic formula.
Use \(a^x\ln a\) for \(a^x\), \(1/x\) for \(\ln x\), and \(1/(x\ln a)\) for \(\log_a x\).
4
Combine and check.
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:

$$ \begin{aligned} f'(x) &=4\frac{d}{dx}(e^x)-3\frac{d}{dx}(2^x) +5\frac{d}{dx}(\ln x)-2\frac{d}{dx}(\log_3 x)\\ &=4e^x-3(2^x\ln 2)+5\left(\frac{1}{x}\right) -2\left(\frac{1}{x\ln 3}\right)\\ &=4e^x-3\cdot2^x\ln 2+\frac{5}{x}-\frac{2}{x\ln 3}, \qquad x>0. \end{aligned} $$

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:

$$ \begin{aligned} g'(x) &=7^x\ln7+\frac{2}{x\ln5}-\frac{1}{x}-3e^x. \end{aligned} $$

Now substitute \(x=1\). Since \(7^1=7\) and \(e^1=e\),

$$ \begin{aligned} g'(1) &=7\ln7+\frac{2}{1\ln5}-\frac{1}{1}-3e\\ &=7\ln7+\frac{2}{\ln5}-1-3e. \end{aligned} $$

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:

$$ \begin{aligned} h'(x) &=6\cdot4^x\ln4-2\left(\frac{1}{x\ln(1/2)}\right)+\frac{3}{x}\\ &=6\cdot4^x\ln4-\frac{2}{x\ln(1/2)}+\frac{3}{x}. \end{aligned} $$

Because \(\ln(1/2)=-\ln2\), the logarithm term may also be written with a positive sign:

$$ -\frac{2}{x\ln(1/2)} = -\frac{2}{x(-\ln2)} = \frac{2}{x\ln2}. $$

Therefore,

$$ \begin{aligned} h'(1) &=6\cdot4^1\ln4+\frac{2}{1\ln2}+\frac{3}{1}\\ &=24\ln4+\frac{2}{\ln2}+3\\ &=48\ln2+\frac{2}{\ln2}+3, \end{aligned} $$

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\).

$$ \text{Incorrect: }\frac{d}{dx}(2^x+e^x)=2^x+e^x $$

The correction is to apply the appropriate formula to each exponential separately:

$$ \frac{d}{dx}(2^x+e^x)=2^x\ln2+e^x. $$

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.

FunctionDerivativeCondition
\(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.

Takeaway: First establish where the expression is defined. Then preserve each coefficient and sign, differentiate each exponential or logarithm with its own basic formula, and combine the terms using linearity.

Check Your Understanding

For each question, state any domain restriction as well as the derivative where requested.

  1. Differentiate \(p(x)=3e^x+2^x\).
  2. Differentiate \(q(x)=4\ln x-5\log_2x\).
  3. For \(r(x)=3^x-\log_4x\), find \(r'(1)\).
  4. Differentiate \(s(x)=2\cdot5^x+3\log_{1/3}x\). Why can the logarithm derivative be expressed using a negative \(\ln(1/3)\)?
  5. Identify and correct the error in the claim \(\frac{d}{dx}(e^x+10^x)=e^x+10^x\).

Test yourself: AP Calculus practice exams

Ready to check what you know? Work an AP-style practice exam, then open the full solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers all of AP Calculus AB & BC: full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon
Clinical Biostats