VectorLab

Visualize vectors, solve algebra & calculus step by step, with guides

← Back to Calculus

Differentiation Rules

The derivative measures how fast a function changes: the slope of its graph at each point. Seven rules cover most functions you will meet.

Which rule?

Look at the outermost structure of the function.

  • A sum or difference: differentiate term by term.
  • A product of two functions of x: product rule. A ratio: quotient rule.
  • A function inside a function: chain rule.
  • Otherwise match a basic form: power, trigonometric, exponential or logarithmic.

Power rule

Use it when the variable is raised to a constant power. Roots and reciprocals count too: rewrite \sqrt{x} as x^{1/2} and \tfrac{1}{x^3} as x^{-3}. Bring the exponent down, then lower it by one.

\frac{d}{dx}x^n=n\,x^{n-1}

Example. Differentiate x^3+2x.

Do each term: \tfrac{d}{dx}x^3=3x^2 and \tfrac{d}{dx}2x=2. The derivative is 3x^2+2.

Watch out: the power rule is for x^n (variable in the base). For 2^x the variable is in the exponent: see exponential functions.

Try it in the calculator

Product rule

Use it when two functions of x are multiplied and neither is just a constant. Take the derivative of one factor at a time and keep the other.

(uv)'=u'v+uv'

Example. Differentiate x\sin x.

Let u=x and v=\sin x, so u'=1 and v'=\cos x. Then u'v+uv'=\sin x+x\cos x.

Watch out: the derivative of a product is not the product of the derivatives.

Try it in the calculator

Quotient rule

Use it when one function is divided by another. Remember the order: bottom times derivative of top, minus top times derivative of bottom, all over bottom squared.

\left(\frac{u}{v}\right)'=\frac{u'v-uv'}{v^2}

Example. Differentiate \dfrac{x^2+1}{x-1}.

With u=x^2+1 and v=x-1: u'=2x, v'=1. So \dfrac{2x(x-1)-(x^2+1)\cdot1}{(x-1)^2}=\dfrac{x^2-2x-1}{(x-1)^2}.

Watch out: the subtraction is not symmetric. Swapping the two products flips the sign of the answer.

Try it in the calculator

Chain rule

Use it when one function sits inside another, such as \sin(x^2), (3x+1)^5 or e^{2x}. Differentiate the outer function, leave the inside alone, then multiply by the derivative of the inside.

\frac{d}{dx}f(g(x))=f'(g(x))\cdot g'(x)

Example. Differentiate \sin(x^2).

  1. Outer: \sin u, inner: u=x^2.
  2. Outer derivative: \cos u. Inner derivative: 2x.
  3. Multiply: 2x\cos(x^2).

Watch out: forgetting the inner derivative is the most common slip.

Try it in the calculator

Trigonometric functions

Use it when sine, cosine or tangent appears. Learn three results; the rest follow from the product, quotient and chain rules. Angles are in radians.

\frac{d}{dx}\sin x=\cos x\qquad\frac{d}{dx}\cos x=-\sin x\qquad\frac{d}{dx}\tan x=\sec^2x

Example. Differentiate \sin x+\cos x.

Term by term: \cos x+(-\sin x). The derivative is \cos x-\sin x.

Watch out: cosine differentiates to minus sine. If the angle is not plain x, as in \sin 3x, add the chain rule: 3\cos 3x.

Try it in the calculator

Exponential functions

Use it when the variable is in the exponent. The function e^x is special because it is its own derivative. For another base a, a factor \ln a appears.

\frac{d}{dx}e^{x}=e^{x}\qquad\frac{d}{dx}a^{x}=a^{x}\ln a

Example. Differentiate e^{3x}.

The inside 3x has derivative 3, so the chain rule gives 3e^{3x}.

Watch out: do not use the power rule here. x^2 and 2^x are different kinds of function.

Try it in the calculator

Logarithmic functions

Use it when the function contains a natural logarithm. In the calculator, ln and log both mean the natural logarithm. With something inside, the chain rule puts that inside on top: the derivative of the inside over the inside.

\frac{d}{dx}\ln x=\frac{1}{x}\qquad\frac{d}{dx}\ln g(x)=\frac{g'(x)}{g(x)}

Example. Differentiate \ln(x^2+1).

The inside is x^2+1 with derivative 2x, so the answer is \dfrac{2x}{x^2+1}.

Watch out: simplify first when you can: \ln(x^3)=3\ln x, which differentiates to \tfrac{3}{x}.

Try it in the calculator

Where derivatives are used

Derivatives give velocity from position, find the highest and lowest points of a curve, and measure how sensitive one quantity is to another. The last step of any derivative is to check that you used the rules in the right order.

Open the interactive tools →