Tutorials › Calculus III › Exponential and Logarithmic Partial Derivatives

Computing Partial Derivatives · Tutorial 310 of 999

Exponential and Logarithmic Partial Derivatives

Apply exponential and logarithmic derivative rules to partial derivatives while keeping track of the domain of each logarithmic term.

Beginner 9 min read

What You'll Learn

  • Differentiate \(e^x\) and \(a^x\) with respect to their variable
  • Apply the chain rule to exponential expressions with variable exponents
  • Differentiate natural logarithms of individual variables
  • State the domain restrictions created by logarithmic terms
  • Combine exponential and logarithmic rules with the product rule
  • Identify and correct common errors with exponential derivatives

Introduction

Exponential and logarithmic expressions appear in many functions of several variables. Their partial derivatives follow familiar one-variable rules, but the variable being differentiated must be identified carefully. In each partial derivative, all other variables are held fixed.

For logarithmic terms, there is an additional issue: their inputs must lie in the logarithm's domain. A formula for a partial derivative is only valid at points where the original function is defined.

Key idea: Differentiate an exponential or logarithmic expression with respect to the variable that changes, treating other variables as constants. For natural logarithms, also require that each logarithm's input be positive.

Basic Exponential and Logarithmic Rules

The natural exponential function \(e^x\) is defined for every real \(x\), and its derivative is itself. If \(a\) is a positive constant, then \(a^x\) is also defined for every real \(x\). Its derivative includes the factor \(\ln a\).

$$ \frac{d}{dx}e^x=e^x, \qquad \frac{d}{dx}a^x=a^x\ln a \quad (a>0). $$

The second formula also applies when \(a=1\): its right-hand side is \(1^x\ln 1=0\), as expected because \(1^x=1\). The base \(a\) must be positive for the usual real-valued definition of \(a^x\) for arbitrary real \(x\).

The natural logarithm \(\ln x\) is defined only when \(x>0\), and its derivative is \(1/x\). When its input is a differentiable function \(u\), the chain rule gives the corresponding composite formula.

$$ \frac{d}{dx}\ln x=\frac{1}{x} \quad (x>0), \qquad \frac{d}{dx}\ln u(x)=\frac{u'(x)}{u(x)} \quad (u(x)>0). $$

For a logarithm to base \(b\), the base must satisfy \(b>0\) and \(b\ne 1\), and the input must be positive. Since \(\log_b x=\ln x/\ln b\), its derivative is \(1/(x\ln b)\). In what follows, \(\ln\) denotes the natural logarithm.

Domain condition: A term \(\ln x\) requires \(x>0\), and a term \(\ln y\) requires \(y>0\). Exponential terms such as \(e^x\) and \(a^y\), with fixed \(a>0\), impose no further restrictions on real \(x\) or \(y\).

Why the Exponential and Logarithmic Rules Work

The rule for \(a^u\) follows by rewriting the expression using the natural exponential. For \(a>0\), the identity \(a^u=e^{u\ln a}\) holds. If \(u=u(t)\), differentiating this expression with the chain rule gives the result.

$$ \frac{d}{dt}a^{u(t)} = \frac{d}{dt}e^{u(t)\ln a} = e^{u(t)\ln a}\,\ln a\,u'(t) = a^{u(t)}\ln a\,u'(t). $$

This derivation explains both parts of the formula: the factor \(\ln a\) comes from differentiating the exponent \(u\ln a\), and the factor \(u'(t)\) comes from the chain rule. For \(e^{u(t)}\), the same reasoning yields \(e^{u(t)}u'(t)\), because the coefficient corresponding to \(\ln a\) is \(\ln e=1\).

The logarithm rule can be justified in a similar way. Suppose \(u(t)>0\), and set \(g(t)=\ln u(t)\). Then \(e^{g(t)}=u(t)\). Differentiating both sides and using the chain rule gives \(e^{g(t)}g'(t)=u'(t)\). Since \(e^{g(t)}=u(t)\), division by the positive quantity \(u(t)\) gives \(g'(t)=u'(t)/u(t)\).

Partial Derivatives of Exponentials and Logarithms

For a function \(f(x,y)\), the partial derivative \(f_x\) differentiates with respect to \(x\) while \(y\) is fixed; \(f_y\) differentiates with respect to \(y\) while \(x\) is fixed. Thus, when differentiating \(e^{x}\) with respect to \(x\), the usual exponential rule applies. If the exponent contains both variables, the chain rule also applies to the changing exponent.

For example, in \(a^{x+2y}\), differentiating with respect to \(x\) gives a factor of \(1\) from the exponent, while differentiating with respect to \(y\) gives a factor of \(2\). The base \(a\) remains constant in both derivatives.

$$ \frac{\partial}{\partial x}a^{x+2y} = a^{x+2y}\ln a, \qquad \frac{\partial}{\partial y}a^{x+2y} = 2a^{x+2y}\ln a, \quad (a>0). $$

Likewise, \(\partial(\ln x)/\partial x=1/x\) where \(x>0\). If differentiating \(\ln x\) with respect to \(y\), then \(x\) is fixed; the expression is constant with respect to that differentiation. The same principle applies to \(\ln y\) when differentiating with respect to \(x\). These facts do not remove the domain restrictions: a function containing \(\ln x\) is still defined only where \(x>0\).

Worked Examples

Worked Example: Separate Exponential and Logarithmic Terms

Find both first partial derivatives of \(f(x,y)=e^x+2^y+\ln x+3\ln y\), and state the domain.

The term \(\ln x\) requires \(x>0\), and \(3\ln y\) requires \(y>0\). The exponential terms are defined for all real \(x\) and \(y\). Therefore the domain is \(x>0,\ y>0\).

For \(f_x\), hold \(y\) fixed. The term \(e^x\) differentiates to \(e^x\), and \(\ln x\) differentiates to \(1/x\). The terms \(2^y\) and \(3\ln y\) are constant with respect to \(x\). Thus

$$ f_x(x,y)=e^x+\frac{1}{x}. $$

For \(f_y\), hold \(x\) fixed. The derivative of \(2^y\) is \(2^y\ln 2\), and the derivative of \(3\ln y\) is \(3/y\). The other two terms are constant with respect to \(y\). Hence

$$ f_y(x,y)=2^y\ln 2+\frac{3}{y}. $$

To check, fix \(y=c>0\). The resulting one-variable function is \(e^x+2^c+\ln x+3\ln c\), whose derivative is \(e^x+1/x\), as found for \(f_x\). Fixing \(x=c>0\) gives \(e^c+2^y+\ln c+3\ln y\), whose derivative is \(2^y\ln 2+3/y\), as found for \(f_y\).

Worked Example: Variable Exponents and Logarithmic Domains

Find \(f_x\) and \(f_y\) for \(f(x,y)=e^{2x-y}+3^{x+2y}+\ln x-2\ln y\). State the domain.

The logarithms require \(x>0\) and \(y>0\), so the domain is the region where both inequalities hold. For the first exponential, the exponent \(2x-y\) has partial derivatives \(2\) with respect to \(x\) and \(-1\) with respect to \(y\). For the second exponential, the exponent \(x+2y\) has partial derivatives \(1\) and \(2\), respectively.

Differentiating with respect to \(x\) gives

$$ \begin{aligned} f_x(x,y) &=2e^{2x-y} +3^{x+2y}\ln 3 +\frac{1}{x}. \end{aligned} $$

The first term includes the factor \(2\) from differentiating \(2x-y\). The logarithmic term \(-2\ln y\) contributes nothing to this derivative because \(y\) is fixed.

Differentiating with respect to \(y\) gives

$$ \begin{aligned} f_y(x,y) &=-e^{2x-y} +2\cdot 3^{x+2y}\ln 3 -\frac{2}{y}. \end{aligned} $$

Here the first exponential has the factor \(-1\) from its exponent, and the second has the factor \(2\). The derivative of \(-2\ln y\) is \(-2/y\).

As a check, fix \(y=c>0\). Differentiating \(e^{2x-c}+3^{x+2c}+\ln x-2\ln c\) with respect to \(x\) gives \(2e^{2x-c}+3^{x+2c}\ln 3+1/x\). Fixing \(x=c>0\) instead gives the one-variable function \(e^{2c-y}+3^{c+2y}+\ln c-2\ln y\), whose derivative is \(-e^{2c-y}+2\cdot 3^{c+2y}\ln 3-2/y\). Both checks agree with the formulas.

Worked Example: Combining the Product Rule with a Logarithm

Find the partial derivatives and domain of \(f(x,y)=xe^y+2^x\ln y+\ln x\).

The term \(\ln y\) requires \(y>0\), and \(\ln x\) requires \(x>0\). Thus the domain is \(x>0,\ y>0\). For \(f_x\), the factor \(e^y\) is constant with respect to \(x\), so the derivative of \(xe^y\) is \(e^y\). The derivative of \(2^x\ln y\) with respect to \(x\) is \(2^x\ln 2\) multiplied by the fixed factor \(\ln y\). Finally, \(\ln x\) contributes \(1/x\).

$$ f_x(x,y)=e^y+2^x\ln 2\,\ln y+\frac{1}{x}. $$

For \(f_y\), the term \(xe^y\) differentiates to \(xe^y\), since \(x\) is fixed. In \(2^x\ln y\), the factor \(2^x\) is fixed and \(\ln y\) differentiates to \(1/y\). The term \(\ln x\) is fixed. Therefore

$$ f_y(x,y)=xe^y+\frac{2^x}{y}. $$

For a check of \(f_x\), fix \(y=c>0\). The slice is \(xe^c+2^x\ln c+\ln x\). Its derivative is \(e^c+2^x\ln 2\,\ln c+1/x\). For a check of \(f_y\), fix \(x=c>0\). The slice is \(ce^y+2^c\ln y+\ln c\), whose derivative is \(ce^y+2^c/y\). These are the stated partial derivatives.

A Common Exponential-Derivative Error

A frequent mistake is to treat an exponential such as \(5^x\) as if it were a power of \(x\). The power rule applies to expressions like \(x^5\), not to \(5^x\). For instance, the incorrect calculation

$$ \frac{d}{dx}5^x=x5^{x-1} $$

uses the base as though it were the variable and the exponent as though it were fixed. The correct rule is

$$ \frac{d}{dx}5^x=5^x\ln 5. $$

The distinction is visible by rewriting \(5^x=e^{x\ln 5}\). Differentiating gives \(e^{x\ln 5}\ln 5=5^x\ln 5\). In a partial derivative such as \(\partial(5^y)/\partial x\), \(y\) is fixed; it is not the case that the power rule should be applied to \(5^y\) as a function of \(x\).

Another error is to write \(1/x\) as the derivative of \(\ln x\) without checking that \(x>0\). The formula does not extend the real-valued logarithm to nonpositive inputs. A derivative expression must be interpreted on the domain of the original function.

Why Domain Conditions Matter

Domain restrictions are part of the function, not an optional note attached after differentiation. For example, the formulas for the derivatives of \(\ln x\) and \(\ln y\) require positive inputs, and a function containing both terms is defined only where both restrictions hold. Exponential terms may be defined more broadly, but they do not cancel or remove a logarithm's domain requirement.

Carefully recording the domain also keeps derivative formulas meaningful: denominators such as \(x\) and \(y\) in logarithmic derivatives cannot be zero, and the original logarithms already require those variables to be positive. When a function combines several terms, first collect the restrictions from every logarithmic term, then differentiate on that domain.

Takeaway: For a positive constant base \(a\), the derivative of \(a^u\) is \(a^u\ln(a)\) times the derivative of \(u\). The derivative of \(\ln u\) is \(u'/u\), provided \(u>0\). In partial derivatives, apply these rules to the variable that changes and retain every logarithmic domain restriction.

Check Your Understanding

Work through these questions, keeping the relevant domains in view.

  1. Differentiate \(e^{3x}\) with respect to \(x\).
  2. Find both first partial derivatives of \(2^{x-y}\), assuming \(x\) and \(y\) are real.
  3. What domain restrictions are required for \(g(x,y)=\ln x+4\ln y\)?
  4. Differentiate \(\ln(2x+1)\) with respect to \(x\), and state the condition on \(x\).
  5. Identify the error in the claim that the derivative of \(7^x\) is \(x7^{x-1}\), then give the correct derivative.