Skip to main content

Differentiation Rules

Differentiation rules turn the derivative from a limit that must be recomputed every time into a practical calculus tool. The rules are shortcuts, but they are not arbitrary tricks. Each one follows from the limit definition and the algebra of functions.

The main task is to recognize structure. A complicated expression may be a sum, product, quotient, or composition of simpler functions. Once that structure is clear, the derivative is found by applying the appropriate rule in the correct order, while keeping domain restrictions and units in mind.

Definitions

The derivative of ff is

f(x)=limh0f(x+h)f(x)h,f'(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h},

when the limit exists. Differentiation rules tell how to compute this limit for functions assembled from simpler pieces.

Basic rules:

ddxc=0,ddxxn=nxn1,ddx[cf(x)]=cf(x),ddx[f(x)+g(x)]=f(x)+g(x).\begin{aligned} \frac{d}{dx}c &= 0,\\ \frac{d}{dx}x^n &= nx^{n-1},\\ \frac{d}{dx}[cf(x)] &= cf'(x),\\ \frac{d}{dx}[f(x)+g(x)] &= f'(x)+g'(x). \end{aligned}

The product rule is

ddx[f(x)g(x)]=f(x)g(x)+f(x)g(x).\frac{d}{dx}[f(x)g(x)]=f'(x)g(x)+f(x)g'(x).

The quotient rule is

ddx[f(x)g(x)]=g(x)f(x)f(x)g(x)[g(x)]2,g(x)0.\frac{d}{dx}\left[\frac{f(x)}{g(x)}\right] =\frac{g(x)f'(x)-f(x)g'(x)}{[g(x)]^2}, \qquad g(x)\ne 0.

The chain rule is

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

It says to differentiate the outside function while leaving the inside function in place, then multiply by the derivative of the inside function.

Common elementary derivatives include:

ddxax=axlna(a>0, a1),ddxlogax=1xlna(x>0),ddxsecx=secxtanx,ddxcscx=cscxcotx,ddxcotx=csc2x.\begin{aligned} \frac{d}{dx}a^x &= a^x\ln a && (a>0,\ a\ne 1),\\ \frac{d}{dx}\log_a x &= \frac{1}{x\ln a} && (x>0),\\ \frac{d}{dx}\sec x &= \sec x\tan x,\\ \frac{d}{dx}\csc x &= -\csc x\cot x,\\ \frac{d}{dx}\cot x &= -\csc^2 x. \end{aligned}

Inverse trigonometric derivatives also appear frequently:

ddxarcsinx=11x2,ddxarctanx=11+x2,ddxarcsecx=1xx21.\begin{aligned} \frac{d}{dx}\arcsin x &= \frac{1}{\sqrt{1-x^2}},\\ \frac{d}{dx}\arctan x &= \frac{1}{1+x^2},\\ \frac{d}{dx}\operatorname{arcsec} x &= \frac{1}{|x|\sqrt{x^2-1}}. \end{aligned}

These formulas are valid on their natural domains. The absolute value in the derivative of arcsecx\operatorname{arcsec} x is a reminder that inverse-function derivatives often carry domain choices.

Key results

The power rule for positive integers follows from expanding (x+h)n(x+h)^n:

(x+h)n=xn+nxn1h+terms containing h2.(x+h)^n=x^n+nx^{n-1}h+\text{terms containing }h^2.

Then

(x+h)nxnh=nxn1+terms containing h,\frac{(x+h)^n-x^n}{h}=nx^{n-1}+\text{terms containing }h,

so the limit as h0h\to 0 is nxn1nx^{n-1}. The rule extends to many real exponents on their domains, with special care around roots and negative powers.

The product rule can be derived by adding and subtracting f(x+h)g(x)f(x+h)g(x):

f(x+h)g(x+h)f(x)g(x)h=f(x+h)g(x+h)f(x+h)g(x)h+f(x+h)g(x)f(x)g(x)h=f(x+h)g(x+h)g(x)h+g(x)f(x+h)f(x)h.\begin{aligned} &\frac{f(x+h)g(x+h)-f(x)g(x)}{h}\\ &=\frac{f(x+h)g(x+h)-f(x+h)g(x)}{h} +\frac{f(x+h)g(x)-f(x)g(x)}{h}\\ &=f(x+h)\frac{g(x+h)-g(x)}{h} +g(x)\frac{f(x+h)-f(x)}{h}. \end{aligned}

Taking the limit gives f(x)g(x)+g(x)f(x)f(x)g'(x)+g(x)f'(x). This proof also explains why the derivative of a product is not simply fgf'g'.

The quotient rule can be obtained by writing f/g=fg1f/g=f\cdot g^{-1} and using the product and chain rules. The denominator [g(x)]2[g(x)]^2 appears because differentiating g1g^{-1} gives g2g-g^{-2}g'.

Trigonometric derivatives used throughout calculus include

ddxsinx=cosx,ddxcosx=sinx,ddxtanx=sec2x.\begin{aligned} \frac{d}{dx}\sin x &= \cos x,\\ \frac{d}{dx}\cos x &= -\sin x,\\ \frac{d}{dx}\tan x &= \sec^2 x. \end{aligned}

Exponential and logarithmic derivatives are

ddxex=ex,ddxlnx=1x(x>0).\frac{d}{dx}e^x=e^x, \qquad \frac{d}{dx}\ln x=\frac1x\quad (x>0).

The chain rule is the most important rule because every nontrivial formula is built from nested operations. If y=sin(x2)y=\sin(x^2), the outside function is sine and the inside function is x2x^2, so

dydx=cos(x2)2x.\frac{dy}{dx}=\cos(x^2)\cdot 2x.

If y=(3x1)10y=(3x-1)^{10}, the outside function is the tenth power and the inside function is 3x13x-1, so

dydx=10(3x1)93.\frac{dy}{dx}=10(3x-1)^9\cdot 3.

Logarithmic differentiation is a strategy, not a new rule. It is helpful when a product, quotient, or variable exponent would be messy to differentiate directly. Taking natural logs converts products to sums and powers to factors. For example, if y=xxy=x^x for x>0x\gt 0, then

lny=xlnx.\ln y=x\ln x.

Differentiating implicitly gives

yy=lnx+1,\frac{y'}{y}=\ln x+1,

so

y=xx(lnx+1).y'=x^x(\ln x+1).

The rule set should be used with simplification in mind. Sometimes it is easier to simplify before differentiating; for example, (x21)/(x1)=x+1(x^2-1)/(x-1)=x+1 for x1x\ne 1. Sometimes simplifying first creates algebraic work or hides a domain restriction. The safest habit is to record the original domain, simplify where valid, and then state the derivative on that same domain.

A chain-rule proof sketch uses a small change in the inside variable. Let y=f(u)y=f(u) and u=g(x)u=g(x). For a change Δx\Delta x, the inside changes by Δu=g(x+Δx)g(x)\Delta u=g(x+\Delta x)-g(x). When Δu0\Delta u\ne 0,

ΔyΔx=ΔyΔuΔuΔx.\frac{\Delta y}{\Delta x} =\frac{\Delta y}{\Delta u}\cdot\frac{\Delta u}{\Delta x}.

As Δx0\Delta x\to 0, differentiability of gg gives Δu0\Delta u\to 0, and differentiability of ff gives Δy/Δuf(u)\Delta y/\Delta u\to f'(u). The limit becomes

dydx=dydududx.\frac{dy}{dx}=\frac{dy}{du}\frac{du}{dx}.

This proof also explains the notation: the formal derivative is not simple fraction cancellation, but the notation records a true limiting relationship.

Higher derivatives are computed by applying the same rules repeatedly. If f(x)f'(x) gives slope, then f(x)f''(x) gives the rate of change of slope. In applications, s(t)s'(t) is velocity and s(t)s''(t) is acceleration. In graphing, ff'' helps determine concavity and inflection points. The same derivative rules therefore support both computation and interpretation.

A good workflow is to identify the outermost operation first. If the top-level operation is addition, differentiate term by term. If it is multiplication, use the product rule before simplifying. If it is a power of a nontrivial expression, use the chain rule. If several rules are needed, write intermediate labels such as uu and vv; this reduces sign errors and makes the final expression easier to audit.

Domain awareness remains part of differentiation. The formula for a derivative is only meaningful where the original function is defined and where the derivative limit exists. For instance, f(x)=x1/3f(x)=x^{1/3} is defined at 00, but its tangent is vertical there, so the derivative is not finite at 00. Similarly, f(x)=xf(x)=\vert x\vert is defined and continuous at 00, but the left and right derivative limits disagree. Rules speed up computation, but they do not erase the need to check exceptional points.

When answers will be used for graphing or optimization, leave factors visible when possible. A derivative such as 2x(x3)22x(x-3)^2 immediately shows sign and zero information, while its expanded form hides that structure and makes later interval testing slower.

Clean form is part of correctness because it supports the next mathematical decision clearly afterward.

Visual

RulePatternDerivativeCommon cue
Constant multiplecfcfcfcf'Number times a function
Sumf+gf+gf+gf'+g'Terms separated by plus or minus
Productfgfgfg+fgf'g+fg'Two variable factors multiplied
Quotientf/gf/g(gffg)/g2(gf'-fg')/g^2Variable expression in denominator
Chainf(g(x))f(g(x))f(g(x))g(x)f'(g(x))g'(x)Function nested inside function

Worked example 1: product and chain rules together

Problem. Differentiate

y=(x2+1)5sinx.y=(x^2+1)^5\sin x.

Method.

  1. Identify a product:
u=(x2+1)5,v=sinx.u=(x^2+1)^5,\qquad v=\sin x.
  1. Differentiate uu using the chain rule. The outside function is w5w^5 and the inside is w=x2+1w=x^2+1:
u=5(x2+1)4(2x)=10x(x2+1)4.u'=5(x^2+1)^4(2x)=10x(x^2+1)^4.
  1. Differentiate vv:
v=cosx.v'=\cos x.
  1. Apply the product rule:
y=uv+uv.y'=u'v+uv'.
  1. Substitute:
y=10x(x2+1)4sinx+(x2+1)5cosx.y'=10x(x^2+1)^4\sin x+(x^2+1)^5\cos x.

Checked answer. A factored equivalent form is

y=(x2+1)4(10xsinx+(x2+1)cosx).y'=(x^2+1)^4\left(10x\sin x+(x^2+1)\cos x\right).

Both forms are correct.

Worked example 2: quotient rule with simplification

Problem. Differentiate

f(x)=x2+3xx1f(x)=\frac{x^2+3x}{x-1}

for x1x\ne 1.

Method.

  1. Identify numerator and denominator:
u=x2+3x,v=x1.u=x^2+3x,\qquad v=x-1.
  1. Differentiate them:
u=2x+3,v=1.u'=2x+3,\qquad v'=1.
  1. Apply the quotient rule:
f(x)=vuuvv2.f'(x)=\frac{v u'-u v'}{v^2}.
  1. Substitute:
f(x)=(x1)(2x+3)(x2+3x)(1)(x1)2.f'(x)=\frac{(x-1)(2x+3)-(x^2+3x)(1)}{(x-1)^2}.
  1. Expand the numerator:
(x1)(2x+3)=2x2+x3.(x-1)(2x+3)=2x^2+x-3.
  1. Subtract:
2x2+x3(x2+3x)=x22x3.2x^2+x-3-(x^2+3x)=x^2-2x-3.

Checked answer.

f(x)=x22x3(x1)2.f'(x)=\frac{x^2-2x-3}{(x-1)^2}.

The derivative is valid only where the original function is defined, so x1x\ne 1.

As a check, rewrite the numerator by polynomial division:

x2+3xx1=x+4+4x1.\frac{x^2+3x}{x-1}=x+4+\frac{4}{x-1}.

Differentiating this equivalent form gives

14(x1)2=(x1)24(x1)2=x22x3(x1)2,1-\frac{4}{(x-1)^2} =\frac{(x-1)^2-4}{(x-1)^2} =\frac{x^2-2x-3}{(x-1)^2},

which matches the quotient-rule result.

Code

def central_difference(f, x, h=1e-6):
return (f(x + h) - f(x - h)) / (2 * h)

def f(x):
return (x**2 + 3*x) / (x - 1)

def f_prime_formula(x):
return (x**2 - 2*x - 3) / ((x - 1)**2)

for x in [2, 3, 5]:
print(x, central_difference(f, x), f_prime_formula(x))

Common pitfalls

  • Applying the power rule to a sum, such as treating (x2+1)5(x^2+1)^5 as 5x45x^4. Use the chain rule.
  • Forgetting the second term in the product rule. The derivative of fgfg is not fgf'g'.
  • Reversing signs in the quotient rule. Keep the order as denominator times derivative of numerator minus numerator times derivative of denominator.
  • Dropping the inner derivative in the chain rule.
  • Simplifying the original function across a restricted point and then forgetting the original domain.
  • Mixing radians and degrees. The standard trigonometric derivatives assume radian measure.
  • Applying a formula outside its domain. For example, lnx\ln x requires x>0x\gt 0, and x\sqrt{x} has a one-sided derivative issue at 00.
  • Expanding everything automatically. Factored derivatives often reveal zeros and signs more clearly in applications.
  • Confusing ddx(sin2x)\frac{d}{dx}(\sin^2 x) with ddx(sinx2)\frac{d}{dx}(\sin x^2). The first is (sinx)2(\sin x)^2; the second is sin(x2)\sin(x^2).

Connections