Product Rule

The rule

To differentiate a product of two functions, differentiate each one in turn while holding the other fixed, then add the results:

ddx[u(x)v(x)]=u′(x)v(x)+u(x)v′(x)\dfrac{d}{dx}\left[u(x)v(x)\right] = u'(x)v(x) + u(x)v'(x)

Worked example

Find the derivative of f(x)=(x2+1)(x3−3x)f(x) = (x^2+1)(x^3-3x).

Solution: With u=x2+1u=x^2+1 (so u′=2xu'=2x) and v=x3−3xv=x^3-3x (so v′=3x2−3v'=3x^2-3):

f′(x)=2x(x3−3x)+(x2+1)(3x2−3)f'(x) = 2x(x^3-3x) + (x^2+1)(3x^2-3)=(2x4−6x2)+(3x4−3)=5x4−6x2−3= (2x^4-6x^2) + (3x^4-3) = 5x^4 - 6x^2 - 3

Three functions multiplied together

The rule extends to any number of factors: differentiate one factor at a time, keep the others unchanged, and add up the results:

ddx[uvw]=u′vw+uv′w+uvw′\dfrac{d}{dx}\left[uvw\right] = u'vw + uv'w + uvw'

Differentiate y=x2exsin⁡xy = x^2 e^x \sin x.

Solution: With u=x2u = x^2, v=exv = e^x and w=sin⁡xw = \sin x, the derivatives are u′=2xu' = 2x, v′=exv' = e^x and w′=cos⁡xw' = \cos x:

y′=2x exsin⁡x+x2exsin⁡x+x2excos⁡x=xex(2sin⁡x+xsin⁡x+xcos⁡x)y' = 2x\,e^x\sin x + x^2e^x\sin x + x^2e^x\cos x = xe^x\left(2\sin x + x\sin x + x\cos x\right)

Logarithmic differentiation, a product-rule cousin

When a variable appears in both the base and the exponent, taking a logarithm first turns the problem into one the product rule can handle.

If y=xsin⁡xy = x^{\sin x} for x>0x > 0, find dydx\dfrac{dy}{dx}.

Solution: Take the natural log of both sides: ln⁡y=sin⁡xln⁡x\ln y = \sin x \ln x. Differentiate both sides: the right side is now a product:

y′y=cos⁡xln⁡x+sin⁡x⋅1x\dfrac{y'}{y} = \cos x \ln x + \sin x \cdot \dfrac{1}{x}

Multiplying back through by y=xsin⁡xy = x^{\sin x}:

y′=xsin⁡x[sin⁡xx+ln⁡xcos⁡x]y' = x^{\sin x}\left[\dfrac{\sin x}{x} + \ln x \cos x\right]

Common mistakes

  • Multiplying the derivatives. (uv)′≠u′v′(uv)' \ne u'v'. Try u=v=xu = v = x: the product is x2x^2, whose derivative is 2x2x, but u′v′=1u'v' = 1.
  • Dropping one of the terms. There is one term per factor: two for uvuv, three for uvwuvw. Each term has exactly one factor differentiated.
  • Reaching for it when one factor is a constant. 5x35x^3 is a constant times a power, so its derivative is just 15x215x^2. The product rule gives the same answer, only more slowly.
  • Worrying about the order. Addition doesn't care about order, so u′v+uv′u'v + uv' and uv′+u′vuv' + u'v are the same. That is not true of the quotient rule, where order matters.

Continue learning

The quotient rule is the product rule's counterpart for dividing two functions instead of multiplying them.