Exponential and Logarithmic Functions

The Exponential Function

For a positive base b>0, b1b>0,\ b\neq 1, the exponential function is y=bx.y=b^x. In calculus, the most important base is the mathematical constant e2.718e\approx 2.718. The function y=exy=e^x is called the natural exponential function.

For y=exy=e^x:

  • Domain: R\mathbb{R}
  • Range: (0,)(0,\infty)

Key properties

  • It always passes through (0,1)(0,1) because e0=1e^0=1.
  • It is always positive.
  • It is strictly increasing.
  • Its derivative is the function itself.

The Logarithmic Function

If b>0, b1b>0,\ b\neq 1, then logba=x    bx=a.\log_b a = x \iff b^x=a. Thus, the logarithmic function is the inverse of the exponential function. When the base is ee, it is called the natural logarithm, written as lnxorlogex.\ln x \quad \text{or} \quad \log_e x.

For y=lnxy=\ln x:

  • Domain: (0,)(0,\infty)
  • Range: R\mathbb{R}

Key properties

  • It always passes through (1,0)(1,0) because ln1=0\ln 1=0.
  • It is defined only for positive real numbers.
  • It is strictly increasing.
  • It is the inverse of exe^x.

The graphs of y=exy=e^x and y=lnxy=\ln x are reflections of each other in the line y=xy=x.


Properties of Logarithms

Let x,y>0x,y>0 and let the base bb satisfy b>0, b1b>0,\ b\neq 1. Then:

  1. Product rule logb(xy)=logbx+logby\log_b(xy)=\log_b x+\log_b y

  2. Quotient rule logb(xy)=logbxlogby\log_b\left(\frac{x}{y}\right)=\log_b x-\log_b y

  3. Power rule logb(xn)=nlogbx\log_b(x^n)=n\log_b x

  4. Change of base formula logap=logbplogba\log_a p = \frac{\log_b p}{\log_b a} In particular, logax=lnxlna.\log_a x = \frac{\ln x}{\ln a}.

  5. Inverse relation with exponentials elnx=x(x>0),ln(ex)=x.e^{\ln x}=x \quad (x>0), \qquad \ln(e^x)=x.

These identities are extremely important in differentiation, especially in logarithmic differentiation.

Important caution: log(A+B)logA+logB.\log(A+B) \ne \log A + \log B. This is one of the most common mistakes students make.

Note: In many calculus contexts, when the base is not specified, logx\log x is taken to mean the natural logarithm lnx\ln x. In school-level problems, follow the convention being used in the chapter or textbook.


Derivatives of Exponential and Logarithmic Functions

The standard derivative formulas are:

  1. Derivative of natural exponential function ddx(ex)=ex\frac{d}{dx}(e^x)=e^x

  2. Derivative of natural logarithm ddx(lnx)=1x,x>0\frac{d}{dx}(\ln x)=\frac{1}{x}, \qquad x>0

  3. Derivative of general exponential function ddx(ax)=axlna,a>0, a1\frac{d}{dx}(a^x)=a^x\ln a, \qquad a>0,\ a\ne 1

  4. Derivative of logarithm to base aa ddx(logax)=1xlna,x>0\frac{d}{dx}(\log_a x)=\frac{1}{x\ln a}, \qquad x>0

These formulas are often used together with the chain rule, product rule, and quotient rule. For example, ddx(eu(x))=eu(x)u(x),\frac{d}{dx}(e^{u(x)})=e^{u(x)}u'(x), and ddx(ln(u(x)))=u(x)u(x)\frac{d}{dx}(\ln(u(x)))=\frac{u'(x)}{u(x)} whenever u(x)>0u(x)>0.


Logarithmic Differentiation

Logarithmic differentiation is a powerful technique used when ordinary differentiation becomes long or awkward.

It is especially useful in the following situations:

  • when the function is of the form y=[u(x)]v(x),y=[u(x)]^{v(x)}, that is, a variable base raised to a variable exponent;
  • when the function is a product or quotient of many complicated factors;
  • when fractional powers, radicals, and multiple terms appear together in a form that can be simplified using logarithms.

Steps of logarithmic differentiation

Step 1: Let y=f(x).y=f(x). Take natural logarithm on both sides: lny=ln(f(x)).\ln y = \ln(f(x)).

Step 2: Use logarithmic properties to simplify the right-hand side. Convert:

  • products into sums,
  • quotients into differences,
  • powers into multipliers.

Step 3: Differentiate both sides implicitly with respect to xx. Since ddx(lny)=1ydydx,\frac{d}{dx}(\ln y)=\frac{1}{y}\frac{dy}{dx}, this produces an equation involving dydx\dfrac{dy}{dx}.

Step 4: Solve for dydx\dfrac{dy}{dx}.

Step 5: Replace yy by its original expression so that the final answer is written purely in terms of xx.

Important caution: Logarithmic differentiation cannot be applied directly to a sum such as y=u+vy=u+v by writing lny=lnu+lnv\ln y = \ln u + \ln v, because that is false. In such cases, first split the function into separate terms and differentiate each part individually.


Solved Examples

Example 1: Chain Rule with Exponential Function

Differentiate y=exy=e^{-x} with respect to xx.

Solution: The function is a composition of the exponential function and the linear function x-x. Let u(x)=x.u(x)=-x. Then y=eu(x).y=e^{u(x)}. Using the chain rule, dydx=eu(x)u(x).\frac{dy}{dx}=e^{u(x)}\cdot u'(x). Now, u(x)=ddx(x)=1.u'(x)=\frac{d}{dx}(-x)=-1. Therefore, dydx=ex(1)=ex.\frac{dy}{dx}=e^{-x}(-1)=-e^{-x}.

Answer: ex-e^{-x}


Example 2: Quotient Rule with Exponential Function

Find the derivative of y=exsinxy=\dfrac{e^x}{\sin x}.

Solution: Let u=ex,v=sinx.u=e^x, \qquad v=\sin x. Then y=uv.y=\frac{u}{v}. Using the quotient rule, dydx=uvuvv2.\frac{dy}{dx}=\frac{u'v-uv'}{v^2}. Now, u=ex,v=cosx.u'=e^x, \qquad v'=\cos x. So, dydx=exsinxexcosxsin2x.\frac{dy}{dx}=\frac{e^x\sin x - e^x\cos x}{\sin^2 x}. Factor out exe^x in the numerator: dydx=ex(sinxcosx)sin2x.\frac{dy}{dx}=\frac{e^x(\sin x-\cos x)}{\sin^2 x}.

Answer: ex(sinxcosx)sin2x\frac{e^x(\sin x-\cos x)}{\sin^2 x}


Example 3: Chain Rule with Logarithmic Function

Differentiate y=log(cosex)y=\log(\cos e^x) with respect to xx.

Solution: Assuming log\log denotes natural logarithm, we write y=ln(cosex).y=\ln(\cos e^x). This is a composition of three functions:

  • outermost: lnu\ln u,
  • middle: cosv\cos v,
  • innermost: exe^x.

Using the chain rule, dydx=1cosexddx(cosex).\frac{dy}{dx}=\frac{1}{\cos e^x}\cdot \frac{d}{dx}(\cos e^x). Now, ddx(cosex)=sin(ex)ddx(ex).\frac{d}{dx}(\cos e^x)=-\sin(e^x)\cdot \frac{d}{dx}(e^x). Since ddx(ex)=ex,\frac{d}{dx}(e^x)=e^x, we get ddx(cosex)=sin(ex)ex.\frac{d}{dx}(\cos e^x)=-\sin(e^x)e^x. Substitute back: dydx=exsin(ex)cos(ex)=extan(ex).\frac{dy}{dx}=\frac{-e^x\sin(e^x)}{\cos(e^x)}=-e^x\tan(e^x).

Answer: extan(ex)-e^x\tan(e^x)


Example 4: Basic Logarithmic Differentiation

Differentiate y=xxy=x^x with respect to xx.

Solution: Since both the base and exponent involve the variable xx, ordinary power rules do not apply directly. So we use logarithmic differentiation.

Take natural logarithm on both sides: lny=ln(xx).\ln y = \ln(x^x). Using the logarithmic power rule, lny=xlnx.\ln y = x\ln x. Now differentiate both sides with respect to xx. On the left, ddx(lny)=1ydydx.\frac{d}{dx}(\ln y)=\frac{1}{y}\frac{dy}{dx}. On the right, use the product rule: ddx(xlnx)=x1x+lnx1=1+lnx.\frac{d}{dx}(x\ln x)=x\cdot\frac{1}{x}+\ln x\cdot 1 = 1+\ln x. So, 1ydydx=1+lnx.\frac{1}{y}\frac{dy}{dx}=1+\ln x. Multiply both sides by yy: dydx=y(1+lnx).\frac{dy}{dx}=y(1+\ln x). Now substitute y=xxy=x^x: dydx=xx(1+lnx).\frac{dy}{dx}=x^x(1+\ln x).

Answer: xx(1+lnx)x^x(1+\ln x)


Example 5: Logarithmic Differentiation for Complex Products

Differentiate y=(x1)(x2)(x3)(x4)(x5)y=\sqrt{\dfrac{(x-1)(x-2)}{(x-3)(x-4)(x-5)}} with respect to xx.

Solution: First rewrite the square root as power 12\tfrac12: y=((x1)(x2)(x3)(x4)(x5))1/2.y=\left(\frac{(x-1)(x-2)}{(x-3)(x-4)(x-5)}\right)^{1/2}. Take natural logarithm on both sides: lny=12ln((x1)(x2)(x3)(x4)(x5)).\ln y = \frac12 \ln\left(\frac{(x-1)(x-2)}{(x-3)(x-4)(x-5)}\right). Now expand using logarithmic rules: lny=12[ln(x1)+ln(x2)ln(x3)ln(x4)ln(x5)].\ln y = \frac12\big[\ln(x-1)+\ln(x-2)-\ln(x-3)-\ln(x-4)-\ln(x-5)\big]. Differentiate both sides: 1ydydx=12[1x1+1x21x31x41x5].\frac{1}{y}\frac{dy}{dx} = \frac12\left[\frac{1}{x-1}+\frac{1}{x-2}-\frac{1}{x-3}-\frac{1}{x-4}-\frac{1}{x-5}\right]. Multiply through by yy: dydx=y2[1x1+1x21x31x41x5].\frac{dy}{dx} = \frac{y}{2}\left[\frac{1}{x-1}+\frac{1}{x-2}-\frac{1}{x-3}-\frac{1}{x-4}-\frac{1}{x-5}\right]. Finally substitute the original value of yy back: dydx=12(x1)(x2)(x3)(x4)(x5)[1x1+1x21x31x41x5].\frac{dy}{dx}=\frac12\sqrt{\frac{(x-1)(x-2)}{(x-3)(x-4)(x-5)}}\left[\frac{1}{x-1}+\frac{1}{x-2}-\frac{1}{x-3}-\frac{1}{x-4}-\frac{1}{x-5}\right].

Answer: 12(x1)(x2)(x3)(x4)(x5)[1x1+1x21x31x41x5]\frac12\sqrt{\frac{(x-1)(x-2)}{(x-3)(x-4)(x-5)}}\left[\frac{1}{x-1}+\frac{1}{x-2}-\frac{1}{x-3}-\frac{1}{x-4}-\frac{1}{x-5}\right]


Example 6: Warning - Sum of Variable Powers

Differentiate y=xsinx+(sinx)cosxy=x^{\sin x}+(\sin x)^{\cos x}.

Solution: A logarithm cannot be taken directly over a sum in the form ln(A+B)=lnA+lnB,\ln(A+B)=\ln A + \ln B, which is false. So we must differentiate the two terms separately.

Let u=xsinx,v=(sinx)cosx.u=x^{\sin x}, \qquad v=(\sin x)^{\cos x}. Then y=u+v    dydx=dudx+dvdx.y=u+v \implies \frac{dy}{dx}=\frac{du}{dx}+\frac{dv}{dx}.

First term: u=xsinxu=x^{\sin x} Take logarithm: lnu=sinxlnx.\ln u = \sin x\ln x. Differentiate: 1ududx=cosxlnx+sinx1x.\frac{1}{u}\frac{du}{dx}=\cos x\ln x + \sin x\cdot\frac{1}{x}. So, dudx=xsinx(cosxlnx+sinxx).\frac{du}{dx}=x^{\sin x}\left(\cos x\ln x + \frac{\sin x}{x}\right).

Second term: v=(sinx)cosxv=(\sin x)^{\cos x} Take logarithm: lnv=cosxln(sinx).\ln v = \cos x\ln(\sin x). Differentiate using product rule: 1vdvdx=(sinx)ln(sinx)+cosxcosxsinx.\frac{1}{v}\frac{dv}{dx}=(-\sin x)\ln(\sin x) + \cos x\cdot\frac{\cos x}{\sin x}. Since cosxsinx=cotx,\frac{\cos x}{\sin x}=\cot x, this becomes 1vdvdx=sinxln(sinx)+cosxcotx.\frac{1}{v}\frac{dv}{dx} = -\sin x\ln(\sin x) + \cos x\cot x. Hence, dvdx=(sinx)cosx(cosxcotxsinxln(sinx)).\frac{dv}{dx}=(\sin x)^{\cos x}\big(\cos x\cot x - \sin x\ln(\sin x)\big).

Add both parts: dydx=xsinx(sinxx+cosxlnx)+(sinx)cosx(cosxcotxsinxln(sinx)).\frac{dy}{dx}=x^{\sin x}\left(\frac{\sin x}{x}+\cos x\ln x\right) + (\sin x)^{\cos x}\big(\cos x\cot x - \sin x\ln(\sin x)\big).

Answer: xsinx(sinxx+cosxlnx)+(sinx)cosx(cosxcotxsinxln(sinx))x^{\sin x}\left(\frac{\sin x}{x}+\cos x\ln x\right) + (\sin x)^{\cos x}\big(\cos x\cot x - \sin x\ln(\sin x)\big)


Example 7: Implicit Equation with Logarithmic Differentiation

Find dydx\frac{dy}{dx} if yx=xyy^x=x^y.

Solution: Take natural logarithm on both sides: ln(yx)=ln(xy).\ln(y^x)=\ln(x^y). Using power rule of logarithms, xlny=ylnx.x\ln y = y\ln x. Now differentiate both sides implicitly with respect to xx. On the left, using the product rule: ddx(xlny)=lny+x1ydydx.\frac{d}{dx}(x\ln y)=\ln y + x\cdot\frac{1}{y}\frac{dy}{dx}. On the right: ddx(ylnx)=dydxlnx+y1x.\frac{d}{dx}(y\ln x)=\frac{dy}{dx}\ln x + y\cdot\frac{1}{x}. So, lny+xydydx=lnxdydx+yx.\ln y + \frac{x}{y}\frac{dy}{dx} = \ln x\frac{dy}{dx} + \frac{y}{x}. Bring derivative terms to one side: xydydxlnxdydx=yxlny.\frac{x}{y}\frac{dy}{dx} - \ln x\frac{dy}{dx} = \frac{y}{x} - \ln y. Factor out dydx\dfrac{dy}{dx}: dydx(xylnx)=yxlny.\frac{dy}{dx}\left(\frac{x}{y}-\ln x\right)=\frac{y}{x}-\ln y. Hence, dydx=yxlnyxylnx.\frac{dy}{dx}=\frac{\frac{y}{x}-\ln y}{\frac{x}{y}-\ln x}. Multiplying numerator and denominator suitably to remove fractions, dydx=y(yxlny)x(xylnx).\frac{dy}{dx}=\frac{y(y-x\ln y)}{x(x-y\ln x)}.

Answer: y(yxlny)x(xylnx)\frac{y(y-x\ln y)}{x(x-y\ln x)}


Example 8: Derivative of a Function with Respect to Another Base

Differentiate y=axy=a^x with respect to xx, where aa is a positive constant, using logarithmic differentiation.

Solution: Take natural logarithm of both sides: lny=ln(ax)=xlna.\ln y = \ln(a^x)=x\ln a. Differentiate both sides: 1ydydx=lna.\frac{1}{y}\frac{dy}{dx}=\ln a. Now multiply by yy: dydx=ylna.\frac{dy}{dx}=y\ln a. Substitute y=axy=a^x: dydx=axlna.\frac{dy}{dx}=a^x\ln a.

Answer: axlnaa^x\ln a


Example 9: Change of Base Formula

Find the derivative of y=log7(logx)y=\log_7(\log x).

Solution: Use the change-of-base formula: log7(logx)=ln(logx)ln7.\log_7(\log x)=\frac{\ln(\log x)}{\ln 7}. So, y=1ln7ln(logx).y=\frac{1}{\ln 7}\ln(\log x). Treat 1ln7\dfrac{1}{\ln 7} as a constant and differentiate: dydx=1ln7ddx[ln(logx)].\frac{dy}{dx}=\frac{1}{\ln 7}\cdot\frac{d}{dx}[\ln(\log x)]. Now use the chain rule: ddx[ln(logx)]=1logxddx(logx).\frac{d}{dx}[\ln(\log x)] = \frac{1}{\log x}\cdot\frac{d}{dx}(\log x). Assuming logx=lnx\log x=\ln x, we get ddx(logx)=1x.\frac{d}{dx}(\log x)=\frac{1}{x}. Therefore, dydx=1ln71logx1x=1xln7logx.\frac{dy}{dx}=\frac{1}{\ln 7}\cdot\frac{1}{\log x}\cdot\frac{1}{x} =\frac{1}{x\ln 7\,\log x}.

Answer: 1xln7logx\frac{1}{x\ln 7\,\log x}


Example 10: Inverse Trigonometry inside Exponents

Differentiate y=esin1xy=e^{\sin^{-1}x}.

Solution: This is a composition of the exponential function and inverse sine function. Using the chain rule, dydx=esin1xddx(sin1x).\frac{dy}{dx}=e^{\sin^{-1}x}\cdot\frac{d}{dx}(\sin^{-1}x). Now use the standard derivative formula: ddx(sin1x)=11x2.\frac{d}{dx}(\sin^{-1}x)=\frac{1}{\sqrt{1-x^2}}. Therefore, dydx=esin1x1x2.\frac{dy}{dx}=\frac{e^{\sin^{-1}x}}{\sqrt{1-x^2}}.

Answer: esin1x1x2\frac{e^{\sin^{-1}x}}{\sqrt{1-x^2}}


Example 11: Complex Logarithmic Differentiation

Find dydx\frac{dy}{dx} if y=x1xy=x^{\frac{1}{x}}.

Solution: Since both base and exponent involve xx, use logarithmic differentiation. Take natural logarithm: lny=ln(x1/x)=1xlnx.\ln y = \ln\left(x^{1/x}\right)=\frac{1}{x}\ln x. Differentiate both sides: 1ydydx=ddx(lnxx).\frac{1}{y}\frac{dy}{dx}=\frac{d}{dx}\left(\frac{\ln x}{x}\right). Use either product rule or quotient rule. Writing as x1lnxx^{-1}\ln x, ddx(x1lnx)=x11x+lnx(x2).\frac{d}{dx}(x^{-1}\ln x)=x^{-1}\cdot\frac{1}{x} + \ln x\cdot(-x^{-2}). So, 1ydydx=1x2lnxx2=1lnxx2.\frac{1}{y}\frac{dy}{dx}=\frac{1}{x^2}-\frac{\ln x}{x^2}=\frac{1-\ln x}{x^2}. Multiply through by yy: dydx=y1lnxx2.\frac{dy}{dx}=y\cdot\frac{1-\ln x}{x^2}. Now substitute y=x1/xy=x^{1/x}: dydx=x1/x1lnxx2.\frac{dy}{dx}=x^{1/x}\cdot\frac{1-\ln x}{x^2}.

Answer: x1/x(1lnxx2)x^{1/x}\left(\frac{1-\ln x}{x^2}\right)