MAT1051 · Week 7 · The Derivative of Logarithmic, Exponential and Inverse Trigonometric Functions

Derivatives of logarithmic, exponential and inverse trigonometric functions

Derivatives of e^x, a^x, ln x, log_a x and arcsin, arccos, arctan, logarithmic differentiation and the derivative of an inverse function. How to solve questions like x^x that seem to have 'no rule'.

natural exponential functionnatural logarithmlogarithmic differentiationderivative of an inverse functioninverse trigonometric functionsarcsinarctanarcsec

This week the derivative table is completed. Once the derivatives of exponential, logarithmic and inverse trigonometric functions combine with the chain rule, you can differentiate every function in Calculus I. Some of these are pure memorization; the places that really earn points are logarithmic differentiation and the derivative of an inverse function. First a short list:

  1. The derivative of exe^x is itself. For eue^{u} it is eu⋅u′e^u\cdot u'.
  2. (ln⁡u)′=u′u(\ln u)'=\dfrac{u'}{u}. Before differentiating, break the expression apart with log rules.
  3. When the exponent is a variable (xxx^x) or there are many factors, take ln⁡y\ln y, then differentiate.
  4. In inverse trigonometric derivatives, a root or 1+u21+u^2 is in the denominator. For the chain rule, u′u' goes in the numerator.
  5. (f−1)′(b)=1f′(a)(f^{-1})'(b)=\dfrac{1}{f'(a)}, where f(a)=bf(a)=b.

Exponential functions

The number ee is the base chosen so that the slope of the tangent to exe^x at x=0x=0 is exactly 11. Therefore:

ddxex=ex\frac{d}{dx}e^x=e^x

The slope of the function at every point equals its own value. For another base, write ax=exln⁡aa^x=e^{x\ln a} and apply the chain rule:

ddxax=axln⁡a\frac{d}{dx}a^x=a^x\ln a

Example 1. y=ex2−3xy=e^{x^2-3x}: y′=(2x−3)ex2−3xy'=(2x-3)e^{x^2-3x}. The exponent stays as it is, and the derivative of the exponent goes in front.

Example 2. y=x2e−xy=x^2e^{-x}: y′=2xe−x+x2(−e−x)=e−x(2x−x2)y'=2xe^{-x}+x^2(-e^{-x})=e^{-x}(2x-x^2). After the product rule, factor out e−xe^{-x}; in week 9 the sign analysis is easy in this form.

Example 3. y=2sin⁡xy=2^{\sin x}: y′=2sin⁡xln⁡2⋅cos⁡xy'=2^{\sin x}\ln 2\cdot\cos x.

PITFALL · applying the power rule to an exponential. (2x)′=x⋅2x−1(2^x)'=x\cdot2^{x-1} is wrong. The power rule holds when the base is the variable and the exponent is constant (x2x^2). When the base is constant and the exponent is a variable (2x2^x), use the exponential rule: 2xln⁡22^x\ln2.

Logarithmic functions

If y=ln⁡xy=\ln x, then ey=xe^y=x. Implicit derivative: eyy′=1⇒y′=1ey=1xe^yy'=1 \Rightarrow y'=\dfrac{1}{e^y}=\dfrac1x.

ddxln⁡x=1x,ddxln⁡∣x∣=1x (x≠0),ddxlog⁡ax=1xln⁡a\frac{d}{dx}\ln x=\frac1x,\qquad \frac{d}{dx}\ln|x|=\frac1x\ (x\ne0),\qquad \frac{d}{dx}\log_a x=\frac{1}{x\ln a}

The most used form is the one with the chain rule: ddxln⁡u=u′u\dfrac{d}{dx}\ln u=\dfrac{u'}{u}.

Example 4. y=ln⁡(sin⁡x)y=\ln(\sin x): y′=cos⁡xsin⁡x=cot⁡xy'=\dfrac{\cos x}{\sin x}=\cot x.

Example 5 (break it apart first). y=ln⁡x3x+1(2x−1)2y=\ln\dfrac{x^3\sqrt{x+1}}{(2x-1)^2}.

Don’t bother with the quotient rule. Expand first with log rules:

y=3ln⁡x+12ln⁡(x+1)−2ln⁡(2x−1)y=3\ln x+\tfrac12\ln(x+1)-2\ln(2x-1)

Then term by term:

y′=3x+12(x+1)−42x−1y'=\frac3x+\frac{1}{2(x+1)}-\frac{4}{2x-1}

In the last term the 22 came from the chain rule: −2⋅22x−1-2\cdot\dfrac{2}{2x-1}.

Logarithmic differentiation

Use it in three situations:

  • The base and the exponent are both variable: xxx^x, xsin⁡xx^{\sin x}, (ln⁡x)x(\ln x)^x.
  • Many factors in the numerator and denominator: (x2+1)3x−1(x+2)4\dfrac{(x^2+1)^3\sqrt{x-1}}{(x+2)^4}.
  • Roots and powers nested together.

Algorithm:

1. ln y = ln(right side)        take ln of both sides
2. expand with log rules         exponents to the front, products to sums
3. differentiate both sides      left side: y'/y
4. y' = y · (derivative of the right side)   write y' with the original formula

Example 6. y=xsin⁡xy=x^{\sin x}, x>0x>0.

ln⁡y=sin⁡xln⁡x⇒y′y=cos⁡xln⁡x+sin⁡xx⇒y′=xsin⁡x(cos⁡xln⁡x+sin⁡xx)\ln y=\sin x\ln x \Rightarrow \frac{y'}{y}=\cos x\ln x+\frac{\sin x}{x} \Rightarrow y'=x^{\sin x}\left(\cos x\ln x+\frac{\sin x}{x}\right)

PITFALL · choosing one of the two rules for xxx^x. The power rule gives x⋅xx−1=xxx\cdot x^{x-1}=x^x, the exponential rule gives xxln⁡xx^x\ln x. Both are wrong; the correct answer is the sum of the two: xx(1+ln⁡x)x^x(1+\ln x). This is not a coincidence, logarithmic differentiation accounts for both variabilities.

The derivative of an inverse function

If ff is one-to-one and differentiable, f(a)=bf(a)=b and f′(a)≠0f'(a)\ne0:

(f−1)′(b)=1f′(a)(f^{-1})'(b)=\frac{1}{f'(a)}

Graphically: if the tangent slope of ff at the point (a,b)(a,b) is mm, then under reflection in y=xy=x the slope at the point (b,a)(b,a) is 1m\tfrac1m.

Example 7. (f−1)′(2)(f^{-1})'(2) for f(x)=x3+xf(x)=x^3+x.

f(a) = 2  ->  a^3 + a = 2  ->  a = 1      (by trial)
f'(x) = 3x^2 + 1  ->  f'(1) = 4
(f^-1)'(2) = 1/4

You don’t need to find the formula of the inverse. This is the route the exam expects.

Inverse trigonometric functions

If y=arcsin⁡xy=\arcsin x, then sin⁡y=x\sin y=x and y∈[−π2,π2]y\in[-\tfrac{\pi}{2},\tfrac{\pi}{2}]. Implicit derivative:

cos⁡y⋅y′=1⇒y′=1cos⁡y=11−sin⁡2y=11−x2\cos y\cdot y'=1 \Rightarrow y'=\frac{1}{\cos y}=\frac{1}{\sqrt{1-\sin^2y}}=\frac{1}{\sqrt{1-x^2}}

The sign of the root is ++, because cos⁡y≥0\cos y\ge0 on that interval. The others come out the same way:

FunctionDerivativeDomain
arcsin⁡x\arcsin x11−x2\dfrac{1}{\sqrt{1-x^2}}∣x∣<1\lvert x\rvert<1
arccos⁡x\arccos x−11−x2-\dfrac{1}{\sqrt{1-x^2}}∣x∣<1\lvert x\rvert<1
arctan⁡x\arctan x11+x2\dfrac{1}{1+x^2}every xx
arcsec⁡x\operatorname{arcsec} x1∣x∣x2−1\dfrac{1}{\lvert x\rvert\sqrt{x^2-1}}∣x∣>1\lvert x\rvert>1

The derivatives of arcsin⁡\arcsin and arccos⁡\arccos differ only in sign. This is a consequence of arcsin⁡x+arccos⁡x=π2\arcsin x+\arccos x=\tfrac{\pi}{2} being constant.

Example 8. y=arctan⁡xy=\arctan\sqrt x: y′=11+(x)2⋅12x=12x(1+x)y'=\dfrac{1}{1+(\sqrt x)^2}\cdot\dfrac{1}{2\sqrt x}=\dfrac{1}{2\sqrt x(1+x)}.

Example 9. y=arcsin⁡2xy=\arcsin 2x: y′=21−4x2y'=\dfrac{2}{\sqrt{1-4x^2}}.

The real importance of these derivatives shows up in weeks 12-14: the integrals ∫dx1+x2=arctan⁡x+C\displaystyle\int\frac{dx}{1+x^2}=\arctan x+C and ∫dx1−x2=arcsin⁡x+C\displaystyle\int\frac{dx}{\sqrt{1-x^2}}=\arcsin x+C are this table read backwards.

Mixed examples: which rule when?

On exams functions don’t come alone; three rules work together inside one question. Ask yourself these questions in order:

QuestionIf yes
Do both the base and the exponent contain xx?Logarithmic differentiation
Is there a product, quotient or power inside ln⁡\ln?Expand first with log rules
Are two functions multiplied or divided?Product / quotient rule
Is there a function inside another function?Chain rule

Example 10. y=e−2xarctan⁡(x2)y=e^{-2x}\arctan(x^2).

The outer structure is a product. The derivative of the first factor is −2e−2x-2e^{-2x} (chain rule). The derivative of the second is 2x1+x4\dfrac{2x}{1+x^4} (chain rule, u=x2u=x^2, u2=x4u^2=x^4). Combine:

y′=−2e−2xarctan⁡(x2)+e−2x⋅2x1+x4=2e−2x(x1+x4−arctan⁡(x2))y'=-2e^{-2x}\arctan(x^2)+e^{-2x}\cdot\frac{2x}{1+x^4}=2e^{-2x}\left(\frac{x}{1+x^4}-\arctan(x^2)\right)

Example 11. y=ln⁡(x+x2+1)y=\ln\big(x+\sqrt{x^2+1}\big).

y′=1+xx2+1x+x2+1=x2+1+xx2+1x+x2+1=1x2+1y'=\frac{1+\dfrac{x}{\sqrt{x^2+1}}}{x+\sqrt{x^2+1}}=\frac{\dfrac{\sqrt{x^2+1}+x}{\sqrt{x^2+1}}}{x+\sqrt{x^2+1}}=\frac{1}{\sqrt{x^2+1}}

An expression that looks long reduces to a single term. This result will come back in week 14 as the answer to the integral ∫dxx2+1\displaystyle\int\frac{dx}{\sqrt{x^2+1}}.

Why does ln⁡∣x∣\ln|x| matter?

ln⁡x\ln x is defined only for x>0x>0. ln⁡∣x∣\ln|x| is defined everywhere x≠0x\ne0, and its derivative is 1x\tfrac1x on both sides: for x<0x<0, ln⁡∣x∣=ln⁡(−x)\ln|x|=\ln(-x), and by the chain rule its derivative is −1−x=1x\dfrac{-1}{-x}=\dfrac1x. That is why, when integrating, you write ∫dxx=ln⁡∣x∣+C\displaystyle\int\frac{dx}{x}=\ln|x|+C; forgetting the absolute value leaves the answer undefined for negative xx.

Exponential growth

For y=Cekty=Ce^{kt}, y′=kCekt=kyy'=kCe^{kt}=ky. That is, the rate of change is proportional to the current amount. Population, interest and radioactive decay are all modeled with this equation. If you write the “doubles every 3 hours” model from week 1 with base ee, you get k=ln⁡23k=\dfrac{\ln2}{3}.

The limit definition of e

The derivative of ln⁡x\ln x at x=1x=1 is 11. From the definition:

1=lim⁡h→0ln⁡(1+h)h=lim⁡h→0ln⁡(1+h)1/h1=\lim_{h\to0}\frac{\ln(1+h)}{h}=\lim_{h\to0}\ln(1+h)^{1/h}

Since exe^x is continuous, exponentiate both sides: lim⁡h→0(1+h)1/h=e\displaystyle\lim_{h\to0}(1+h)^{1/h}=e. This is the continuous version of the limit (1+1n)n→e(1+\tfrac1n)^n\to e you saw in week 1.

Common mistakes

Wrong thinkingCorrect
(e3x)′=e3x(e^{3x})'=e^{3x}3e3x3e^{3x}, chain rule
(2x)′=x2x−1(2^x)'=x2^{x-1}2xln⁡22^x\ln2
(xx)′=x⋅xx−1(x^x)'=x\cdot x^{x-1}xx(ln⁡x+1)x^x(\ln x+1), logarithmic differentiation
(ln⁡5x)′=5x(\ln 5x)'=\dfrac{5}{x}55x=1x\dfrac{5}{5x}=\dfrac1x
(ln⁡x2)′=1x2(\ln x^2)'=\dfrac{1}{x^2}2xx2=2x\dfrac{2x}{x^2}=\dfrac2x
(ln⁡2)′=12(\ln 2)'=\dfrac12A constant, its derivative is 00
(arctan⁡3x)′=31+3x2(\arctan 3x)'=\dfrac{3}{1+3x^2}31+9x2\dfrac{3}{1+9x^2}
(arcsin⁡x)′=11+x2(\arcsin x)'=\dfrac{1}{\sqrt{1+x^2}}11−x2\dfrac{1}{\sqrt{1-x^2}}
(f−1)′(b)=1f′(b)(f^{-1})'(b)=\dfrac{1}{f'(b)}1f′(a)\dfrac{1}{f'(a)}, f(a)=bf(a)=b
sin⁡−1x=1sin⁡x\sin^{-1}x=\dfrac{1}{\sin x}sin⁡−1x=arcsin⁡x\sin^{-1}x=\arcsin x; 1sin⁡x=csc⁡x\tfrac{1}{\sin x}=\csc x

Test yourself

Exam-style questions. Solve them on paper first, then reveal the answer.

Question 1easy

Differentiate y=e3xsin⁡xy=e^{3x}\sin x.

Show answer
y′=e3x(3sin⁡x+cos⁡x)y'=e^{3x}(3\sin x+\cos x)

Product + chain: (e3x)′=3e3x(e^{3x})'=3e^{3x}. y′=3e3xsin⁡x+e3xcos⁡x=e3x(3sin⁡x+cos⁡x)y'=3e^{3x}\sin x+e^{3x}\cos x=e^{3x}(3\sin x+\cos x).

Question 2easy

Differentiate y=ln⁡(x2+4x+5)y=\ln(x^2+4x+5).

Show answer
y′=2x+4x2+4x+5y'=\dfrac{2x+4}{x^2+4x+5}

(ln⁡u)′=u′u(\ln u)'=\dfrac{u'}{u}. u=x2+4x+5u=x^2+4x+5, u′=2x+4u'=2x+4. Note: x2+4x+5=(x+2)2+1>0x^2+4x+5=(x+2)^2+1>0, so the function is defined everywhere.

Question 3medium

Use logarithmic differentiation to find dydx\dfrac{dy}{dx} for y=xxy=x^x (x>0)(x>0). Then evaluate y′(2)y'(2).

Show answer
y′=xx(ln⁡x+1)y'=x^x(\ln x+1), y′(2)=4(ln⁡2+1)≈6.773y'(2)=4(\ln 2+1)\approx 6.773

Both the base and the exponent are variable; neither the power rule nor the exponential rule fits. ln⁡y=xln⁡x\ln y=x\ln x. Derivative: y′y=ln⁡x+x⋅1x=ln⁡x+1\dfrac{y'}{y}=\ln x+x\cdot\dfrac1x=\ln x+1. y′=xx(ln⁡x+1)y'=x^x(\ln x+1). At x=2x=2: 4(ln⁡2+1)≈6.7734(\ln2+1)\approx 6.773.

Question 4easy

Differentiate y=5x2y=5^{x^2}.

Show answer
y′=2xln⁡5⋅5x2y'=2x\ln 5\cdot 5^{x^2}

(au)′=auln⁡a⋅u′(a^u)'=a^u\ln a\cdot u'. u=x2u=x^2: y′=5x2ln⁡5⋅2xy'=5^{x^2}\ln5\cdot 2x.

Question 5easy

Differentiate y=log⁡3(2x+1)y=\log_3(2x+1).

Show answer
y′=2(2x+1)ln⁡3y'=\dfrac{2}{(2x+1)\ln 3}

log⁡3u=ln⁡uln⁡3\log_3 u=\dfrac{\ln u}{\ln 3}, and ln⁡3\ln3 is a constant. y′=1ln⁡3⋅22x+1y'=\dfrac{1}{\ln3}\cdot\dfrac{2}{2x+1}.

Question 6easy

Differentiate y=arctan⁡(3x)y=\arctan(3x).

Show answer
y′=31+9x2y'=\dfrac{3}{1+9x^2}

(arctan⁡u)′=u′1+u2(\arctan u)'=\dfrac{u'}{1+u^2}. u=3xu=3x: 31+(3x)2=31+9x2\dfrac{3}{1+(3x)^2}=\dfrac{3}{1+9x^2}. Writing the square as 3x23x^2 is a common mistake.

Question 7medium

Differentiate y=arcsin⁡(x2)y=\arcsin(x^2).

Show answer
y′=2x1−x4y'=\dfrac{2x}{\sqrt{1-x^4}}

(arcsin⁡u)′=u′1−u2(\arcsin u)'=\dfrac{u'}{\sqrt{1-u^2}}. u=x2u=x^2, u2=x4u^2=x^4: 2x1−x4\dfrac{2x}{\sqrt{1-x^4}}, ∣x∣<1|x|<1.

Question 8medium

Show that ddx[xarccos⁡x−1−x2]=arccos⁡x\dfrac{d}{dx}\left[x\arccos x-\sqrt{1-x^2}\right]=\arccos x.

Show answer
The two algebraic terms cancel, leaving arccos x.

The first term is a product: arccos⁡x+x⋅−11−x2\arccos x+x\cdot\dfrac{-1}{\sqrt{1-x^2}}. The second term: (1−x2)′=−2x21−x2=−x1−x2\left(\sqrt{1-x^2}\right)'=\dfrac{-2x}{2\sqrt{1-x^2}}=\dfrac{-x}{\sqrt{1-x^2}}, with a minus sign in front: +x1−x2+\dfrac{x}{\sqrt{1-x^2}}. Total: arccos⁡x−x1−x2+x1−x2=arccos⁡x\arccos x-\dfrac{x}{\sqrt{1-x^2}}+\dfrac{x}{\sqrt{1-x^2}}=\arccos x. (In week 13 this will come up as the answer to ∫arccos⁡x dx\int\arccos x\,dx.)

Question 9hard

Let y=(x2+1)3x−1(x+2)4y=\dfrac{(x^2+1)^3\sqrt{x-1}}{(x+2)^4}. Use logarithmic differentiation to find y′(2)y'(2).

Show answer
475512≈0.9277\dfrac{475}{512}\approx 0.9277

ln⁡y=3ln⁡(x2+1)+12ln⁡(x−1)−4ln⁡(x+2)\ln y=3\ln(x^2+1)+\tfrac12\ln(x-1)-4\ln(x+2). Derivative: y′y=6xx2+1+12(x−1)−4x+2\dfrac{y'}{y}=\dfrac{6x}{x^2+1}+\dfrac{1}{2(x-1)}-\dfrac{4}{x+2}. At x=2x=2: y=125⋅1256y=\dfrac{125\cdot1}{256}, the bracket is 125+12−1=1910\dfrac{12}{5}+\dfrac12-1=\dfrac{19}{10}. y′(2)=125256⋅1910=475512y'(2)=\dfrac{125}{256}\cdot\dfrac{19}{10}=\dfrac{475}{512}.

Question 10medium

Find the equation of the tangent line to y=ln⁡xy=\ln x at x=ex=e.

Show answer
y=xey=\dfrac{x}{e}

The point is (e,ln⁡e)=(e,1)(e,\ln e)=(e,1). The slope is 1e\dfrac1e. Line: y−1=1e(x−e)=xe−1y-1=\dfrac1e(x-e)=\dfrac xe-1, that is y=xey=\dfrac xe. It passes through the origin.

Question 11hard

Let f(x)=x3+2x+1f(x)=x^3+2x+1. Find (f−1)′(4)(f^{-1})'(4).

Show answer
15\dfrac15

First find the aa with f(a)=4f(a)=4: a3+2a+1=4a^3+2a+1=4, by trial a=1a=1. f′(x)=3x2+2f'(x)=3x^2+2, f′(1)=5f'(1)=5. Derivative of the inverse function: (f−1)′(4)=1f′(1)=15(f^{-1})'(4)=\dfrac{1}{f'(1)}=\dfrac15. Computing f′(4)f'(4) would be wrong.

Question 12hard

Show that ddxln⁡(1+sin⁡x1−sin⁡x)=2sec⁡x\dfrac{d}{dx}\ln\left(\dfrac{1+\sin x}{1-\sin x}\right)=2\sec x.

Show answer
Split the log; the derivative simplifies to 2/cos x.

First the log rule: ln⁡(1+sin⁡x)−ln⁡(1−sin⁡x)\ln(1+\sin x)-\ln(1-\sin x). Derivative: cos⁡x1+sin⁡x+cos⁡x1−sin⁡x=cos⁡x⋅(1−sin⁡x)+(1+sin⁡x)1−sin⁡2x=2cos⁡xcos⁡2x=2cos⁡x=2sec⁡x\dfrac{\cos x}{1+\sin x}+\dfrac{\cos x}{1-\sin x}=\cos x\cdot\dfrac{(1-\sin x)+(1+\sin x)}{1-\sin^2x}=\dfrac{2\cos x}{\cos^2x}=\dfrac{2}{\cos x}=2\sec x.

Verification: All derivatives were checked with node (verify/MAT1051/07.mjs): the symbolic answer was compared with the central-difference derivative at four points; inverse function derivatives by computing the inverse numerically with Newton's method and differentiating it; the Q9 value directly with a numerical derivative.

Review card

(e^x)' = e^x (e^u)' = e^u · u' (a^x)' = a^x ln a (a^u)' = a^u ln a · u' (ln x)' = 1/x (ln|x|)' = 1/x (ln u)' = u'/u (log_a x)' = 1/(x ln a) BEFORE differentiating, expand with log rules: ln(AB/C) = ln A + ln B - ln C x^x, x^(sin x), a fraction with many factors -> LOGARITHMIC DIFFERENTIATION: write ln y, differentiate, multiply by y (arcsin u)' = u'/√(1-u^2) (arccos u)' = -u'/√(1-u^2) (arctan u)' = u'/(1+u^2) (arcsec x)' = 1/(|x|√(x^2-1)) Inverse function: (f^-1)'(b) = 1/f'(a), a: f(a) = b (find a first) e = lim (1+x)^(1/x), x -> 0