Class 12 Maths, Worked in Full Past papersGet updates
Chapter 5 · Continuity and Differentiability

Example 28: Derivative of axa^x is axlog⁡aa^x\log a

ExamplesLogarithmic differentiation · Section 5.5
The question

Differentiate axa^x w.r.t. xx⁠, where aa is a positive constant.

Exam answer

Let y=axy = a^x⁠, where a>0a > 0⁠, so y>0y > 0⁠. Taking log on both sides,

log⁡y=xlog⁡a\log y = x\log a

Differentiating both sides w.r.t. xx⁠,

1y⋅dydx=log⁡a\frac1y\cdot\frac{dy}{dx} = \log a ⇒ dydx=ylog⁡a\Rightarrow\ \frac{dy}{dx} = y\log a

∴ ddx(ax)=axlog⁡a\therefore\ \dfrac{d}{dx}(a^x) = a^x\log a⁠.

Want the reason behind every step, the basics and the checks?

The one idea this problem is built on

In axa^x the variable is in the exponent, so the power rule ddxxn=nxn−1\frac{d}{dx}x^n = nx^{n-1} (which needs a fixed exponent) does not apply. Taking logs brings the exponent down: log⁡(ax)=xlog⁡a\log(a^x) = x\log a⁠, which is just a constant times xx⁠. Differentiating gives dydx=axlog⁡a\frac{dy}{dx} = a^x\log a⁠. Equivalently, ax=exlog⁡aa^x = e^{x\log a}⁠, and the chain rule gives the same result.

Given, to find, and the plan
Given
y=axy = a^x⁠, with a>0a > 0 a constant and xx any real number.
To find
dydx\frac{dy}{dx}⁠.
Plan
Method 1: logarithmic differentiation. Method 2: rewrite axa^x as a power of ee and use the chain rule. Then interpret the factor log⁡a\log a⁠.

Basics you need

1Logs of powers

log⁡pn=nlog⁡p\log p^n = n\log p for p>0p > 0 and any real nn (Section 5.4 proves it for positive integers nn and states, without proof, that it holds for every real nn⁠). Basics: exponentials and logarithms

2a=elog⁡aa = e^{\log a} for a>0a > 0

This is Example 25 with x=ax = a⁠. Raising both sides to the power xx⁠: ax=exlog⁡aa^x = e^{x\log a}⁠. Basics: exponentials and logarithms

3Derivatives used

ddxex=ex\frac{d}{dx}e^x = e^x⁠, ddxlog⁡x=1x\frac{d}{dx}\log x = \frac1x (Theorem 5); a constant times xx differentiates to that constant. Basics: derivative rules

Solution

  1. yy is positive, so we may take its logarithm

    Let y=axy = a^x⁠. Since a>0a > 0⁠, ax>0a^x > 0 for every real xx⁠. So log⁡y\log y exists, and by the power law for logs

    log⁡y=log⁡(ax)=xlog⁡a.\log y = \log(a^x) = x\log a.
    Logarithmic differentiation needs the function to be positive (Section 5.5), and here it is, for every xx⁠. Note that log⁡a\log a is a fixed number (for example log⁡2≈0.6931\log 2 \approx 0.6931⁠): the right side is a constant multiple of xx⁠, the simplest thing to differentiate.
    log⁡pn=nlog⁡p\log p^n = n\log p with p=ap = a⁠, n=xn = x (Section 5.4). Basics: exponentials and logarithms
  2. Differentiate both sides with respect to xx

    Left: chain rule with outer log⁡\log⁠, inner yy⁠. Right: log⁡a\log a is a constant.

    1y⋅dydx=log⁡a.\frac1y\cdot\frac{dy}{dx} = \log a.
    ddx(x⋅c)=c\frac{d}{dx}(x\cdot c) = c for a constant cc⁠; here c=log⁡ac = \log a⁠. The common slip is to treat log⁡a\log a as if it depended on xx⁠. It does not: aa is a constant.
    ddxlog⁡y=1ydydx\frac{d}{dx}\log y = \frac1y\frac{dy}{dx} (Theorem 5 and the chain rule). Lesson: logarithmic differentiation
  3. Solve for dydx\frac{dy}{dx}

    dydx=ylog⁡a=axlog⁡a.\frac{dy}{dx} = y\log a = a^x\log a.
    Multiply both sides by yy (allowed, as y≠0y \ne 0⁠) and substitute y=axy = a^x back.
    Rearranging an equation. Basics: solving for dy/dx
  4. Method 2: write axa^x as a power of ee

    Since a=elog⁡aa = e^{\log a} (Example 25, valid as a>0a > 0⁠), we have ax=(elog⁡a)x=exlog⁡aa^x = \left(e^{\log a}\right)^x = e^{x\log a}⁠. Now use the chain rule with inner t=xlog⁡at = x\log a (so dtdx=log⁡a\frac{dt}{dx} = \log a⁠) and outer ete^t⁠:

    ddx(ax)=ddx(exlog⁡a)=exlog⁡a⋅ddx(xlog⁡a)=exlog⁡a⋅log⁡a=axlog⁡a.\begin{aligned} \frac{d}{dx}\left(a^x\right) &= \frac{d}{dx}\left(e^{x\log a}\right) \\ &= e^{x\log a}\cdot\frac{d}{dx}(x\log a) \\ &= e^{x\log a}\cdot\log a \\ &= a^x\log a. \end{aligned}
    This is the book's "Alternatively". It shows that every exponential function is really exe^x with a stretched input: ax=e(log⁡a)xa^x = e^{(\log a)x}⁠. The stretch factor log⁡a\log a comes out as the inner derivative. Both methods agree, as they must.
    (pm)n=pmn(p^m)^n = p^{mn}⁠; ddxet=et\frac{d}{dx}e^t = e^t (Theorem 5); chain rule (Theorem 4). Lesson: exponential and logarithmic functions
  5. What the factor log⁡a\log a tells us

    • a=ea = e⁠: log⁡e=1\log e = 1⁠, so ddxex=ex\frac{d}{dx}e^x = e^x⁠, which is Theorem 5 again.
    • a=1a = 1⁠: log⁡1=0\log 1 = 0⁠, so the derivative is 00⁠. Indeed 1x=11^x = 1 is constant.
    • a>1a > 1⁠: log⁡a>0\log a > 0⁠, so axa^x is increasing. 0<a<10 < a < 1⁠: log⁡a<0\log a < 0⁠, so axa^x is decreasing.
    x y −2 −1 1 2 1 2 3 4 y = 2^x y = (1/2)^x slope log 2 ≈ 0.693 slope log(1/2) ≈ −0.693
    y=2xy = 2^x (blue) and y=(12)xy = \left(\frac12\right)^x (gold), equal scales. Both pass through (0,1)(0, 1)⁠. There the slopes are 20log⁡2=log⁡2≈0.6932^0\log 2 = \log 2 \approx 0.693 and log⁡12=−log⁡2≈−0.693\log\frac12 = -\log 2 \approx -0.693 (dashed tangents).
    At x=0x = 0⁠, a0=1a^0 = 1⁠, so the slope there is exactly log⁡a\log a⁠. Everywhere else the slope is log⁡a\log a times the height axa^x⁠: an exponential function grows (or shrinks) at a rate proportional to its own size.
    log⁡a>0  ⟺  a>1\log a > 0 \iff a > 1⁠, because log⁡\log is increasing with log⁡1=0\log 1 = 0 (Section 5.4). Basics: exponentials and logarithms
Result

ddx(ax)=axlog⁡a\dfrac{d}{dx}\left(a^x\right) = a^x\log a for every real xx⁠, where a>0a > 0 is a constant. (This is the book's result, by both of its methods.)

Check it with numbers

Take a=2a = 2⁠, x=3x = 3⁠: 23log⁡2=8×0.69314722^3\log 2 = 8\times 0.6931472 =5.5451774…= 5.5451774\ldots⁠. The central difference quotient 23.0001−22.99990.0002\frac{2^{3.0001} - 2^{2.9999}}{0.0002} gives 5.54517745.5451774⁠, agreeing to 7 decimal places. The tempting wrong answer x ax−1=3⋅22=12x\,a^{x-1} = 3\cdot 2^2 = 12 is far off.

Common mistakes
  1. Using the power rule: ddxax=x ax−1\frac{d}{dx}a^x = x\,a^{x-1} is wrong. The power rule is for xnx^n with a fixed exponent nn⁠.
  2. Forgetting the factor log⁡a\log a, i.e. treating every exponential like exe^x⁠.
  3. Differentiating log⁡a\log a as if it were 1a\frac1a⁠. aa is a constant, so log⁡a\log a is a constant.
What to take away
  1. ddxax=axlog⁡a\frac{d}{dx}a^x = a^x\log a (a>0a > 0⁠); compare ddxxn=nxn−1\frac{d}{dx}x^n = nx^{n-1}⁠. Variable in the exponent and variable in the base need different rules.
  2. With the chain rule: ddxag(x)=ag(x)log⁡a⋅g′(x)\frac{d}{dx}a^{g(x)} = a^{g(x)}\log a\cdot g'(x)⁠.
  3. Any axa^x can be written exlog⁡ae^{x\log a}⁠; this is the trick behind logarithmic differentiation of uvu^v in Example 29.

Every fact used, and where it comes from

FactUsed inSource
log⁡pn=nlog⁡p\log p^n = n\log p for real nnStep 1Section 5.4
Logarithmic differentiation needs a positive functionSteps 1–3Section 5.5 (Lesson: logarithmic differentiation)
ddxex=ex\frac{d}{dx}e^x = e^x⁠; ddxlog⁡x=1x\frac{d}{dx}\log x = \frac1xSteps 2, 4Theorem 5, Section 5.4
Chain ruleSteps 2, 4Theorem 4, Section 5.3.1
a=elog⁡aa = e^{\log a} for a>0a > 0Step 4Example 25
log⁡e=1\log e = 1⁠, log⁡1=0\log 1 = 0⁠, log⁡\log increasingStep 5Section 5.4
Found an error, or want more?

Tell us if something on this page is wrong or unclear, or if you would like a fuller explanation, another method or a new feature. Send feedback on this problem →