5.3 Exponential and Logarithmic Functions; Logarithmic Differentiation
$e^x$ is the one exponential function that is its own derivative, and its mirror image $\log x$ has derivative $\tfrac1x$. Taking logarithms turns products, quotients and powers like $x^x$ into sums that are easy to differentiate.
A bacterial culture doubles every hour; a loan grows by a fixed percentage every month; a dose of paracetamol is cleared from the blood at a rate proportional to the amount still there; a cup of tea cools faster when it is hotter. In each case the rate at which a quantity changes is proportional to the quantity itself. The functions that behave like this are the exponential functions $b^x$, and among them one base, the number $e\approx2.718$, is so natural that the rate of change of $e^x$ is exactly $e^x$. Its inverse, the natural logarithm, is just as important: it is the function whose derivative is $\tfrac1x$, and it turns multiplication into addition.
That last property gives a powerful technique. Faced with a function like $x^x$ — neither a power of $x$ (the exponent varies) nor an exponential (the base varies) — no rule from Class 11 applies. Taking the logarithm first brings the exponent down: $\log y=x\log x$, and implicit differentiation does the rest. The same trick turns a long product or quotient into a sum. This is logarithmic differentiation, a favourite of both the Board and JEE.
Exponential Functions and the Number $e$
For a fixed base $b\gt0$, $b\ne1$, the function $f(x)=b^x$ with domain $\mathbb R$ is the exponential function with base $b$. Its range is $(0,\infty)$: $b^x$ is always positive. Its graph passes through $(0,1)$; it is increasing if $b\gt1$ and decreasing if $0\lt b\lt1$. It obeys the index laws $b^{x+y}=b^xb^y$, $b^{x-y}=\dfrac{b^x}{b^y}$, $(b^x)^y=b^{xy}$.
Which base is “best”? Look at the slope of $b^x$ at $x=0$, $\lim\limits_{h\to0}\dfrac{b^h-1}{h}$. For $b=2$ it is about $0.693$; for $b=3$ about $1.099$. Somewhere between $2$ and $3$ there is exactly one base for which this slope is $1$. That base is the number $$e=2.718281828\ldots,$$ which is also the limit of $\left(1+\tfrac1n\right)^n$ as $n\to\infty$ — the amount that ₹1 becomes in one year at $100\%$ interest compounded more and more often. Like $\pi$, $e$ is irrational. We take its key property as known (it can be proved in higher courses): $$\lim_{h\to0}\dfrac{e^h-1}{h}=1.$$ Interactive 1 shows the slope at $(0,1)$ for different bases.
$e^x$ is differentiable at every real $x$, and $$\dfrac{d}{dx}e^x=e^x.$$
Proof. From first principles, using $e^{x+h}=e^xe^h$: $$\dfrac{e^{x+h}-e^x}{h}=e^x\cdot\dfrac{e^h-1}{h}\ \longrightarrow\ e^x\cdot1=e^x\quad\text{as }h\to0.\ \blacksquare$$ With the chain rule: $\dfrac{d}{dx}e^{u(x)}=e^{u(x)}\,u'(x)$.
The Logarithmic Function and Its Derivative
For $b\gt0$, $b\ne1$, the logarithm to base $b$ is the inverse of $b^x$: for $x\gt0$, $$\log_bx=y\iff b^y=x.$$ Its domain is $(0,\infty)$ and its range is $\mathbb R$. The logarithm to base $e$ is the natural logarithm. Throughout this course $\log x$ means $\log_ex$ (calculators label it “ln”; the key marked “log” is base $10$).
Because $\log_bx$ undoes $b^x$, the graph of $y=\log_bx$ is the mirror image of $y=b^x$ in the line $y=x$, just as for the inverse trigonometric functions of Chapter 2. The laws of logarithms follow from the index laws: for $x,y\gt0$,
(i) $\dfrac{d}{dx}\log x=\dfrac1x$ for $x\gt0$; more generally $\dfrac{d}{dx}\log|x|=\dfrac1x$ for $x\ne0$.
(ii) For $a\gt0$: $\dfrac{d}{dx}a^x=a^x\log a$. (iii) For $a\gt0$, $a\ne1$, $x\gt0$: $\dfrac{d}{dx}\log_ax=\dfrac{1}{x\log a}$.
Proof. (i) Let $y=\log x$, so $e^y=x$. Differentiating implicitly, $e^y\dfrac{dy}{dx}=1$, so $\dfrac{dy}{dx}=\dfrac{1}{e^y}=\dfrac1x$. For $x\lt0$, $\log|x|=\log(-x)$ and the chain rule gives $\dfrac{1}{-x}\cdot(-1)=\dfrac1x$. (ii) $a^x=e^{x\log a}$, so its derivative is $e^{x\log a}\cdot\log a=a^x\log a$. (iii) $\log_ax=\dfrac{\log x}{\log a}$ and $\log a$ is a constant. $\blacksquare$
Notice the mirror picture: at $P(a,e^a)$ the curve $y=e^x$ has slope $e^a$, and at the mirror point $Q(e^a,a)$ the curve $y=\log x$ has slope $\dfrac{1}{e^a}$. Reflecting in $y=x$ swaps rise and run, so slopes at mirror points are reciprocals.
Logarithmic Differentiation
If $y=f(x)^{g(x)}$ with $f(x)\gt0$, or $y$ is a long product or quotient, take logarithms before differentiating. The laws of logarithms bring exponents down and turn products into sums.
- Make sure the function is positive on the interval (or work with $\log|y|$, which has the same derivative $\tfrac{y'}{y}$).
- Take $\log$ of both sides and expand with the laws of logarithms: $\log y=g(x)\log f(x)$, or a sum and difference of logs.
- Differentiate implicitly: the left side gives $\dfrac1y\dfrac{dy}{dx}$.
- Multiply by $y$, and substitute the original expression for $y$ back in.
- If $y$ is a sum such as $u+v$, do not take the log of the sum: differentiate $u$ and $v$ separately (each by logarithms if needed) and add.
1. Using the power rule on $x^x$. $\dfrac{d}{dx}x^x\ne x\cdot x^{x-1}$ and $\ne x^x\log x$. Variable base and variable exponent need logarithmic differentiation.
2. Taking the log of a sum. $\log(u+v)\ne\log u+\log v$. Split $y=u+v$ and differentiate each term separately (Example 6).
3. Forgetting to multiply back by $y$. Differentiating $\log y$ gives $\dfrac{y'}{y}$; the answer is $y'$, so multiply by $y$ — written in terms of $x$.
4. Logs of non-positive numbers. $\log x$ exists only for $x\gt0$. State the interval (e.g. $0\lt x\lt\pi$ for $\log\sin x$) or use $\log|y|$.
5. The wrong “log”. In this course $\log x=\log_ex$. If a problem means base $10$ it will say $\log_{10}x$, whose derivative carries the extra factor $\dfrac{1}{\log10}$.
6. Chain rule slips with $e$. $\dfrac{d}{dx}e^{x^2}=2xe^{x^2}$, not $x^2e^{x^2-1}$ — the exponent is not a power to bring down.
Exercises
- 1 $e^{5x}$
- 2 $e^{x^2+1}$
- 3 $x^3e^x$
- 4 $e^x\sin x$
- 5 $e^{\sqrt x}$, $x\gt0$
- 6 $\log(\cos x)$, $-\tfrac\pi2\lt x\lt\tfrac\pi2$
- 7 $\log\!\left(x+\sqrt{x^2+1}\right)$
- 8 $3^x$
- 9 $\log_2(x^2+3)$
- 10 $\dfrac{\log x}{x}$, $x\gt0$
- 1 Find the slope of $y=e^x$ at $(1,e)$ and of $y=\log x$ at $(e,1)$. What do you notice, and why?
- 2 Population. A town's population is modelled by $P(t)=5000e^{0.02t}$, $t$ in years. How fast is it growing at $t=10$?
- 3 Radioactive decay. A sample's mass is $m(t)=80e^{-0.1t}$ g after $t$ years. Find $m'(5)$ and show that $m'(t)=-0.1\,m(t)$.
- 4 Show that $y=Ae^{kx}$ satisfies $\dfrac{dy}{dx}=ky$ for any constants $A$ and $k$.
- 5 Find the value of $x$ at which the derivative of $f(x)=xe^{-x}$ is zero.
- 6 Show directly that $\dfrac{d}{dx}\log(-x)=\dfrac1x$ for $x\lt0$.
- 1 $y=x^{2x}$
- 2 $y=x^{\sqrt x}$
- 3 $y=(\log x)^x$, $x\gt1$
- 4 $y=(x+1)^2(x+2)^3(x+3)^4$
- 5 $y=\sqrt{\dfrac{x-1}{x+1}}$, $x\gt1$
- 6 $y=x^x+2^x$
- 7 $y=x^{\sin x}$
- 8 $y=\left(1+\dfrac1x\right)^x$
- 9 $e^y(x+1)=1$, $x\gt-1$; show also that $\dfrac{dy}{dx}=-e^y$
- 10 $xy=e^{x-y}$
Use x, numbers, + − * / ^ and brackets, e, pi, and sin cos tan sec cosec cot log (natural) exp sqrt asin acos atan abs with brackets, e.g. (sin(x))^x. A product may be written 2x or 2*x.
How this is examined: almost every Board paper has a 2- or 3-mark logarithmic differentiation question ($x^{\sin x}$, $(\sin x)^{\cos x}$, a sum of two such terms, or $x^y=y^x$); case studies use exponential growth and decay. JEE combines logarithmic differentiation with implicit equations and evaluation at a point.
E1. Board · 1 mark For $x\gt0$, $\dfrac{d}{dx}\left(e^{\log x}\right)$ equals (A) $1$ (B) $x$ (C) $e^x$ (D) $\dfrac1x$
E2. Board · 2 marks Find $\dfrac{dy}{dx}$ if $y=(\sin x)^{\cos x}$, $0\lt x\lt\pi$.
E3. Board · 3 marks Differentiate $y=x^x+x^{1/x}$ with respect to $x$, $x\gt0$.
E4. Board · Case study When a tablet is swallowed, the drug concentration in the blood is modelled by $C(t)=10\left(e^{-0.2t}-e^{-t}\right)$ mg/L, $t$ hours later (absorption from the stomach competes with clearance). (i) Find $C(0)$ and $C'(t)$. [2 marks] (ii) How fast is the concentration rising at the moment the tablet is swallowed? [1 mark] (iii) The concentration peaks when $C'(t)=0$. Find this time. [1 mark]
E5. JEE Main If $x^y=e^{x-y}$ ($x\gt0$), then $\dfrac{dy}{dx}$ at $x=e$ is (A) $\tfrac12$ (B) $\tfrac14$ (C) $1$ (D) $0$
E6. JEE Advanced (One or more options correct.) Let $f(x)=x^x$ for $x\gt0$. Then (A) $f'(1)=1$ (B) $f'(x)\lt0$ for $0\lt x\lt\tfrac1e$ (C) $f'(e)=2e^e$ (D) the least value of $f$ on $(0,\infty)$ is $\tfrac1e$
Research question. How close does daily compounding of interest come to “continuous” compounding $Pe^{rt}$ — and why does the number $e$ appear in banking at all?
Why it matters. Banks quote fixed-deposit and loan rates with different compounding periods (quarterly, monthly, daily), and the effective annual rate depends on that choice. Continuous compounding is the limiting case used in finance and economics, and its defining property — the balance grows at a rate proportional to itself, $A'(t)=rA(t)$ — is exactly the property $\tfrac{d}{dx}e^x=e^x$ of this section.
What to do.
- Look up a current fixed-deposit rate $r$ (for example on a bank's website or the RBI's published data) and choose $P=$ ₹$10\,000$, $t=5$ years.
- In a spreadsheet compute $A_n=P\left(1+\tfrac rn\right)^{nt}$ for $n=1,4,12,365$ and $8760$ (hourly), and $A_\infty=Pe^{rt}$.
- Plot $A_n$ against $\log n$ and describe how it approaches $A_\infty$. How many rupees separate daily and continuous compounding?
- Show that $A(t)=Pe^{rt}$ satisfies $A'(t)=rA(t)$, and use it to find how fast the continuous balance is growing (₹ per year) at $t=5$.
Tools: Spreadsheet (the functions EXP and LN); a published deposit rate.
Hand in: Your table, the plot, the growth rate at $t=5$, and a paragraph explaining to a younger student why “more frequent compounding” cannot make money grow without limit.
Going further. The “rule of 72” says money doubles in about $\tfrac{72}{100r}$ years. Using $e^{rt}=2$, derive the exact doubling time $\tfrac{\log2}{r}$ and explain where $72$ comes from.
🧪 Self-check quiz
Q1. $\dfrac{d}{dx}e^{2x}=$
Q2. For $x\gt0$, $\dfrac{d}{dx}\log(x^2)=$
Q3. For a constant $a\gt0$, $\dfrac{d}{dx}a^x=$
Q4. For $x\gt0$, $\dfrac{d}{dx}x^x=$
Q5. In this course, $\log x$ means