# Logarithmic differentiation

In calculus, logarithmic differentiation or differentiation by taking logarithms is a method used to differentiate functions by employing the logarithmic derivative of a function f,[1]

${\displaystyle (\ln f)'={\frac {f'}{f}}\quad \implies \quad f'=f\cdot (\ln f)'.}$

The technique is often performed in cases where it is easier to differentiate the logarithm of a function rather than the function itself. This usually occurs in cases where the function of interest is composed of a product of a number of parts, so that a logarithmic transformation will turn it into a sum of separate parts (which is much easier to differentiate). It can also be useful when applied to functions raised to the power of variables or functions. Logarithmic differentiation relies on the chain rule as well as properties of logarithms (in particular, the natural logarithm, or the logarithm to the base e) to transform products into sums and divisions into subtractions.[2][3] The principle can be implemented, at least in part, in the differentiation of almost all differentiable functions, providing that these functions are non-zero.

## Overview

For a function

${\displaystyle y=f(x)\,\!}$

logarithmic differentiation typically begins by taking the natural logarithm, or the logarithm to the base e, on both sides, remembering to take absolute values:[4]

${\displaystyle \ln |y|=\ln |f(x)|.\,\!}$
${\displaystyle {\frac {1}{y}}{\frac {dy}{dx}}={\frac {f'(x)}{f(x)}}.}$

Multiplication by y is then done to eliminate 1/y and leave only dy/dx on the left-hand side:

${\displaystyle {\frac {dy}{dx}}=y\times {\frac {f'(x)}{f(x)}}=f'(x).}$

The method is used because the properties of logarithms provide avenues to quickly simplify complicated functions to be differentiated.[6] These properties can be manipulated after the taking of natural logarithms on both sides and before the preliminary differentiation. The most commonly used logarithm laws are[3]

${\displaystyle \ln(ab)=\ln(a)+\ln(b),\qquad \ln \left({\frac {a}{b}}\right)=\ln(a)-\ln(b),\qquad \ln(a^{n})=n\ln(a).}$

### General case

Using capital pi notation,

${\displaystyle f(x)=\prod _{i}(f_{i}(x))^{\alpha _{i}(x)}.}$

Application of natural logarithms results in (with capital sigma notation)

${\displaystyle \ln(f(x))=\sum _{i}\alpha _{i}(x)\cdot \ln(f_{i}(x)),}$

and after differentiation,

${\displaystyle {\frac {f'(x)}{f(x)}}=\sum _{i}\left[\alpha _{i}'(x)\cdot \ln(f_{i}(x))+\alpha _{i}(x)\cdot {\frac {f_{i}'(x)}{f_{i}(x)}}\right].}$

Rearrange to get the derivative of the original function,

${\displaystyle f'(x)=\overbrace {\prod _{i}(f_{i}(x))^{\alpha _{i}(x)}} ^{f(x)}\times \overbrace {\sum _{i}\left\{\alpha _{i}'(x)\cdot \ln(f_{i}(x))+\alpha _{i}(x)\cdot {\frac {f_{i}'(x)}{f_{i}(x)}}\right\}} ^{[\ln(f(x))]'}.}$

### Higher order derivatives

Using Faà di Bruno's formula, the n-th order logarithmic derivative is,

${\displaystyle {d^{n} \over dx^{n}}\ln f(x)=\sum _{m_{1}+2m_{2}+\cdots +nm_{n}=n}{\frac {n!}{m_{1}!\,m_{2}!\,\cdots \,m_{n}!}}\cdot {\frac {(-1)^{m_{1}+\cdots +m_{n}-1}(m_{1}+\cdots +m_{n}-1)!}{f(x)^{m_{1}+\cdots +m_{n}}}}\cdot \prod _{j=1}^{n}\left({\frac {f^{(j)}(x)}{j!}}\right)^{m_{j}}.}$

Using this, the first four derivatives are,

${\displaystyle {\frac {d^{2}}{dx^{2}}}\ln f(x)={\frac {f''(x)}{f(x)}}-\left({\frac {f'(x)}{f(x)}}\right)^{2}}$
${\displaystyle {\frac {d^{3}}{dx^{3}}}\ln f(x)={\frac {f'''(x)}{f(x)}}-3{\frac {f'(x)f''(x)}{f(x)^{2}}}+2\left({\frac {f'(x)}{f(x)}}\right)^{3}}$
${\displaystyle {\frac {d^{4}}{dx^{4}}}\ln f(x)={\frac {f''''(x)}{f(x)}}-4{\frac {f'(x)f'''(x)}{f(x)^{2}}}-3\left({\frac {f''(x)}{f(x)}}\right)^{2}+12{\frac {f'(x)^{2}f''(x)}{f(x)^{3}}}-6\left({\frac {f'(x)}{f(x)}}\right)^{4}}$

## Applications

### Products

A natural logarithm is applied to a product of two functions

${\displaystyle f(x)=g(x)h(x)\,\!}$

to transform the product into a sum

${\displaystyle \ln(f(x))=\ln(g(x)h(x))=\ln(g(x))+\ln(h(x)).\,\!}$

Differentiating by applying the chain and the sum rules yields

${\displaystyle {\frac {f'(x)}{f(x)}}={\frac {g'(x)}{g(x)}}+{\frac {h'(x)}{h(x)}},}$

and, after rearranging, yields[7]

${\displaystyle f'(x)=f(x)\times {\Bigg \{}{\frac {g'(x)}{g(x)}}+{\frac {h'(x)}{h(x)}}{\Bigg \}}=g(x)h(x)\times {\Bigg \{}{\frac {g'(x)}{g(x)}}+{\frac {h'(x)}{h(x)}}{\Bigg \}}.}$

### Quotients

A natural logarithm is applied to a quotient of two functions

${\displaystyle f(x)={\frac {g(x)}{h(x)}}\,\!}$

to transform the division into a subtraction

${\displaystyle \ln(f(x))=\ln {\Bigg (}{\frac {g(x)}{h(x)}}{\Bigg )}=\ln(g(x))-\ln(h(x))\,\!}$

Differentiating by applying the chain and the sum rules yields

${\displaystyle {\frac {f'(x)}{f(x)}}={\frac {g'(x)}{g(x)}}-{\frac {h'(x)}{h(x)}},}$

and, after rearranging, yields

${\displaystyle f'(x)=f(x)\times {\Bigg \{}{\frac {g'(x)}{g(x)}}-{\frac {h'(x)}{h(x)}}{\Bigg \}}={\frac {g(x)}{h(x)}}\times {\Bigg \{}{\frac {g'(x)}{g(x)}}-{\frac {h'(x)}{h(x)}}{\Bigg \}}.}$

After multiplying out and using the common denominator formula the result is the same as after applying the quotient rule directly to ${\displaystyle f(x)}$.

### Composite exponent

For a function of the form

${\displaystyle f(x)=g(x)^{h(x)}\,\!}$

The natural logarithm transforms the exponentiation into a product

${\displaystyle \ln(f(x))=\ln \left(g(x)^{h(x)}\right)=h(x)\ln(g(x))\,\!}$

Differentiating by applying the chain and the product rules yields

${\displaystyle {\frac {f'(x)}{f(x)}}=h'(x)\ln(g(x))+h(x){\frac {g'(x)}{g(x)}},}$

and, after rearranging, yields

${\displaystyle f'(x)=f(x)\times {\Bigg \{}h'(x)\ln(g(x))+h(x){\frac {g'(x)}{g(x)}}{\Bigg \}}=g(x)^{h(x)}\times {\Bigg \{}h'(x)\ln(g(x))+h(x){\frac {g'(x)}{g(x)}}{\Bigg \}}.}$

The same result can be obtained by rewriting f in terms of exp and applying the chain rule.

## Notes

1. ^ Krantz, Steven G. (2003). Calculus demystified. McGraw-Hill Professional. p. 170. ISBN 0-07-139308-0.
2. ^ N.P. Bali (2005). Golden Differential Calculus. Firewall Media. p. 282. ISBN 81-7008-152-1.
3. ^ a b Bird, John (2006). Higher Engineering Mathematics. Newnes. p. 324. ISBN 0-7506-8152-7.
4. ^ Dowling, Edward T. (1990). Schaum's Outline of Theory and Problems of Calculus for Business, Economics, and the Social Sciences. McGraw-Hill Professional. p. 160. ISBN 0-07-017673-6.
5. ^ Hirst, Keith (2006). Calculus of One Variable. Birkhäuser. p. 97. ISBN 1-85233-940-3.
6. ^ Blank, Brian E. (2006). Calculus, single variable. Springer. p. 457. ISBN 1-931914-59-1.
7. ^ Williamson, Benjamin (2008). An Elementary Treatise on the Differential Calculus. BiblioBazaar, LLC. pp. 25–26. ISBN 0-559-47577-2.