Why a Composite Exponent Needs the Chain Rule
The functions \(e^x\) and \(2^x\) have exponent \(x\), the simplest possible input. In practice the exponent is often itself a function: \(e^{x^2+3x}\), \(2^{\sin x}\), or \(e^{\cos 3x}\). Each of these is a composition. An outer exponential function is applied to an inner function \(g(x)\), so the derivative must account for how fast the inner function is changing.
The basic exponential derivatives are \(\dfrac{d}{dx}e^x=e^x\) and \(\dfrac{d}{dx}a^x=a^x\ln a\) for a constant \(a>0\). They apply only when the exponent is exactly \(x\). When the exponent is \(g(x)\), a correction factor \(g'(x)\) appears, exactly as in every other chain-rule problem.
In words: keep the exponential function unchanged, multiply by \(\ln a\) when the base is not \(e\), and then multiply by the derivative of the exponent.
Why the Rules Work
Let \(u=g(x)\). Then \(e^{g(x)}\) is the composition \(e^u\), where \(u\) depends on \(x\). The chain rule says that the derivative of the composition is the derivative of the outer function, evaluated at the inner function, times the derivative of the inner function:
For a general base, rewrite \(a^{g(x)}=e^{g(x)\ln a}\). The exponent \(g(x)\ln a\) has derivative \(g'(x)\ln a\), because \(\ln a\) is a constant. Applying the \(e^{g}\) rule gives \(a^{g(x)}\,(\ln a)\,g'(x)\). The base \(e\) is the special case in which \(\ln e=1\), so the extra factor disappears.
Worked Examples
Worked Example: A Polynomial Exponent
Differentiate \(f(x)=e^{x^2+3x}\).
The inner function is \(g(x)=x^2+3x\), so \(g'(x)=2x+3\). Keep the exponential and multiply by \(g'(x)\):
Check at \(x=0\): \(f(0)=e^0=1\) and \(f'(0)=3\cdot1=3\). A quick estimate agrees, since near \(x=0\) the exponent is about \(3x\) and \(e^{3x}\) has slope \(3\) at the origin.
Worked Example: A Trigonometric Exponent with Base 2
Differentiate \(h(x)=2^{\sin x}\).
Here \(a=2\) and \(g(x)=\sin x\), so \(g'(x)=\cos x\). The base is not \(e\), so the factor \(\ln 2\) is required:
Check at \(x=0\): \(h'(0)=2^0\,(\ln2)(1)=\ln 2\approx0.693\). At \(x=\pi/2\), \(h'(\pi/2)=0\) because \(\cos(\pi/2)=0\). That matches the fact that \(\sin x\) has a maximum at \(\pi/2\), so the exponent is momentarily constant there.
Worked Example: A Composite Exponent with a Constant Multiple
Differentiate \(k(x)=e^{\cos 3x}\).
The exponent \(g(x)=\cos 3x\) is itself a composite function, so \(g'(x)=-3\sin 3x\) by a second application of the chain rule. Then
Check: at \(x=0\), \(\sin 0=0\), so \(k'(0)=0\). That is reasonable, because \(\cos 3x\) has a maximum at \(x=0\), and \(k\) has a relative maximum there with value \(e\).
Worked Example: An Exponential Inside an Exponential
Differentiate \(m(x)=e^{e^x}\).
The exponent is \(g(x)=e^x\), and \(g'(x)=e^x\). Therefore
The result can be written either way. Because \(m'(x)\) is a product of positive factors, the function \(m\) is increasing for every real \(x\).
Reading the Derivative: What the Extra Factor Means
The factor \(g'(x)\) in \(\dfrac{d}{dx}e^{g(x)}=e^{g(x)}g'(x)\) is not just bookkeeping. It tells you how the exponent is moving. Because \(e^{g(x)}\) is always positive, the sign of the derivative is the sign of \(g'(x)\). Whenever the exponent is increasing, the whole function is increasing, and whenever the exponent is decreasing, so is the function. The exponential only changes how steeply the function responds.
That observation gives a fast way to analyze a function such as \(e^{g(x)}\): study the simpler function \(g\) first. Critical points of \(e^{g(x)}\) occur exactly where \(g'(x)=0\), and a maximum of \(g\) corresponds to a maximum of \(e^{g}\).
Worked Example: Finding a Maximum
Find the relative extremum of \(f(x)=e^{2x-x^2}\).
The exponent is \(g(x)=2x-x^2\), so \(g'(x)=2-2x\) and
Since the exponential factor is positive, \(f'(x)=0\) only at \(x=1\). For \(x<1\), \(2-2x>0\), so \(f\) is increasing, and for \(x>1\), \(2-2x<0\), so \(f\) is decreasing. The sign change from positive to negative shows a relative maximum at \(x=1\), where \(f(1)=e^{2-1}=e\). The tangent line there is horizontal: \(y=e\).
Worked Example: Growth with a Scaled Exponent
A population is modeled by \(P(t)=500\cdot2^{t/3}\), where \(t\) is measured in years. Find the rate at which the population is changing at \(t=6\).
The base is \(2\) and the exponent is \(g(t)=\tfrac t3\), with \(g'(t)=\tfrac13\). Therefore
At \(t=6\), \(P(6)=500\cdot2^2=2000\) and \(P'(6)=2000\cdot\dfrac{\ln2}{3}\approx462.1\). The population is growing at about \(462\) individuals per year. Check the units: the derivative of a population in individuals with respect to time in years is measured in individuals per year. The ratio \(P'/P=\dfrac{\ln2}{3}\approx0.231\) is constant, which is the signature of exponential growth.
Combining Composite Exponents with Other Rules
Composite exponentials often appear inside products and quotients, so the exponential rule is usually one step in a longer calculation. Treat the exponential as a single factor, differentiate it with the rule above, and then continue with the product or quotient rule. The most common source of errors is losing track of which step has been completed, so write the intermediate derivative explicitly.
Worked Example: A Product with an Exponential
Differentiate \(y=x^2e^{3x}\).
Use the product rule with \(u=x^2\) and \(v=e^{3x}\). The derivative of \(v\) needs the composite-exponent rule: \(v'=3e^{3x}\). Then
Check at \(x=1\): \(y'(1)=e^3(5)\approx100.4\), while the two pieces \(2e^3\) and \(3e^3\) sum to \(5e^3\), as expected.
Worked Example: A Quotient with an Exponential
Differentiate \(y=\dfrac{e^{2x}}{x}\) for \(x\neq0\).
Use the quotient rule with numerator derivative \(2e^{2x}\) from the composite-exponent rule:
The sign of \(y'\) is the sign of \(2x-1\), so the function is decreasing for \(0
In both examples, the composite-exponent rule supplies the derivative of one factor, and the usual product or quotient rule does the rest. Practicing the pieces separately makes the combined problems routine.
Common Mistakes
Forgetting the inner derivative. Writing \(\frac{d}{dx}e^{x^2}=e^{x^2}\) drops the factor \(2x\). A reliable test is \(x=1\): the true slope of \(e^{x^2}\) at \(x=1\) is \(2e\approx5.44\), not \(e\approx2.72\).
Forgetting \(\ln a\). For \(2^{\sin x}\), the factor \(\ln 2\) is part of the derivative. Leaving it out is correct only when the base is \(e\).
Using the power rule on an exponential. The expression \(e^{g(x)}\) has a variable exponent, so the power rule \(\frac{d}{dx}x^n=nx^{n-1}\) does not apply. Never write \(\frac{d}{dx}e^{x^2}=x^2e^{x^2-1}\).
Mixing up which function is inside. In \(e^{\cos 3x}\), the cosine is inside the exponential, so the answer contains \(\sin 3x\), not \(\cos\) of anything else. Reading the expression from the outside in prevents this slip.
A Reliable Procedure
Write the function as \(a^{g(x)}\) or \(e^{g(x)}\), and name \(g(x)\) explicitly.
Compute \(g'(x)\), using the chain rule again if the exponent is itself composite.
Keep the exponential, include \(\ln a\) if the base is not \(e\), and multiply by \(g'(x)\).
Evaluate the original function and its derivative at a convenient point, such as \(x=0\), and see whether the sign and size are plausible.
This pattern is the basis for later work on logarithms of composite arguments, implicit differentiation with exponentials, and related-rates models with exponential growth and decay, where the exponent is almost always a function of time.
Check Your Understanding
- Differentiate \(f(x)=e^{5x-2}\). What is \(f'(0)\)?
- Differentiate \(g(x)=3^{x^2}\). Which factor in your answer is easy to forget?
- Differentiate \(h(x)=e^{\sin x}\) and find where \(h'(x)=0\) on \([0,2\pi]\).
- Find the derivative of \(p(x)=e^{-x^2}\) and explain why \(p\) has a maximum at \(x=0\).
- A student writes \(\frac{d}{dx}e^{\sqrt{x}}=e^{\sqrt{x}}\). What is missing, and what is the correct derivative?