Math Lab
Home/Class XII/Ch 5/Logarithmic differentiation

Logarithmic differentiation

When a function is a product of many factors, or has the form uvu^v where both uu and vv depend on xx, taking the natural logarithm before differentiating simplifies the calculation dramatically. The trick: log(uv)=logu+logv\log(uv) = \log u + \log v converts multiplication into addition, and log(uv)=vlogu\log(u^v) = v \log u separates the exponent from the base.

The procedure

To differentiate y=f(x)y = f(x) logarithmically:

  1. Take log\log of both sides: logy=logf(x)\log y = \log f(x).
  2. Differentiate using implicit differentiation: 1ydydx=ddx[logf(x)]\dfrac{1}{y}\dfrac{dy}{dx} = \dfrac{d}{dx}[\log f(x)].
  3. Solve: dydx=yddx[logf(x)]=f(x)ddx[logf(x)]\dfrac{dy}{dx} = y \cdot \dfrac{d}{dx}[\log f(x)] = f(x) \cdot \dfrac{d}{dx}[\log f(x)].

When to use it

The technique is essential when:

  • The function is f(x)g(x)f(x)^{g(x)} , neither pure power rule nor pure exponential applies.
  • The function is a long product/quotient: log\log turns the product into a sum.

Worked example: xxx^x

Let y=xxy = x^x. Take log\log: logy=xlogx\log y = x \log x. Differentiate: 1ydydx=logx+1\dfrac{1}{y} \dfrac{dy}{dx} = \log x + 1. So dydx=xx(logx+1)\dfrac{dy}{dx} = x^x (\log x + 1).

(sinx)cosx(\sin x)^{\cos x}

logy=cosxlog(sinx)\log y = \cos x \cdot \log(\sin x). Differentiate: 1ydydx=sinxlog(sinx)+cosxcosxsinx=sinxlog(sinx)+cotxcosx\dfrac{1}{y}\dfrac{dy}{dx} = -\sin x \cdot \log(\sin x) + \cos x \cdot \dfrac{\cos x}{\sin x} = -\sin x \log(\sin x) + \cot x \cos x.

So dydx=(sinx)cosx[sinxlog(sinx)+cotxcosx]\dfrac{dy}{dx} = (\sin x)^{\cos x}\big[-\sin x \log(\sin x) + \cot x \cos x\big].

A product example

Differentiate y=(x+1)2(2x1)3(x2+1)4y = \dfrac{(x + 1)^2 (2x - 1)^3}{(x^2 + 1)^4}.

logy=2log(x+1)+3log(2x1)4log(x2+1)\log y = 2 \log(x + 1) + 3 \log(2x - 1) - 4 \log(x^2 + 1).

Differentiate: 1ydydx=2x+1+62x18xx2+1\dfrac{1}{y}\dfrac{dy}{dx} = \dfrac{2}{x + 1} + \dfrac{6}{2x - 1} - \dfrac{8x}{x^2 + 1}.

So dydx=y[2x+1+62x18xx2+1]\dfrac{dy}{dx} = y\left[\dfrac{2}{x + 1} + \dfrac{6}{2x - 1} - \dfrac{8x}{x^2 + 1}\right], with yy as given.

Worked examples

Example 1. Differentiate y=xsinxy = x^{\sin x}.

logy=sinxlogx\log y = \sin x \log x. 1ydydx=cosxlogx+sinxx\dfrac{1}{y}\dfrac{dy}{dx} = \cos x \log x + \dfrac{\sin x}{x}. So dydx=xsinx(cosxlogx+sinxx)\dfrac{dy}{dx} = x^{\sin x}\left(\cos x \log x + \dfrac{\sin x}{x}\right).

Example 2. Differentiate y=(logx)xy = (\log x)^x.

logy=xlog(logx)\log y = x \log(\log x). 1ydydx=log(logx)+x1/xlogx=log(logx)+1logx\dfrac{1}{y}\dfrac{dy}{dx} = \log(\log x) + x \cdot \dfrac{1/x}{\log x} = \log(\log x) + \dfrac{1}{\log x}. So dydx=(logx)x[log(logx)+1logx]\dfrac{dy}{dx} = (\log x)^x\left[\log(\log x) + \dfrac{1}{\log x}\right].

Example 3. If yx=xyy^x = x^y, find dydx\dfrac{dy}{dx}.

Take log\log: xlogy=ylogxx \log y = y \log x. Differentiate: logy+xydydx=dydxlogx+yx\log y + \dfrac{x}{y}\dfrac{dy}{dx} = \dfrac{dy}{dx}\log x + \dfrac{y}{x}. Solve: dydx(xylogx)=yxlogy\dfrac{dy}{dx}\left(\dfrac{x}{y} - \log x\right) = \dfrac{y}{x} - \log y. So dydx=y(yxlogy)x(xylogx)\dfrac{dy}{dx} = \dfrac{y(y - x \log y)}{x(x - y \log x)} after multiplying through.

Example 4. Differentiate y=xx+x1/xy = x^x + x^{1/x}.

Each term needs logarithmic differentiation.

u=xxu = x^x: dudx=xx(logx+1)\dfrac{du}{dx} = x^x(\log x + 1).

v=x1/xv = x^{1/x}: logv=logxx\log v = \dfrac{\log x}{x}. 1vdvdx=1logxx2\dfrac{1}{v}\dfrac{dv}{dx} = \dfrac{1 - \log x}{x^2}. So dvdx=x1/x1logxx2\dfrac{dv}{dx} = x^{1/x} \cdot \dfrac{1 - \log x}{x^2}.

dydx=xx(logx+1)+x1/x1logxx2\dfrac{dy}{dx} = x^x(\log x + 1) + x^{1/x} \cdot \dfrac{1 - \log x}{x^2}.

Example 5. Differentiate y=(x1)(x2)(x3)(x4)y = \sqrt{\dfrac{(x - 1)(x - 2)}{(x - 3)(x - 4)}}.

logy=12[log(x1)+log(x2)log(x3)log(x4)]\log y = \tfrac{1}{2}[\log(x - 1) + \log(x - 2) - \log(x - 3) - \log(x - 4)].

1ydydx=12[1x1+1x21x31x4]\dfrac{1}{y}\dfrac{dy}{dx} = \tfrac{1}{2}\left[\dfrac{1}{x - 1} + \dfrac{1}{x - 2} - \dfrac{1}{x - 3} - \dfrac{1}{x - 4}\right].

So dydx=y2[1x1+1x21x31x4]\dfrac{dy}{dx} = \dfrac{y}{2}\left[\dfrac{1}{x - 1} + \dfrac{1}{x - 2} - \dfrac{1}{x - 3} - \dfrac{1}{x - 4}\right].

Example 6. Differentiate y=xxxy = x^{x^x}.

y=xuy = x^{u} where u=xxu = x^x. logy=ulogx=xxlogx\log y = u \log x = x^x \log x.

1ydydx=ddx(xxlogx)=(xx(logx+1))logx+xx1x=xx[(logx)2+logx+1/x]\dfrac{1}{y}\dfrac{dy}{dx} = \dfrac{d}{dx}(x^x \log x) = (x^x(\log x + 1)) \log x + x^x \cdot \dfrac{1}{x} = x^x[(\log x)^2 + \log x + 1/x].

So dydx=xxxxx[(logx)2+logx+1x]\dfrac{dy}{dx} = x^{x^x} \cdot x^x \left[(\log x)^2 + \log x + \dfrac{1}{x}\right].

Try it yourself

  1. Differentiate y=xxy = x^x.
  2. Differentiate y=(x2+1)xy = (x^2 + 1)^x.
  3. Differentiate y=xsinxy = x^{\sin x}.
  4. Differentiate y=(2x+1)3(3x1)2(x+2)y = \dfrac{(2x + 1)^3}{(3x - 1)^2 (x + 2)} using log differentiation.
  5. If y=(1+x)(1+x2)(1+x4)y = (1 + x)(1 + x^2)(1 + x^4), differentiate using logs.
  6. Differentiate y=xxxy = \sqrt{x \sqrt{x \sqrt{x}}}.
  7. Differentiate y=xxxy = x^{x^x}.
  8. Differentiate y=(sinx)xy = (\sin x)^x.
  9. Differentiate y=(sinx)sinxy = (\sin x)^{\sin x}.
  10. Differentiate y=xlogxy = x^{\log x}.
  11. Differentiate y=(logx)sinxy = (\log x)^{\sin x}.
  12. If xyyx=(x+y)x+yx^y \cdot y^x = (x + y)^{x + y}, set up the log derivative (do not solve).
  13. Differentiate y=(1+tanx)xy = (1 + \tan x)^x.
  14. Differentiate y=e2x(x1)2xx+1y = \dfrac{e^{2x}(x - 1)^2}{x \sqrt{x + 1}} using logs.

Pitfalls / Tricks

  • log\log of a product becomes a sum , that is the whole point of log differentiation.
  • Always restate the original yy when writing the final dy/dxdy/dx.
  • For functions like xxx^x where both base and exponent depend on xx, neither plain power rule nor plain exponential rule works. Log first.
  • For products of more than three factors, log differentiation saves enormous time.
  • Watch for domain issues: logf(x)\log f(x) requires f(x)>0f(x) > 0.

Next, parametric and higher-order derivatives.

Practice quiz

Quick check on this topic.

Quiz
Quick check : Logarithmic differentiation
6 questions · pick the best answer
Q1

Q2

Q3

Q4

Q5

Q6