Skip to content

Product, quotient and chain rules

The product, quotient and chain rules let us differentiate functions built by multiplying, dividing or composing simpler functions. The difficult part is often not the algebra. It is recognising the structure of the function and choosing the correct rule.

You should be able to:

  • differentiate powers, exponentials, logarithms and trigonometric functions;
  • use function notation such as f(x)f(x) and f(x)f'(x);
  • simplify algebraic fractions and expressions with indices.

Review differentiating standard functions before continuing if any standard derivative is uncertain.

Look at the main operation holding the function together.

StructureExampleRule
Two variable expressions multipliedx2exx^2e^xProduct rule
One variable expression divided by anothersinxx\dfrac{\sin x}{x}Quotient rule
One function placed inside another(3x1)5(3x-1)^5Chain rule

A function may contain more than one structure. For example,

y=x2sin(3x)y=x^2\sin(3x)

has a product on the outside and a composite function, sin(3x)\sin(3x), inside it. We need the product rule and the chain rule.

Before selecting a rule, simplify if doing so removes unnecessary work. For example,

x3+2xx=x2+2,x0,\frac{x^3+2x}{x}=x^2+2, \qquad x\ne 0,

so its derivative is simply 2x2x on its domain. The quotient rule would work, but it is needlessly long.

If

y=u(x)v(x),y=u(x)v(x),

then

dydx=udvdx+vdudx.\boxed{\frac{dy}{dx}=u\frac{dv}{dx}+v\frac{du}{dx}}.

Equivalently,

(uv)=uv+uv.\boxed{(uv)'=u'v+uv'}.

Differentiate each factor in turn while leaving the other unchanged. Both terms are essential.

Example 1: polynomial multiplied by an exponential

Section titled “Example 1: polynomial multiplied by an exponential”

Differentiate

y=x2ex.y=x^2e^x.

Choose

u=x2,v=ex.u=x^2, \qquad v=e^x.

Then

dudx=2x,dvdx=ex.\frac{du}{dx}=2x, \qquad \frac{dv}{dx}=e^x.

Apply the product rule:

dydx=udvdx+vdudx=x2ex+ex(2x)=ex(x2+2x)=xex(x+2).\begin{aligned} \frac{dy}{dx} &=u\frac{dv}{dx}+v\frac{du}{dx}\\ &=x^2e^x+e^x(2x)\\ &=e^x(x^2+2x)\\ &=xe^x(x+2). \end{aligned}

The first line after substitution is already a correct derivative. Factoring is useful if the result will later be set equal to zero.

Example 2: polynomial multiplied by a trigonometric function

Section titled “Example 2: polynomial multiplied by a trigonometric function”

Differentiate

y=(2x1)cosx.y=(2x-1)\cos x.

Let u=2x1u=2x-1 and v=cosxv=\cos x. Therefore u=2u'=2 and v=sinxv'=-\sin x.

dydx=(2x1)(sinx)+(cosx)(2)=2cosx(2x1)sinx.\begin{aligned} \frac{dy}{dx} &=(2x-1)(-\sin x)+(\cos x)(2)\\ &=2\cos x-(2x-1)\sin x. \end{aligned}

The negative derivative of cosx\cos x is a frequent source of sign errors.

For y=uvwy=uvw, apply the product rule repeatedly:

(uvw)=uvw+uvw+uvw.\boxed{(uvw)'=u'vw+uv'w+uvw'}.

For example, if

y=x2exsinx,y=x^2e^x\sin x,

then

dydx=2xexsinx+x2exsinx+x2excosx.\frac{dy}{dx}=2xe^x\sin x+x^2e^x\sin x+x^2e^x\cos x.

Each term differentiates exactly one factor and leaves the other two unchanged.

If

y=u(x)v(x),v(x)0,y=\frac{u(x)}{v(x)}, \qquad v(x)\ne 0,

then

dydx=vdudxudvdxv2.\boxed{\frac{dy}{dx}=\frac{v\dfrac{du}{dx}-u\dfrac{dv}{dx}}{v^2}}.

A useful memory pattern is:

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

The order in the numerator matters. It is denominator times derivative of numerator, minus numerator times derivative of denominator.

Differentiate

y=x2+1x2.y=\frac{x^2+1}{x-2}.

Set

u=x2+1,v=x2,u=x^2+1, \qquad v=x-2,

so u=2xu'=2x and v=1v'=1. Then

dydx=(x2)(2x)(x2+1)(1)(x2)2=2x24xx21(x2)2=x24x1(x2)2.\begin{aligned} \frac{dy}{dx} &=\frac{(x-2)(2x)-(x^2+1)(1)}{(x-2)^2}\\ &=\frac{2x^2-4x-x^2-1}{(x-2)^2}\\ &=\frac{x^2-4x-1}{(x-2)^2}. \end{aligned}

The derivative is defined only where the original function is defined, so x2x\ne 2.

Differentiate

y=sinxx2.y=\frac{\sin x}{x^2}.

Take u=sinxu=\sin x and v=x2v=x^2. Then u=cosxu'=\cos x and v=2xv'=2x.

dydx=x2cosx(sinx)(2x)x4=xcosx2sinxx3.\begin{aligned} \frac{dy}{dx} &=\frac{x^2\cos x-(\sin x)(2x)}{x^4}\\ &=\frac{x\cos x-2\sin x}{x^3}. \end{aligned}

An alternative is to write y=x2sinxy=x^{-2}\sin x and use the product rule. Both methods give the same result.

A composite function has one function inside another. If

y=f(g(x)),y=f(g(x)),

then

dydx=f(g(x))g(x).\boxed{\frac{dy}{dx}=f'(g(x))g'(x)}.

In words, differentiate the outside function while keeping the inside unchanged, then multiply by the derivative of the inside.

Using an intermediate variable makes the logic visible. If u=g(x)u=g(x) and y=f(u)y=f(u), then

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

This notation behaves like cancellation, but the chain rule is the mathematical justification.

Differentiate

y=(3x4)7.y=(3x-4)^7.

The outside function is seventh power and the inside function is 3x43x-4.

dydx=7(3x4)6×3=21(3x4)6.\begin{aligned} \frac{dy}{dx} &=7(3x-4)^6\times 3\\ &=21(3x-4)^6. \end{aligned}

The factor 33 is the derivative of the inside. Omitting it is the most common chain rule error.

Differentiate

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

Keep x2+1x^2+1 unchanged while differentiating the outside sine:

dydx=cos(x2+1)×2x=2xcos(x2+1).\frac{dy}{dx}=\cos(x^2+1)\times 2x =2x\cos(x^2+1).

If

y=e5x23x,y=e^{5x^2-3x},

then

dydx=e5x23x(10x3).\frac{dy}{dx}=e^{5x^2-3x}(10x-3).

The exponential is unchanged because the derivative of eue^u with respect to uu is eue^u.

Differentiate

y=ln(2x3+5).y=\ln(2x^3+5).

Since d(lnu)/du=1/ud(\ln u)/du=1/u,

dydx=12x3+5×6x2=6x22x3+5.\frac{dy}{dx}=\frac{1}{2x^3+5}\times 6x^2 =\frac{6x^2}{2x^3+5}.

For real values, the original logarithm also requires 2x3+5>02x^3+5>0.

Differentiate

y=(1+sin(2x))4.y=\left(1+\sin(2x)\right)^4.

Work from the outside inward:

dydx=4(1+sin(2x))3×ddx(1+sin(2x))=4(1+sin(2x))3×cos(2x)×2=8cos(2x)(1+sin(2x))3.\begin{aligned} \frac{dy}{dx} &=4\left(1+\sin(2x)\right)^3 \times \frac{d}{dx}\left(1+\sin(2x)\right)\\ &=4\left(1+\sin(2x)\right)^3 \times \cos(2x)\times 2\\ &=8\cos(2x)\left(1+\sin(2x)\right)^3. \end{aligned}

There are two inside derivatives: first sin(2x)\sin(2x), then 2x2x.

Identify the outermost structure first. That choice determines the first line of the derivative.

Example 11: product rule with a chain rule

Section titled “Example 11: product rule with a chain rule”

Differentiate

y=x3cos(2x).y=x^3\cos(2x).

The outermost structure is a product. Let u=x3u=x^3 and v=cos(2x)v=\cos(2x).

u=3x2,v=2sin(2x).u'=3x^2, \qquad v'=-2\sin(2x).

Therefore

dydx=3x2cos(2x)+x3(2sin(2x))=3x2cos(2x)2x3sin(2x).\begin{aligned} \frac{dy}{dx} &=3x^2\cos(2x)+x^3\left(-2\sin(2x)\right)\\ &=3x^2\cos(2x)-2x^3\sin(2x). \end{aligned}

Example 12: quotient rule with chain rules

Section titled “Example 12: quotient rule with chain rules”

Differentiate

y=e2x(x+1)3.y=\frac{e^{2x}}{(x+1)^3}.

Use u=e2xu=e^{2x} and v=(x+1)3v=(x+1)^3. Then

u=2e2x,v=3(x+1)2.u'=2e^{2x}, \qquad v'=3(x+1)^2.

Hence

dydx=(x+1)3(2e2x)e2x(3(x+1)2)(x+1)6=e2x(x+1)2(2(x+1)3)(x+1)6=e2x(2x1)(x+1)4,x1.\begin{aligned} \frac{dy}{dx} &=\frac{(x+1)^3(2e^{2x})-e^{2x}\left(3(x+1)^2\right)}{(x+1)^6}\\ &=\frac{e^{2x}(x+1)^2\left(2(x+1)-3\right)}{(x+1)^6}\\ &=\frac{e^{2x}(2x-1)}{(x+1)^4}, \qquad x\ne -1. \end{aligned}

Rewriting as e2x(x+1)3e^{2x}(x+1)^{-3} and using the product rule is equally valid and often shorter.

Differentiate

y=(x1x+1)5.y=\left(\frac{x-1}{x+1}\right)^5.

The outermost structure is fifth power. Let

u=x1x+1.u=\frac{x-1}{x+1}.

First apply the chain rule:

dydx=5u4dudx.\frac{dy}{dx}=5u^4\frac{du}{dx}.

Now use the quotient rule on uu:

dudx=(x+1)(1)(x1)(1)(x+1)2=2(x+1)2.\frac{du}{dx} =\frac{(x+1)(1)-(x-1)(1)}{(x+1)^2} =\frac{2}{(x+1)^2}.

Therefore

dydx=10(x1x+1)41(x+1)2=10(x1)4(x+1)6.\frac{dy}{dx} =10\left(\frac{x-1}{x+1}\right)^4\frac{1}{(x+1)^2} =\frac{10(x-1)^4}{(x+1)^6}.

This example shows why the outermost structure matters. Starting with the quotient rule would treat the whole numerator and denominator as fifth powers and create much more algebra.

Several forms can represent the same function, so more than one method may be correct.

  • Expand (x+1)(x22x)(x+1)(x^2-2x) before differentiating if expansion is quick.
  • Rewrite 1/(x2+1)1/(x^2+1) as (x2+1)1(x^2+1)^{-1} to use the chain rule.
  • Rewrite ex/x2e^x/x^2 as exx2e^xx^{-2} if the product rule looks cleaner.
  • Keep factors unexpanded when a later question asks for stationary points.

You can check a derivative by:

  1. checking that every composite function contributed its inside derivative;
  2. checking quotient signs and the squared denominator;
  3. estimating the gradient numerically at one convenient value;
  4. differentiating an algebraically equivalent form by another method.

For instance,

y=13x+2=(3x+2)1y=\frac{1}{3x+2}=(3x+2)^{-1}

gives

y=(3x+2)2×3=3(3x+2)2.y'=-(3x+2)^{-2}\times 3=-\frac{3}{(3x+2)^2}.

The negative sign also makes sense because 1/(3x+2)1/(3x+2) decreases on each interval of its domain.

It is false that

(uv)=uv.(uv)'=u'v'.

For example, xx=x2x\cdot x=x^2 has derivative 2x2x, while 11=11\cdot1=1. Use uv+uvu'v+uv'.

It is false that

(uv)=uv.\left(\frac{u}{v}\right)'=\frac{u'}{v'}.

Use (vuuv)/v2(vu'-uv')/v^2, or rewrite the quotient using a negative power.

The numerator is vuuvvu'-uv', not uvvuuv'-vu'. Reversing it changes the sign of the answer.

The derivative of (x2+1)5(x^2+1)^5 is

5(x2+1)4(2x),5(x^2+1)^4(2x),

not merely 5(x2+1)45(x^2+1)^4.

sinx+ex\sin x+e^x is a sum, so differentiate term by term. sin(ex)\sin(e^x) is a composition, so use the chain rule. Brackets and function notation reveal the difference.

Expansion can hide helpful factors and introduce errors. Decide whether expanded or factorised form better serves the next part of the problem.

Try these before reading the answers.

  1. Differentiate y=(x2+3)exy=(x^2+3)e^x.
  2. Differentiate y=2x+1x2+4y=\dfrac{2x+1}{x^2+4}.
  3. Differentiate y=(52x)6y=(5-2x)^6.
  4. Differentiate y=cos(3x2)y=\cos(3x^2).
  5. Differentiate y=xln(x2+1)y=x\ln(x^2+1).
  6. Differentiate y=sin(2x)xy=\dfrac{\sin(2x)}{x}.
  7. Differentiate y=(xx+2)3y=\left(\dfrac{x}{x+2}\right)^3.

Use the product rule:

dydx=2xex+(x2+3)ex=ex(x2+2x+3).\frac{dy}{dx}=2xe^x+(x^2+3)e^x =e^x(x^2+2x+3).

Use the quotient rule:

dydx=(x2+4)(2)(2x+1)(2x)(x2+4)2=2x22x+8(x2+4)2.\begin{aligned} \frac{dy}{dx} &=\frac{(x^2+4)(2)-(2x+1)(2x)}{(x^2+4)^2}\\ &=\frac{-2x^2-2x+8}{(x^2+4)^2}. \end{aligned}

Use the chain rule:

dydx=6(52x)5(2)=12(52x)5.\frac{dy}{dx}=6(5-2x)^5(-2)=-12(5-2x)^5.

Use the chain rule twice:

dydx=sin(3x2)(6x)=6xsin(3x2).\frac{dy}{dx}=-\sin(3x^2)(6x)=-6x\sin(3x^2).

Use the product rule outside and the chain rule inside:

dydx=ln(x2+1)+x(2xx2+1)=ln(x2+1)+2x2x2+1.\frac{dy}{dx}=\ln(x^2+1)+x\left(\frac{2x}{x^2+1}\right) =\ln(x^2+1)+\frac{2x^2}{x^2+1}.

Use the quotient rule and chain rule:

dydx=x(2cos(2x))sin(2x)x2.\frac{dy}{dx} =\frac{x\left(2\cos(2x)\right)-\sin(2x)}{x^2}.

Use the chain rule outside. Since

ddx(xx+2)=(x+2)x(x+2)2=2(x+2)2,\frac{d}{dx}\left(\frac{x}{x+2}\right) =\frac{(x+2)-x}{(x+2)^2} =\frac{2}{(x+2)^2},

we get

dydx=3(xx+2)22(x+2)2=6x2(x+2)4.\frac{dy}{dx} =3\left(\frac{x}{x+2}\right)^2\frac{2}{(x+2)^2} =\frac{6x^2}{(x+2)^4}.

These rules are used throughout calculus. Continue to implicit differentiation to differentiate relations in which yy is not isolated, then study stationary points and curve sketching to use derivatives for analysing graphs.

You will also need these techniques in tangents and normals, parametric differentiation and connected rates of change.