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

Example 26: Derivatives of e−xe^{-x}⁠, sin⁡(log⁡x)\sin(\log x)⁠, cos⁡−1(ex)\cos^{-1}(e^x)⁠, ecos⁡xe^{\cos x}

ExamplesExponential and logarithmic functions · Section 5.4
The question

Differentiate the following w.r.t. xx⁠:

(i) e−xe^{-x}    (ii) sin⁡(log⁡x), x>0\sin(\log x),\ x > 0    (iii) cos⁡−1(ex)\cos^{-1}(e^x)    (iv) ecos⁡xe^{\cos x}

Exam answer

(i) Let y=e−xy = e^{-x}⁠. By the chain rule,

dydx=e−x⋅ddx(−x)=e−x⋅(−1)\begin{aligned} \frac{dy}{dx} &= e^{-x}\cdot\frac{d}{dx}(-x) \\ &= e^{-x}\cdot(-1) \end{aligned}

∴ dydx=−e−x\therefore\ \dfrac{dy}{dx} = -e^{-x}⁠.

(ii) Let y=sin⁡(log⁡x)y = \sin(\log x)⁠, x>0x > 0⁠.

dydx=cos⁡(log⁡x)⋅ddx(log⁡x)=cos⁡(log⁡x)⋅1x\begin{aligned} \frac{dy}{dx} &= \cos(\log x)\cdot\frac{d}{dx}(\log x) \\ &= \cos(\log x)\cdot\frac1x \end{aligned}

∴ dydx=cos⁡(log⁡x)x\therefore\ \dfrac{dy}{dx} = \dfrac{\cos(\log x)}{x} (x>0)(x > 0)⁠.

(iii) Let y=cos⁡−1(ex)y = \cos^{-1}(e^x)⁠, defined for x≤0x \le 0⁠.

dydx=−11−(ex)2⋅ddx(ex)=−11−e2x⋅ex\begin{aligned} \frac{dy}{dx} &= \frac{-1}{\sqrt{1 - (e^x)^2}}\cdot\frac{d}{dx}(e^x) \\ &= \frac{-1}{\sqrt{1 - e^{2x}}}\cdot e^x \end{aligned}

∴ dydx=−ex1−e2x\therefore\ \dfrac{dy}{dx} = \dfrac{-e^x}{\sqrt{1 - e^{2x}}} (x<0)(x < 0)⁠.

(iv) Let y=ecos⁡xy = e^{\cos x}⁠.

dydx=ecos⁡x⋅ddx(cos⁡x)=ecos⁡x⋅(−sin⁡x)\begin{aligned} \frac{dy}{dx} &= e^{\cos x}\cdot\frac{d}{dx}(\cos x) \\ &= e^{\cos x}\cdot(-\sin x) \end{aligned}

∴ dydx=−(sin⁡x) ecos⁡x\therefore\ \dfrac{dy}{dx} = -(\sin x)\,e^{\cos x}⁠.

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

The one idea this problem is built on

All four are composites, so all four use the chain rule: derivative of the outer function at the inner one, times the derivative of the inner one. The new ingredients are the two facts of Theorem 5: ddxex=ex\frac{d}{dx}e^x = e^x and ddxlog⁡x=1x\frac{d}{dx}\log x = \frac1x⁠. In each part we name the inner and outer functions, and we state where the function and its derivative exist; part (iii) needs care, since cos⁡−1\cos^{-1} only accepts inputs in [−1,1][-1, 1]⁠.

Given, to find, and the plan
Given
(i) e−xe^{-x}⁠, all real xx⁠; (ii) sin⁡(log⁡x)\sin(\log x)⁠, x>0x > 0⁠; (iii) cos⁡−1(ex)\cos^{-1}(e^x)⁠; (iv) ecos⁡xe^{\cos x}⁠, all real xx⁠.
To find
dydx\frac{dy}{dx} for each, with the xx where it is valid.
Plan
For each part: (1) name inner tt and outer function, and the domain; (2) differentiate each; (3) multiply and write in terms of xx⁠.

Basics you need

1Theorem 5

ddxex=ex\frac{d}{dx}e^x = e^x for all real xx⁠, and ddxlog⁡x=1x\frac{d}{dx}\log x = \frac1x for x>0x > 0⁠. Basics: exponentials and logarithms

2Chain rule

If y=v(t)y = v(t) and t=u(x)t = u(x)⁠, then dydx=dvdt⋅dtdx\frac{dy}{dx} = \frac{dv}{dt}\cdot\frac{dt}{dx}⁠, provided both derivatives exist (Theorem 4). Basics: composite functions

3Standard derivatives

ddtsin⁡t=cos⁡t\frac{d}{dt}\sin t = \cos t⁠, ddxcos⁡x=−sin⁡x\frac{d}{dx}\cos x = -\sin x (Table 5.3), and ddtcos⁡−1t=−11−t2\frac{d}{dt}\cos^{-1}t = \frac{-1}{\sqrt{1-t^2}} for −1<t<1-1 < t < 1 (table after Example 24). Basics: derivative rules

4Index laws

(ex)2=e2x(e^x)^2 = e^{2x}⁠, and ex>0e^x > 0 for every xx⁠, with ex<1e^x < 1 exactly when x<0x < 0⁠. Basics: exponentials and logarithms

Part (i): y=e−xy = e^{-x}

  1. Name the pieces

    Inner: t=−xt = -x⁠. Outer: y=ety = e^t⁠. Both are defined and differentiable for every real number, so y=e−xy = e^{-x} is differentiable on all of R\R⁠.

    To evaluate e−xe^{-x} you first change the sign of xx⁠, then raise ee to that power. The job done first is the inner function.
    Composite functions. Basics: composite functions
  2. Differentiate each piece

    dtdx=ddx(−x)=−1,dydt=ddtet=et.\begin{gathered} \frac{dt}{dx} = \frac{d}{dx}(-x) = -1, \\ \frac{dy}{dt} = \frac{d}{dt}e^t = e^t. \end{gathered}
    −x=(−1)⋅x-x = (-1)\cdot x⁠, and a constant multiple differentiates to the same constant times the derivative of xx⁠, which is 11⁠. The outer derivative is Theorem 5 (1), written in the variable tt⁠.
  3. Multiply

    dydx=et⋅(−1)=−e−x,x∈R.\frac{dy}{dx} = e^t\cdot(-1) = -e^{-x}, \qquad x \in \R.
    The answer is negative for every xx⁠, because e−x>0e^{-x} > 0⁠: the graph of e−xe^{-x} falls everywhere. It is the mirror image of exe^x in the yy-axis, and mirroring turns every slope into its negative.
    Chain rule (Theorem 4, Section 5.3.1). Lesson: chain rule

Part (ii): y=sin⁡(log⁡x)y = \sin(\log x)⁠, x>0x > 0

  1. Name the pieces, and the domain

    Inner: t=log⁡xt = \log x⁠, defined and differentiable for x>0x > 0⁠. Outer: y=sin⁡ty = \sin t⁠, differentiable for all real tt⁠. So yy is differentiable for every x>0x > 0⁠, which is exactly the condition in the question.

    The restriction x>0x > 0 in the question is not decoration: log⁡x\log x does not exist otherwise (Example 25).
    Domain of log⁡\log is R+\R^+ (Section 5.4). Basics: exponentials and logarithms
  2. Differentiate each piece

    dtdx=ddxlog⁡x=1x,dydt=cos⁡t.\frac{dt}{dx} = \frac{d}{dx}\log x = \frac1x, \qquad \frac{dy}{dt} = \cos t.
    The first is Theorem 5 (2); the second is from Table 5.3.
    Theorem 5 (2), Section 5.4; Table 5.3. Basics: derivative rules
  3. Multiply

    dydx=cos⁡t⋅1x=cos⁡(log⁡x)x,x>0.\frac{dy}{dx} = \cos t\cdot\frac1x = \frac{\cos(\log x)}{x}, \qquad x > 0.
    We substitute t=log⁡xt = \log x back so the answer is in xx alone. Keep the brackets: cos⁡(log⁡x)\cos(\log x) is the cosine of the number log⁡x\log x⁠, not cos⁡\cos times log⁡x\log x⁠.
    Chain rule (Theorem 4). Lesson: chain rule

Part (iii): y=cos⁡−1(ex)y = \cos^{-1}(e^x)

  1. Where is this function defined?

    cos⁡−1\cos^{-1} accepts only inputs in [−1,1][-1, 1]⁠. The input here is exe^x⁠, which is always positive, so we need

    0<ex≤1  ⟺  x≤0.0 < e^x \le 1 \iff x \le 0.

    So y=cos⁡−1(ex)y = \cos^{-1}(e^x) is defined exactly for x≤0x \le 0⁠. The derivative of cos⁡−1t\cos^{-1}t exists only for −1<t<1-1 < t < 1⁠, so we will also need ex<1e^x < 1⁠, that is, x<0x < 0⁠.

    The book does not state a domain for this part, but the formula only makes sense where exe^x is a legal input for cos⁡−1\cos^{-1}⁠. For x>0x > 0⁠, ex>1e^x > 1 and cos⁡−1(ex)\cos^{-1}(e^x) does not exist (for example e1≈2.718e^1 \approx 2.718⁠, and no angle has cosine 2.7182.718⁠).
    Domain of cos⁡−1\cos^{-1} is [−1,1][-1,1] (Chapter 2, Section 2.2); ex≤1  ⟺  x≤0e^x \le 1 \iff x \le 0 because exe^x is increasing with e0=1e^0 = 1⁠. Basics: exponentials and logarithms
  2. Name the pieces and differentiate each

    Inner: t=ext = e^x⁠, with dtdx=ex\frac{dt}{dx} = e^x⁠. Outer: y=cos⁡−1ty = \cos^{-1}t⁠, with

    dydt=−11−t2,−1<t<1.\frac{dy}{dt} = \frac{-1}{\sqrt{1 - t^2}}, \qquad -1 < t < 1.
    For x<0x < 0 we have 0<t=ex<10 < t = e^x < 1⁠, inside the interval where the derivative of cos⁡−1\cos^{-1} exists, so the chain rule applies.
    Derivative of cos⁡−1\cos^{-1}⁠, table after Example 24 (Section 5.3.3). Lesson: derivatives of inverse trig functions
  3. Multiply and simplify

    dydx=−11−(ex)2⋅ex=−ex1−e2x,x<0.\begin{aligned} \frac{dy}{dx} &= \frac{-1}{\sqrt{1 - (e^x)^2}}\cdot e^x \\ &= \frac{-e^x}{\sqrt{1 - e^{2x}}}, \qquad x < 0. \end{aligned}
    (ex)2=ex⋅ex=e2x(e^x)^2 = e^{x}\cdot e^{x} = e^{2x} by the index law aman=am+na^m a^n = a^{m+n}⁠. Note e2xe^{2x} is not ex2e^{x^2}⁠. At x=0x = 0 the denominator is 1−1=0\sqrt{1-1} = 0⁠: there the graph ends with a vertical tangent, so yy is not differentiable at 00⁠.
    Index law (ex)2=e2x(e^x)^2 = e^{2x}⁠. Basics: exponentials and logarithms
  4. Picture

    x y −4 −3 −2 −1 1 π/2 x = −1: slope ≈ −0.396 (0, 0): vertical tangent y → π/2 as x → −∞ (never reached) no graph for x > 0 (there e^x > 1)
    y=cos⁡−1(ex)y = \cos^{-1}(e^x) for x≤0x \le 0 (equal scales). As x→−∞x \to -\infty⁠, ex→0e^x \to 0 and y→cos⁡−10=π2y \to \cos^{-1}0 = \frac{\pi}{2}⁠. At x=0x = 0⁠, y=cos⁡−11=0y = \cos^{-1}1 = 0 and the tangent is vertical. At x=−1x = -1 the slope is −e−11−e−2≈−0.396\frac{-e^{-1}}{\sqrt{1-e^{-2}}} \approx -0.396⁠.
    The graph confirms the sign: dydx<0\frac{dy}{dx} < 0 for all x<0x < 0⁠, so yy decreases. This makes sense, as exe^x increases and cos⁡−1\cos^{-1} is a decreasing function.
    A negative derivative means the graph falls. Basics: slope at a point

Part (iv): y=ecos⁡xy = e^{\cos x}

  1. Name the pieces

    Inner: t=cos⁡xt = \cos x⁠. Outer: y=ety = e^t⁠. Both are differentiable everywhere, so yy is differentiable for every real xx⁠.

    To evaluate ecos⁡xe^{\cos x}⁠: first find cos⁡x\cos x⁠, then raise ee to that power.
    Composite functions. Basics: composite functions
  2. Differentiate each piece

    dtdx=−sin⁡x,dydt=et.\frac{dt}{dx} = -\sin x, \qquad \frac{dy}{dt} = e^t.
    Table 5.3 gives ddxcos⁡x=−sin⁡x\frac{d}{dx}\cos x = -\sin x⁠; Theorem 5 (1) gives the outer derivative.
    Table 5.3; Theorem 5 (1). Basics: derivative rules
  3. Multiply

    dydx=ecos⁡x⋅(−sin⁡x)=−(sin⁡x) ecos⁡x,x∈R.\begin{aligned} \frac{dy}{dx} &= e^{\cos x}\cdot(-\sin x) \\ &= -(\sin x)\,e^{\cos x}, \qquad x\in\R. \end{aligned}
    Since ecos⁡x>0e^{\cos x} > 0⁠, the sign of the derivative is the sign of −sin⁡x-\sin x⁠: the function falls on (0,π)(0, \pi) and rises on (π,2π)(\pi, 2\pi)⁠. It is largest (ee⁠) where cos⁡x=1\cos x = 1 and smallest (e−1e^{-1}⁠) where cos⁡x=−1\cos x = -1⁠.
    Chain rule (Theorem 4). Lesson: chain rule
Result

(i) ddxe−x=−e−x\dfrac{d}{dx}e^{-x} = -e^{-x}⁠, all real xx⁠.
(ii) ddxsin⁡(log⁡x)=cos⁡(log⁡x)x\dfrac{d}{dx}\sin(\log x) = \dfrac{\cos(\log x)}{x}⁠, x>0x > 0⁠.
(iii) ddxcos⁡−1(ex)=−ex1−e2x\dfrac{d}{dx}\cos^{-1}(e^x) = \dfrac{-e^x}{\sqrt{1-e^{2x}}}⁠, x<0x < 0 (the function exists only for x≤0x \le 0⁠).
(iv) ddxecos⁡x=−(sin⁡x) ecos⁡x\dfrac{d}{dx}e^{\cos x} = -(\sin x)\,e^{\cos x}⁠, all real xx⁠.
(These are the book's answers; the domains in (i), (iii) and (iv) are added here.)

Check it with numbers
Part, pointFormula valueDifference quotient, step 0.0001
(i), x=0.5x = 0.5−e−0.5=−0.6065307-e^{-0.5} = -0.6065307−0.6065307-0.6065307
(ii), x=2x = 2cos⁡(0.6931472)2=0.3846195\frac{\cos(0.6931472)}{2} = 0.38461950.38461950.3846195
(iii), x=−1x = -1−0.36787940.9298735=−0.3956231\frac{-0.3678794}{0.9298735} = -0.3956231−0.3956231-0.3956231
(iv), x=1x = 1−0.8414710×1.7165257-0.8414710 \times 1.7165257 =−1.4444066= -1.4444066−1.4444066-1.4444066

The difference quotients are central ones, y(x+h)−y(x−h)2h\frac{y(x+h) - y(x-h)}{2h} with h=0.0001h = 0.0001⁠, and agree to the 7 decimal places shown.

Common mistakes
  1. Writing ddxe−x=e−x\frac{d}{dx}e^{-x} = e^{-x}⁠. exe^x is its own derivative, but e−xe^{-x} is a composite: the inner derivative −1-1 changes the sign.
  2. Writing ddxecos⁡x=ecos⁡x\frac{d}{dx}e^{\cos x} = e^{\cos x} or e−sin⁡xe^{-\sin x}⁠. The outer derivative keeps the exponent cos⁡x\cos x unchanged and multiplies by the inner derivative −sin⁡x-\sin x⁠.
  3. Writing (ex)2=ex2(e^x)^2 = e^{x^2}⁠. It is e2xe^{2x}⁠.
  4. Ignoring domains: cos⁡−1(ex)\cos^{-1}(e^x) does not exist for x>0x > 0⁠, and its derivative fails at x=0x = 0⁠.
What to take away
  1. ddxeg(x)=eg(x) g′(x)\frac{d}{dx}e^{g(x)} = e^{g(x)}\,g'(x)⁠: the exponential copies itself, then multiplies by the derivative of the exponent.
  2. ddxlog⁡g(x)=g′(x)g(x)\frac{d}{dx}\log g(x) = \frac{g'(x)}{g(x)} where g(x)>0g(x) > 0 (the same chain rule with outer function log⁡\log⁠).
  3. Before differentiating, find where the function exists; inverse trig and log functions restrict the inputs.

Every fact used, and where it comes from

FactUsed inSource
ddxex=ex\frac{d}{dx}e^x = e^x⁠; ddxlog⁡x=1x\frac{d}{dx}\log x = \frac1xAll partsTheorem 5, Section 5.4 (Lesson: exponential and logarithmic functions)
Chain ruleAll partsTheorem 4, Section 5.3.1
ddxsin⁡x=cos⁡x\frac{d}{dx}\sin x = \cos x⁠; ddxcos⁡x=−sin⁡x\frac{d}{dx}\cos x = -\sin xParts (ii), (iv)Table 5.3, Section 5.3
ddtcos⁡−1t=−11−t2\frac{d}{dt}\cos^{-1}t = \frac{-1}{\sqrt{1-t^2}}⁠, −1<t<1-1 < t < 1Part (iii)Table after Example 24, Section 5.3.3
Domain of cos⁡−1\cos^{-1} is [−1,1][-1, 1]⁠; domain of log⁡\log is R+\R^+Parts (ii), (iii)Chapter 2, Section 2.2; Section 5.4
Numerical valuesCheckRecomputed in the site's verification script
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 →