# Differentiation rules

The first principle of calculus is tedious and it gives you plenty of opportunities to make mistakes. Fortunately, there are some shortcuts.

## Constant rule

This is really just a special case of the product rule, but you will use it so often that it’s easier to think of it separately. If $k$ is a constant, then

$ddx(k⋅f(x))=k⋅ddxf(x).$

## Sum & difference rules

The derivative of the sum is equal to the sum of the derivatives. The same goes for subtraction. This means that

$\left(f±g{\right)}^{\prime }={f}^{\prime }±{g}^{\prime }\text{.}$

or, using Leibniz’s notation,

$ddx(u±v)=dudx±dvdx.$

## Power rule

Polynomials are very easy to differentiate thanks to the power rule.

$ddx(xn)=nxn−1.$

For example, the derivative of ${x}^{100}$ with respect to $x$ is $100{x}^{99}\text{.}$

## Product rule

The derivative of the product is not the product of the derivatives. Rather,

$\left(fg{\right)}^{\prime }={f}^{\prime }g+f{g}^{\prime }\text{,}$

or, using Leibniz’s notation,

$ddx(uv)=dudx⋅v+dvdx⋅u.$

## Quotient rule

We can use the product and power rules together to tackle rationals, but using the quotient rule is much easier:

$(fg)′=f′g−fg′g2,$

or, using Leibniz’s notation,

$ddx(uv)=v−2(dudx⋅v−dvdx⋅u).$

## Chain rule

To differentiate composite functions, we need to use the chain rule:

$\left(f\circ g{\right)}^{\prime }=\left({f}^{\prime }\circ g\right)\cdot {g}^{\prime }\text{,}$

or, using Leibniz’s notation,

$dydx=dydu⋅dudx.$