The Product and Quotient Rules
The derivative of a product is not the product of the derivatives, and the derivative of a quotient is not the quotient of the derivatives. This lesson proves the correct rules, uses them to extend the power rule to negative exponents, and shows how to keep the algebra under control.
For a gentler first look, see Product and Quotient Rules. The rules for single terms come from Derivatives of Polynomials and Exponential Functions.
A quick warning
Take and . Then has derivative , but . Wrong. Products need a better rule.
The product rule
If and are differentiable at , then
Proof. Add and subtract in the numerator, which splits the change into " changes" and " changes":
As , the two difference quotients tend to and . Also because a differentiable function is continuous (The Derivative as a Function). The limit is . ∎
A picture helps: if and are the sides of a rectangle, a small change adds a strip , a strip and a tiny corner . The corner is second order and vanishes in the limit.
For three factors, apply the rule twice: . Each term differentiates one factor and leaves the rest alone.
The quotient rule
If and are differentiable at and , then
Proof. First the reciprocal. For , continuity keeps for small , and
So . Now write and use the product rule:
A memory aid: "low d-high minus high d-low, over low squared". The order matters, because the numerator is a difference.
Negative powers
The reciprocal rule finishes the power rule for negative integers. With , :
which is again. The power rule now holds for every integer exponent.
Checking with SymPy
SymPy applies these rules automatically. Below it differentiates a product and a quotient, then we confirm the quotient rule formula symbolically for arbitrary functions and .
import sympy as sp
x = sp.symbols('x')
prod = x**3 * sp.exp(x)
quot = (x**2 + 1) / (x - 2)
print("d/dx x³eˣ =", sp.factor(sp.diff(prod, x)))
print("d/dx (x²+1)/(x−2) =", sp.factor(sp.diff(quot, x)))
f, g = sp.Function('f')(x), sp.Function('g')(x)
rule = (sp.diff(f, x)*g - f*sp.diff(g, x)) / g**2
print("quotient rule holds:", sp.simplify(sp.diff(f/g, x) - rule) == 0)d/dx x³eˣ = x**2*(x + 3)*exp(x)
d/dx (x²+1)/(x−2) = (x**2 - 4*x - 1)/(x - 2)**2
quotient rule holds: True
By hand: , and
Tip: Before reaching for the quotient rule, simplify. is just for , and is , which the power rule handles in one step.
Where a rational function is flat
Setting the numerator of a quotient-rule derivative to zero finds horizontal tangents. For :
which is zero at . The graph rises to a peak of .
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(-8, 8, 400)
r = x / (x**2 + 4)
dr = (4 - x**2) / (x**2 + 4)**2
plt.figure(figsize=(6, 4))
plt.plot(x, r, label="r(x) = x/(x² + 4)")
plt.plot(x, dr, "--", label="r′(x)")
plt.axhline(0, color="gray", lw=0.8)
for a in (-2, 2):
plt.axvline(a, color="gray", ls=":", lw=0.8)
plt.legend()
plt.title("r′ changes sign where r has its peak and trough")
print("max of r on grid:", round(float(r.max()), 4), "at x =", round(float(x[r.argmax()]), 2))max of r on grid: 0.25 at x = 1.98
The grid maximum sits next to because itself is not a grid point; the exact peak is at .
In software
- Normalisation: softmax, , is a quotient. Its gradient, , comes straight from the quotient rule and drives every classifier and LLM output layer (Backpropagation Is the Chain Rule).
- Autodiff: a framework that records
mulanddivnodes stores exactly these rules as their backward passes (Automatic Differentiation). - Rendering: perspective projection divides by depth, ; screen-space derivatives used for texture filtering are quotient-rule derivatives.
- Economics code: average cost is minimised where , i.e. marginal cost equals average cost.
Exercises
Exercise 1: A product
Differentiate with the product rule, then expand and check.
Answer
Solution
Exercise 2: A quotient
Differentiate .
Answer
Solution
Exercise 3: Values from a table
, , , . Find and .
Answer
,
Solution
Exercise 4: Tangent to a rational curve
Find the tangent line to at , and check the slope in SymPy.
Answer
Solution
import sympy as sp
x = sp.symbols('x')
y = x**2 / (x + 1)
m = sp.diff(y, x).subs(x, 1)
print("slope:", m, " tangent: y =", sp.expand(y.subs(x, 1) + m*(x - 1)))slope: 3/4 tangent: y = 3*x/4 - 1/4
Exercise 5: Three factors
Differentiate with the three-factor product rule and simplify.
Answer
Solution
Test yourself
What is the derivative of ?
Which step in the product-rule proof needs differentiable continuous?
- Splitting the fraction
- as
- Adding and subtracting
- Using the binomial theorem
What is the derivative of ?