# Differentiation rules

{{#invoke: Sidebar | collapsible }}

This is a summary of differentiation rules, that is, rules for computing the derivative of a function in calculus.

## Elementary rules of differentiation

Unless otherwise stated, all functions are functions of real numbers (R) that return real values; although more generally, the formulae below apply wherever they are well defined[1][2]—including complex numbers (C).[3]

### Differentiation is linear

{{#invoke:main|main}}

For any functions f and g and any real numbers a and b the derivative of the function h(x) = af(x) + bg(x) with respect to x is

${\displaystyle h'(x)=af'(x)+bg'(x).\,}$

In Leibniz's notation this is written as:

${\displaystyle {\frac {d(af+bg)}{dx}}=a{\frac {df}{dx}}+b{\frac {dg}{dx}}.}$

Special cases include:

${\displaystyle (af)'=af'\,}$
${\displaystyle (f+g)'=f'+g'\,}$
• The subtraction rule
${\displaystyle (f-g)'=f'-g'.\,}$

### The product rule

{{#invoke:main|main}}

For the functions f and g, the derivative of the function h(x) = f(x) g(x) with respect to x is

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

In Leibniz's notation this is written

${\displaystyle {\frac {d(fg)}{dx}}={\frac {df}{dx}}g+f{\frac {dg}{dx}}.}$

### The chain rule

{{#invoke:main|main}}

The derivative of the function of a function h(x) = f(g(x)) with respect to x is

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

In Leibniz's notation this is written as:

${\displaystyle {\frac {dh}{dx}}={\frac {df(g(x))}{dg(x)}}{\frac {dg(x)}{dx}}.\,}$

However, by relaxing the interpretation of h as a function, this is often simply written

${\displaystyle {\frac {dh}{dx}}={\frac {dh}{dg}}{\frac {dg}{dx}}.\,}$

### The inverse function rule

{{#invoke:main|main}}

If the function f has an inverse function g, meaning that g(f(x)) = x and f(g(y)) = y, then

${\displaystyle g'={\frac {1}{f'\circ g}}.}$

In Leibniz notation, this is written as

${\displaystyle {\frac {dx}{dy}}={\frac {1}{dy/dx}}.}$

## Power laws, polynomials, quotients, and reciprocals

### The polynomial or elementary power rule

{{#invoke:main|main}}

${\displaystyle f'(x)=nx^{n-1}.\,}$

Special cases include:

• Constant rule: if f is the constant function f(x) = c, for any number c, then for all x, f′(x) = 0.
• if f(x) = x, then f′(x) = 1. This special case may be generalized to:
The derivative of an affine function is constant: if f(x) = ax + b, then f′(x) = a.

Combining this rule with the linearity of the derivative and the addition rule permits the computation of the derivative of any polynomial.

### The reciprocal rule

{{#invoke:main|main}} The derivative of h(x) = 1/f(x) for any (nonvanishing) function f is:

${\displaystyle h'(x)=-{\frac {f'(x)}{(f(x))^{2}}}.\ }$

In Leibniz's notation, this is written

${\displaystyle {\frac {d(1/f)}{dx}}=-{\frac {1}{f^{2}}}{\frac {df}{dx}}.\,}$

The reciprocal rule can be derived from the chain rule and the power rule.

### The quotient rule

{{#invoke:main|main}}

If f and g are functions, then:

${\displaystyle \left({\frac {f}{g}}\right)'={\frac {f'g-g'f}{g^{2}}}\quad }$ wherever g is nonzero.

This can be derived from reciprocal rule and the product rule. Conversely (using the constant rule) the reciprocal rule may be derived from the special case f(x) = 1.

### Generalized power rule

{{#invoke:main|main}}

The elementary power rule generalizes considerably. The most general power rule is the functional power rule: for any functions f and g,

${\displaystyle (f^{g})'=\left(e^{g\ln f}\right)'=f^{g}\left(f'{g \over f}+g'\ln f\right),\quad }$

wherever both sides are well defined.

Special cases:

• If f(x) = xa, f′(x) = axa − 1 when a is any real number and x is positive.
• The reciprocal rule may be derived as the special case where g(x) = −1.

## Derivatives of exponential and logarithmic functions

${\displaystyle {\frac {d}{dx}}\left(c^{ax}\right)={c^{ax}\ln c\cdot a},\qquad c>0}$

note that the equation above is true for all c, but the derivative for c < 0 yields a complex number.

${\displaystyle {\frac {d}{dx}}\left(e^{x}\right)=e^{x}}$
${\displaystyle {\frac {d}{dx}}\left(\log _{c}x\right)={1 \over x\ln c},\qquad c>0,c\neq 1}$

the equation above is also true for all c but yields a complex number if c<0.

${\displaystyle {\frac {d}{dx}}\left(\ln x\right)={1 \over x},\qquad x>0}$
${\displaystyle {\frac {d}{dx}}\left(\ln |x|\right)={1 \over x}}$
${\displaystyle {\frac {d}{dx}}\left(x^{x}\right)=x^{x}(1+\ln x).}$

### Logarithmic derivatives

The logarithmic derivative is another way of stating the rule for differentiating the logarithm of a function (using the chain rule):

${\displaystyle (\ln f)'={\frac {f'}{f}}\quad }$ wherever f is positive.

## Derivatives of trigonometric functions

{{#invoke:main|main}}

It is common to additionally define an inverse tangent function with two arguments, ${\displaystyle \arctan(y,x)}$. Its value lies in the range ${\displaystyle [-\pi ,\pi ]}$ and reflects the quadrant of the point ${\displaystyle (x,y)}$. For the first and fourth quadrant (i.e. ${\displaystyle x>0}$) one has ${\displaystyle \arctan(y,x>0)=\arctan(y/x)}$. Its partial derivatives are

## Derivatives of integrals

{{#invoke:main|main}}

Suppose that it is required to differentiate with respect to x the function

${\displaystyle F(x)=\int _{a(x)}^{b(x)}f(x,t)\,dt,}$
${\displaystyle F'(x)=f(x,b(x))\,b'(x)-f(x,a(x))\,a'(x)+\int _{a(x)}^{b(x)}{\frac {\partial }{\partial x}}\,f(x,t)\;dt\,.}$

This formula is the general form of the Leibniz integral rule and can be derived using the fundamental theorem of calculus.

## Derivatives to nth order

Some rules exist for computing the nth derivative of functions, where n is a positive integer. These include:

### Faà di Bruno's formula

{{#invoke:main|main}} If f and g are n times differentiable, then

${\displaystyle {\frac {d^{n}}{dx^{n}}}[f(g(x))]=n!\sum _{\{k_{m}\}}^{}f^{(r)}(g(x))\prod _{m=1}^{n}{\frac {1}{k_{m}!}}\left(g^{(m)}(x)\right)^{k_{m}}}$

where ${\displaystyle r=\sum _{m=1}^{n-1}k_{m}}$ and the set ${\displaystyle \{k_{m}\}}$ consists of all non-negative integer solutions of the Diophantine equation ${\displaystyle \sum _{m=1}^{n}mk_{m}=n}$.

### General Leibniz rule

{{#invoke:main|main}} If f and g are n times differentiable, then

${\displaystyle {\frac {d^{n}}{dx^{n}}}[f(x)g(x)]=\sum _{k=0}^{n}{\binom {n}{k}}{\frac {d^{n-k}}{dx^{n-k}}}f(x){\frac {d^{k}}{dx^{k}}}g(x)}$

## References

1. Calculus (5th edition), F. Ayres, E. Mendelson, Schuam's Outline Series, 2009, ISBN 978-0-07-150861-2.
2. Advanced Calculus (3rd edition), R. Wrede, M.R. Spiegel, Schuam's Outline Series, 2010, ISBN 978-0-07-162366-7.
3. Complex Variables, M.R. Speigel, S. Lipschutz, J.J. Schiller, D. Spellman, Schaum's Outlines Series, McGraw Hill (USA), 2009, ISBN 978-0-07-161569-3