Start the course

Derivatives

The product rule and quotient rule: how and when to use each

7 min readUpdated

Quick answer

The product rule says the derivative of f(x)g(x) is f′(x)g(x)+f(x)g′(x): differentiate one factor at a time and add. The quotient rule says the derivative of f(x)g(x) is f′(x)g(x)−f(x)g′(x)g(x)2. Use them when two functions of x are multiplied or divided and no simple rewrite removes the product or quotient.

Key points
  • The derivative of a product is not the product of the derivatives: (fg)′≠f′g′.
  • Product rule: (fg)′=f′g+fg′, one term for each factor being differentiated.
  • Quotient rule: (fg)′= f′g−fg′g2; the order on top matters because of the minus sign.
  • If the bottom is a number or a single term, rewrite instead of using the quotient rule.

Why isn't the derivative of a product the product of the derivatives?

Sums can be differentiated term by term, so it's tempting to think products work the same way. A quick test shows they don't. Take x⋅x, which is x2, so its derivative is 2x by the power rule. The derivatives of the two factors are 1 and 1, and their product is 1, not 2x. So a product needs its own rule.

A picture explains the real answer. Think of f(x)g(x) as the area of a rectangle with sides f and g. When x changes a little, both sides change, and the area grows along both edges: by about (change in f) times g along one edge, plus f times (change in g) along the other. That's the product rule.

What is the product rule?

The product rule
ddx[f(x)g(x)]= f′(x)g(x)+f(x)g′(x)
Why it works
  1. Start from the definition: the difference quotient has f(x+h)g(x+h)−f(x)g(x) on top and h on the bottom.
  2. Subtract and add f(x+h)g(x) on top, which adds zero. The top becomes f(x+h)g(x+h)−f(x+h)g(x) +f(x+h)g(x)−f(x)g(x).
  3. Group in pairs: f(x+h)⋅g(x+h)−g(x)h+ g(x)⋅f(x+h)−f(x)h.
  4. As h→0, the fractions become g′(x) and f′(x), and f(x+h)→f(x) because a differentiable function is continuous. The total becomes f(x)g′(x)+g(x)f′(x).

In words: differentiate the first factor and leave the second alone, then leave the first alone and differentiate the second, and add.

Worked example: Product rule, checked by multiplying out

Differentiate y=(x2+1)(3x−5).

  1. Name the factors: f=x2+1, so f′=2x; and g=3x−5, so g′=3.
  2. Product rule: y′= f′g+fg′= 2x(3x−5)+(x2+1)⋅3.
  3. Multiply out: 6x2−10x+3x2+3.
  4. Combine like terms: 9x2−10x+3.
  5. Check: multiplying out first gives y=3x3−5x2+3x−5, and the power rule gives y′=9x2−10x+3. ✓

Answer: y′=9x2−10x+3

Worked example: A product that can't be multiplied out

Differentiate y=x2cos⁡x.

  1. f=x2, so f′=2x; g=cos⁡x, so g′=−sin⁡x.
  2. Product rule: y′= 2xcos⁡x+x2(−sin⁡x).
  3. Simplify the sign: y′= 2xcos⁡x−x2sin⁡x.

Answer: y′= 2xcos⁡x−x2sin⁡x

Common mistake

Using the product rule on a number times a function. In 5sin⁡x, the 5 is a constant multiple: the derivative is simply 5cos⁡x. (The product rule gives the same answer, because the derivative of 5 is 0, but it's extra work.)

What is the quotient rule?

The quotient rule
ddx[f(x)g(x)]= f′(x)g(x)−f(x)g′(x)g(x)2, wherever g(x)≠0.
Why it works
  1. Call the quotient Q=fg. Then f=Qg, a product.
  2. Product rule on f=Qg: f′=Q′g+Qg′.
  3. Solve for Q′: Q′g=f′−Qg′, so Q′= f′−Qg′g.
  4. Replace Q by fg and multiply top and bottom by g: Q′= f′g−fg′g2.

A common way to remember it, writing "high" for the top and "low" for the bottom: low times d-high, minus high times d-low, over low squared. Starting with the bottom function is what makes the sign come out right.

Worked example: The quotient rule

Differentiate y= 2x+1x2+3.

  1. Top f=2x+1, so f′=2. Bottom g=x2+3, so g′=2x.
  2. Quotient rule: y′= 2(x2+3)−(2x+1)(2x)(x2+3)2.
  3. Multiply out the top: 2x2+6−(4x2+2x).
  4. Simplify: 2x2+6−4x2−2x= −2x2−2x+6.
  5. Leave the bottom squared: y′= −2x2−2x+6(x2+3)2.

Answer: y′= −2x2−2x+6(x2+3)2

Worked example: Where the derivative of tan x comes from

Use the quotient rule to differentiate tan⁡x= sin⁡xcos⁡x.

  1. f=sin⁡x, f′=cos⁡x; g=cos⁡x, g′=−sin⁡x.
  2. Quotient rule: cos⁡x⋅cos⁡x−sin⁡x⋅(−sin⁡x)cos2⁡x= cos2⁡x+sin2⁡xcos2⁡x.
  3. Since sin2⁡x+cos2⁡x=1, this is 1cos2⁡x, which is written sec2⁡x.

Answer: ddxtan⁡x= sec2⁡x

Common mistake

Swapping the order on top. f′g−fg′ and fg′−f′g differ by a minus sign, so starting with the wrong term flips the sign of the whole answer. Also, keep the g2 on the bottom: it's easy to forget.

When should you avoid the quotient rule?

The quotient rule always works for a quotient, but it isn't always the fastest or safest route. Look at the bottom first:

If the bottom isDo this insteadExample
a numbertake it out as a constant multiplex3+2x4= 14(x3+2x), derivative 14(3x2+2)
a single termsplit into separate powersx3+2xx2= x+2x−1, derivative 1−2x−2
a sum or differenceuse the quotient rule4x3+2x

How do you use the product rule with three factors?

Group two of the factors and use the product rule twice. The result has a simple pattern: one term for each factor, with that factor differentiated and the other two left alone.

(fgh)′=f′gh+fg′h+fgh′
Worked example: Three factors

Differentiate y=xexsin⁡x.

  1. The three factors are x (derivative 1), ex (derivative ex) and sin⁡x (derivative cos⁡x).
  2. One term per factor: y′= 1⋅exsin⁡x+x⋅ex⋅sin⁡x+ x⋅ex⋅cos⁡x.
  3. Factor out ex: y′= ex(sin⁡x+xsin⁡x+xcos⁡x).

Answer: y′= ex(sin⁡x+xsin⁡x+xcos⁡x)

How do the product and quotient rules combine with the chain rule?

In larger problems, the rules nest. To differentiate x2x2+1, the last operation is multiplying, so the product rule comes first; differentiating the factor x2+1 then needs the chain rule. Find the outermost operation, apply its rule, and repeat on each piece.

Learn it step by step

The full lessons in the course explain this from the ground up, with graphs, worked examples, and practice problems that each have a complete worked solution.

Open the lesson

Frequently asked questions

What is the product rule formula?

(fg)′=f′g+fg′: the derivative of the first times the second, plus the first times the derivative of the second.

What is the quotient rule formula?

(fg)′= f′g−fg′g2: bottom times the derivative of the top, minus top times the derivative of the bottom, all over the bottom squared.

Does the order matter in the product rule?

No, because addition doesn't depend on order: f′g+fg′ equals fg′+f′g. In the quotient rule the order does matter, because of the subtraction.

Can you use the product rule instead of the quotient rule?

Yes: write fg= f⋅g−1 and use the product rule with the chain rule on g−1. It gives the same answer, sometimes in a less tidy form.

Do I need to simplify after using the quotient rule?

Simplify the top (multiply out and combine like terms) and leave the bottom as a square. Factoring the top helps if you need to find where the derivative is zero.