Derivatives of Logarithmic Functions

Finding derivatives involving ln(x) and other logarithmic functions

📊 Derivatives of Logarithmic Functions

The Natural Logarithm: ln(x)

The derivative of the natural logarithm is beautifully simple:

ddx[lnx]=1x\frac{d}{dx}[\ln x] = \frac{1}{x}

This formula only works for x>0x > 0 since lnx\ln x is only defined for positive numbers.

💡 Connection: Since exe^x and lnx\ln x are inverse functions, their derivatives are reciprocals in a sense!


The Chain Rule with ln

When taking the derivative of ln\ln of a function, use the Chain Rule:

General Formula

ddx[lnu]=uu=1uu\frac{d}{dx}[\ln u] = \frac{u'}{u} = \frac{1}{u} \cdot u'

where uu is any function of xx.

Examples

  1. ddx[ln(2x)]=22x=1x\frac{d}{dx}[\ln(2x)] = \frac{2}{2x} = \frac{1}{x}

  2. ddx[ln(x2)]=2xx2=2x\frac{d}{dx}[\ln(x^2)] = \frac{2x}{x^2} = \frac{2}{x}

  3. ddx[ln(3x+1)]=33x+1\frac{d}{dx}[\ln(3x + 1)] = \frac{3}{3x + 1}

  4. ddx[ln(sinx)]=cosxsinx=cotx\frac{d}{dx}[\ln(\sin x)] = \frac{\cos x}{\sin x} = \cot x

💡 Pattern: Derivative of the inside over the inside!


Logarithms with Other Bases

For logarithms with base aa:

ddx[logax]=1xlna\frac{d}{dx}[\log_a x] = \frac{1}{x \ln a}

Examples

  1. ddx[log10x]=1xln10\frac{d}{dx}[\log_{10} x] = \frac{1}{x \ln 10}

  2. ddx[log2x]=1xln2\frac{d}{dx}[\log_2 x] = \frac{1}{x \ln 2}

Why We Prefer ln

This is why calculus uses natural logs (ln\ln) instead of log10\log_{10}:

  • Formula is simpler: just 1x\frac{1}{x}
  • No extra lna\ln a factor to worry about!

Properties of Logarithms (For Simplifying)

Before differentiating, often use log properties to simplify:

Key Properties

  1. ln(ab)=lna+lnb\ln(ab) = \ln a + \ln b

  2. ln(ab)=lnalnb\ln\left(\frac{a}{b}\right) = \ln a - \ln b

  3. ln(an)=nlna\ln(a^n) = n\ln a

  4. ln(ex)=x\ln(e^x) = x and elnx=xe^{\ln x} = x

Example Using Properties

Find ddx[ln(x2x+1)]\frac{d}{dx}\left[\ln\left(\frac{x^2}{x+1}\right)\right]

Method 1: Direct (harder) ddx[ln(x2x+1)]=1x2x+1(2x)(x+1)(x2)(1)(x+1)2\frac{d}{dx}\left[\ln\left(\frac{x^2}{x+1}\right)\right] = \frac{1}{\frac{x^2}{x+1}} \cdot \frac{(2x)(x+1) - (x^2)(1)}{(x+1)^2} (messy!)

Method 2: Simplify first (easier) ln(x2x+1)=ln(x2)ln(x+1)=2lnxln(x+1)\ln\left(\frac{x^2}{x+1}\right) = \ln(x^2) - \ln(x+1) = 2\ln x - \ln(x+1)

Now differentiate: ddx[2lnxln(x+1)]=2x1x+1\frac{d}{dx}[2\ln x - \ln(x+1)] = \frac{2}{x} - \frac{1}{x+1}

Much simpler! ✓


Logarithmic Differentiation

A powerful technique for complicated products and quotients:

When to Use

Use logarithmic differentiation when you have:

  • Products of many functions
  • Quotients with complicated numerators and denominators
  • Variable bases and exponents: xxx^x, xsinxx^{\sin x}, etc.

The Process

  1. Take ln\ln of both sides
  2. Use log properties to simplify
  3. Differentiate implicitly
  4. Solve for dydx\frac{dy}{dx}
  5. Substitute back to eliminate yy

Example: y=xxy = x^x

Step 1: Take ln of both sides lny=ln(xx)=xlnx\ln y = \ln(x^x) = x\ln x

Step 2: Differentiate (implicitly on left, product rule on right) 1ydydx=(1)lnx+(x)1x=lnx+1\frac{1}{y} \cdot \frac{dy}{dx} = (1)\ln x + (x)\frac{1}{x} = \ln x + 1

Step 3: Solve for dydx\frac{dy}{dx} dydx=y(lnx+1)\frac{dy}{dx} = y(\ln x + 1)

Step 4: Substitute y=xxy = x^x dydx=xx(lnx+1)\frac{dy}{dx} = x^x(\ln x + 1)


⚠️ Common Mistakes

Mistake 1: Forgetting the Chain Rule

ddx[ln(x2)]=1x2\frac{d}{dx}[\ln(x^2)] = \frac{1}{x^2}ddx[ln(x2)]=2xx2=2x\frac{d}{dx}[\ln(x^2)] = \frac{2x}{x^2} = \frac{2}{x}

Mistake 2: Wrong Simplification

Using ln(x2)=2lnx\ln(x^2) = 2\ln x is valid only when x>0x > 0! Actually, ln(x2)=2lnx\ln(x^2) = 2\ln|x| to handle negative xx.

Mistake 3: Mixing Up Rules

ddx[lnx]=1x2\frac{d}{dx}[\ln x] = \frac{1}{x^2} (confused with ddx[1x]\frac{d}{dx}\left[\frac{1}{x}\right]) ✅ ddx[lnx]=1x\frac{d}{dx}[\ln x] = \frac{1}{x}

Mistake 4: Domain Issues

lnx\ln x is only defined for x>0x > 0. If needed for all x0x \neq 0, use lnx\ln|x|.


Special Derivatives Involving ln

Derivative of Absolute Value

ddx[lnx]=1x\frac{d}{dx}[\ln|x|] = \frac{1}{x}

This works for both positive and negative xx (but not x=0x = 0).

Useful Combination

ddx[xlnx]=lnx+x1x=lnx+1\frac{d}{dx}[x\ln x] = \ln x + x \cdot \frac{1}{x} = \ln x + 1

Integration Connection

Since ddx[lnx]=1x\frac{d}{dx}[\ln x] = \frac{1}{x}, we have:

1xdx=lnx+C\int \frac{1}{x}\,dx = \ln|x| + C


Applications

Exponential Growth/Decay

If y=Cekty = Ce^{kt}, then lny=lnC+kt\ln y = \ln C + kt

Differentiating: 1ydydt=k\frac{1}{y}\frac{dy}{dt} = k, so dydt=ky\frac{dy}{dt} = ky

Economics: Elasticity

Elasticity E=pqdqdpE = \frac{p}{q} \cdot \frac{dq}{dp} can be written using logs:

E=d(lnq)d(lnp)E = \frac{d(\ln q)}{d(\ln p)}

Relative Rate of Change

ddx[lnf(x)]=f(x)f(x)\frac{d}{dx}[\ln f(x)] = \frac{f'(x)}{f(x)} gives the relative (or percentage) rate of change.


📝 Key Formulas to Memorize

  1. ddx[lnx]=1x\frac{d}{dx}[\ln x] = \frac{1}{x}

  2. ddx[lnu]=uu\frac{d}{dx}[\ln u] = \frac{u'}{u} (Chain Rule)

  3. ddx[logax]=1xlna\frac{d}{dx}[\log_a x] = \frac{1}{x\ln a}

  4. ddx[lnx]=1x\frac{d}{dx}[\ln|x|] = \frac{1}{x}


Practice Tips

  1. Simplify first using log properties when possible
  2. Use logarithmic differentiation for products, quotients, and variable exponents
  3. Remember ddx[lnu]=uu\frac{d}{dx}[\ln u] = \frac{u'}{u} - "derivative of inside over inside"
  4. Factor when you get expressions like 2xx2=2x\frac{2x}{x^2} = \frac{2}{x}
  5. Check domains - ln is only defined for positive arguments

📚 Practice Problems

1Problem 1medium

Question:

Find the derivative of f(x)=ln(x3+2x)f(x) = \ln(x^3 + 2x).

💡 Show Solution

Use the Chain Rule with u=x3+2xu = x^3 + 2x:


Step 1: Apply the ln derivative formula

ddx[lnu]=uu\frac{d}{dx}[\ln u] = \frac{u'}{u}


Step 2: Find uu'

u=x3+2xu = x^3 + 2x

u=3x2+2u' = 3x^2 + 2


Step 3: Apply the formula

f(x)=3x2+2x3+2xf'(x) = \frac{3x^2 + 2}{x^3 + 2x}

Answer: f(x)=3x2+2x3+2x\displaystyle f'(x) = \frac{3x^2 + 2}{x^3 + 2x}

Note: This cannot be simplified further

2Problem 2hard

Question:

Find dydx\frac{dy}{dx} if y=ln(x2x+1x1)y = \ln\left(\frac{x^2\sqrt{x+1}}{x-1}\right).

💡 Show Solution

Step 1: Simplify using log properties first!

y=ln(x2x+1x1)y = \ln\left(\frac{x^2\sqrt{x+1}}{x-1}\right)

Using ln(ab)=lnalnb\ln\left(\frac{a}{b}\right) = \ln a - \ln b:

y=ln(x2x+1)ln(x1)y = \ln(x^2\sqrt{x+1}) - \ln(x-1)

Using ln(ab)=lna+lnb\ln(ab) = \ln a + \ln b:

y=ln(x2)+lnx+1ln(x1)y = \ln(x^2) + \ln\sqrt{x+1} - \ln(x-1)

Using ln(an)=nlna\ln(a^n) = n\ln a and x+1=(x+1)1/2\sqrt{x+1} = (x+1)^{1/2}:

y=2lnx+12ln(x+1)ln(x1)y = 2\ln x + \frac{1}{2}\ln(x+1) - \ln(x-1)


Step 2: Now differentiate (much easier!)

dydx=21x+121x+11x1\frac{dy}{dx} = 2 \cdot \frac{1}{x} + \frac{1}{2} \cdot \frac{1}{x+1} - \frac{1}{x-1}

=2x+12(x+1)1x1= \frac{2}{x} + \frac{1}{2(x+1)} - \frac{1}{x-1}

Answer: dydx=2x+12(x+1)1x1\displaystyle\frac{dy}{dx} = \frac{2}{x} + \frac{1}{2(x+1)} - \frac{1}{x-1}

Key Lesson: Always simplify with log properties BEFORE differentiating!

3Problem 3hard

Question:

Use logarithmic differentiation to find dydx\frac{dy}{dx} if y=(2x+1)xy = (2x + 1)^x.

💡 Show Solution

This has a variable base AND variable exponent - perfect for logarithmic differentiation!


Step 1: Take ln of both sides

lny=ln[(2x+1)x]\ln y = \ln[(2x+1)^x]


Step 2: Use log properties

lny=xln(2x+1)\ln y = x\ln(2x+1)


Step 3: Differentiate both sides

Left side (implicit): ddx[lny]=1ydydx\frac{d}{dx}[\ln y] = \frac{1}{y}\frac{dy}{dx}

Right side (product rule): ddx[xln(2x+1)]=(1)ln(2x+1)+(x)22x+1\frac{d}{dx}[x\ln(2x+1)] = (1)\ln(2x+1) + (x)\frac{2}{2x+1}

=ln(2x+1)+2x2x+1= \ln(2x+1) + \frac{2x}{2x+1}


Step 4: Set them equal

1ydydx=ln(2x+1)+2x2x+1\frac{1}{y}\frac{dy}{dx} = \ln(2x+1) + \frac{2x}{2x+1}


Step 5: Solve for dydx\frac{dy}{dx}

dydx=y[ln(2x+1)+2x2x+1]\frac{dy}{dx} = y\left[\ln(2x+1) + \frac{2x}{2x+1}\right]


Step 6: Substitute back y=(2x+1)xy = (2x+1)^x

dydx=(2x+1)x[ln(2x+1)+2x2x+1]\frac{dy}{dx} = (2x+1)^x\left[\ln(2x+1) + \frac{2x}{2x+1}\right]

Answer: dydx=(2x+1)x[ln(2x+1)+2x2x+1]\displaystyle\frac{dy}{dx} = (2x+1)^x\left[\ln(2x+1) + \frac{2x}{2x+1}\right]