The product and quotient rules
In basic differentiation rules, we learned to differentiate sums and differences one term at a time. Now we need rules for products and quotients.
The derivative of a product is not the product of the derivatives. Here is a quick check. Let $f(x)=x$ and $g(x)=x$. Then $f(x)g(x)=x^2$, and its derivative is $2x$. But $f'(x)g'(x)=1\cdot 1=1$. These are not equal.
So we need a new rule. The same is true for quotients.
The product rule
If $f$ and $g$ are both differentiable, then
$\dfrac{d}{dx}[f(x)g(x)]=f'(x)g(x)+f(x)g'(x)$.
In words: the derivative of the first times the second, plus the first times the derivative of the second.
A shorter way to write it is
$(fg)'=f'g+fg'$.
Check it with $x\cdot x$: $(1)(x)+(x)(1)=2x$. That is the correct derivative of $x^2$.
Optional Why the product rule works
Let $p(x)=f(x)g(x)$. Use the definition of the derivative:
$\begin{align*}&p'(x)\\&=\lim_{h\to 0}\dfrac{f(x+h)g(x+h)-f(x)g(x)}{h}\end{align*}$
Here is the trick. In the numerator, subtract $f(x+h)g(x)$, and then add it back. This does not change the value:
$\begin{align*}&f(x+h)g(x+h)-f(x)g(x)\\&=f(x+h)g(x+h)-f(x+h)g(x)\\&\qquad+f(x+h)g(x)-f(x)g(x)\end{align*}$
Factor $f(x+h)$ out of the first two terms, and $g(x)$ out of the last two:
$\begin{align*}&=f(x+h)\big(g(x+h)-g(x)\big)\\&\qquad+g(x)\big(f(x+h)-f(x)\big)\end{align*}$
Put this numerator back over $h$. Split the fraction into two:
$\begin{align*}&p'(x)\\&=\lim_{h\to 0}\Big[f(x+h)\,\dfrac{g(x+h)-g(x)}{h}\\&\qquad+g(x)\,\dfrac{f(x+h)-f(x)}{h}\Big]\end{align*}$
Now let $h\to 0$:
- ${\dfrac{g(x+h)-g(x)}{h}\to g'(x)}$
- ${\dfrac{f(x+h)-f(x)}{h}\to f'(x)}$
- $f(x+h)$ approaches $f(x)$. This is true because $f$ is differentiable, so it is also continuous (see the derivative as a function).
So
$\begin{align*}&p'(x)=f(x)g'(x)+g(x)f'(x)\end{align*}$
Example 1: Find $y'$ for
$y=(x^2+1)(x^3-2x)$.
Solution:
Let the first factor be $x^2+1$. Its derivative is $2x$.
Let the second factor be $x^3-2x$. Its derivative is $3x^2-2$.
Use the product rule:
$y'=2x(x^3-2x)+(x^2+1)(3x^2-2)$
Multiply out each product:
$2x(x^3-2x)=2x^4-4x^2$
$(x^2+1)(3x^2-2)=3x^4+x^2-2$
Now add them and combine like terms:
$\begin{align*}&y'\\&=2x^4-4x^2+3x^4+x^2-2\\&=5x^4-3x^2-2\end{align*}$
Check: Expand first: $y=x^5-x^3-2x$. Then $y'=5x^4-3x^2-2$. The answers match.
In Example 1, expanding first also works. Sometimes expanding is not possible, or it is more work. Then the product rule is the better tool.
Example 2: Find $f'(x)$ for
$f(x)=\sqrt{x}\,(4-x)$.
Solution:
The first factor is $\sqrt{x}=x^{1/2}$. Its derivative is $\dfrac{1}{2\sqrt{x}}$.
The second factor is $4-x$. Its derivative is $-1$.
Use the product rule:
$\begin{align*}&f'(x)\\&=\dfrac{1}{2\sqrt{x}}(4-x)+\sqrt{x}\,(-1)\\&=\dfrac{4-x}{2\sqrt{x}}-\sqrt{x}\end{align*}$
To combine the two terms, write $\sqrt{x}$ with the common denominator $2\sqrt{x}$:
$\sqrt{x}=\dfrac{2x}{2\sqrt{x}}$
Then
$\begin{align*}&f'(x)\\&=\dfrac{4-x-2x}{2\sqrt{x}}\\&=\dfrac{4-3x}{2\sqrt{x}}\end{align*}$
The quotient rule
If $f$ and $g$ are both differentiable, and $g(x)\ne 0$, then
$\dfrac{d}{dx}\left[\dfrac{f(x)}{g(x)}\right]=\dfrac{f'(x)g(x)-f(x)g'(x)}{[g(x)]^2}$.
In words: the derivative of the numerator times the denominator, minus the numerator times the derivative of the denominator, all over the denominator squared.
A shorter way to write it is
$\left(\dfrac{f}{g}\right)'=\dfrac{f'g-fg'}{g^2}$.
Be careful with the order. The numerator has a minus sign, so the order matters. Always start with the derivative of the numerator, $f'g$.
Optional Where the quotient rule comes from
Let $q(x)=\dfrac{f(x)}{g(x)}$. Multiply both sides by $g(x)$:
$f(x)=q(x)g(x)$
Assume $q$ is differentiable. (This can be proved with limits.) Use the product rule on the right side:
$f'(x)=q'(x)g(x)+q(x)g'(x)$
Now solve for $q'(x)$. Subtract $q(x)g'(x)$ from both sides:
$q'(x)g(x)=f'(x)-q(x)g'(x)$
Replace $q(x)$ by $\dfrac{f(x)}{g(x)}$:
$q'(x)g(x)=f'(x)-\dfrac{f(x)}{g(x)}\,g'(x)$
Divide both sides by $g(x)$:
$q'(x)=\dfrac{f'(x)}{g(x)}-\dfrac{f(x)g'(x)}{[g(x)]^2}$
Write the right side over the common denominator $[g(x)]^2$. On the left, $q'(x)$ is $\left(\dfrac{f(x)}{g(x)}\right)'$:
$\left(\dfrac{f(x)}{g(x)}\right)'=\dfrac{f'(x)g(x)-f(x)g'(x)}{[g(x)]^2}$
Example 3: Find $y'$ for $y=\dfrac{x^2+1}{x-3}$.
Solution:
The numerator is $x^2+1$. Its derivative is $2x$.
The denominator is $x-3$. Its derivative is $1$.
Use the quotient rule:
$\begin{align*}&y'\\&=\dfrac{2x(x-3)-(x^2+1)(1)}{(x-3)^2}\\&=\dfrac{2x^2-6x-x^2-1}{(x-3)^2}\\&=\dfrac{x^2-6x-1}{(x-3)^2}\end{align*}$
Leave the denominator in factored form. This makes it easy to see where $y'$ is undefined ($x=3$).
Example 4: Let $f(x)=\dfrac{3x}{x^2+1}$.
(a) Find $f'(x)$.
(b) Find the equation of the tangent line at $x=0$.
(c) Find the points where the tangent line is horizontal.
Solution:
(a) The numerator $3x$ has derivative $3$. The denominator $x^2+1$ has derivative $2x$.
$\begin{align*}&f'(x)\\&=\dfrac{3(x^2+1)-3x(2x)}{(x^2+1)^2}\\&=\dfrac{3x^2+3-6x^2}{(x^2+1)^2}\\&=\dfrac{3-3x^2}{(x^2+1)^2}\end{align*}$
(b) The point: $f(0)=0$, so the point is $(0,0)$.
The slope: $f'(0)=\dfrac{3-0}{1}=3$.
The tangent line is $y=3x$.
(c) The tangent line is horizontal where $f'(x)=0$. A fraction is $0$ when its numerator is $0$:
$\begin{align*}3-3x^2&=0\\x^2&=1\\x&=\pm 1\end{align*}$
$f(1)=\dfrac{3}{2}$ and $f(-1)=-\dfrac{3}{2}$. So the tangent line is horizontal at $\left(1,\tfrac{3}{2}\right)$ and $\left(-1,-\tfrac{3}{2}\right)$.
The power rule for negative integers
In basic differentiation rules, we proved the power rule only for positive integers. The quotient rule proves it for negative integers too.
Let $n$ be a positive integer. Then $x^{-n}=\dfrac{1}{x^n}$. The numerator is $1$, and its derivative is $0$. The denominator is $x^n$, and its derivative is $nx^{n-1}$. So
$\begin{align*}&\dfrac{d}{dx}\left(\dfrac{1}{x^n}\right)\\&=\dfrac{0\cdot x^n-1\cdot nx^{n-1}}{(x^n)^2}\\&=\dfrac{-nx^{n-1}}{x^{2n}}\\&=-nx^{n-1-2n}\\&=-nx^{-n-1}\end{align*}$
This is exactly what the power rule gives for the exponent $-n$. So the power rule works for every integer exponent.
Simplify first when you can
Not every fraction needs the quotient rule. If the denominator is a single term, you can often split or simplify the fraction first. Then the power rule is faster.
Example 5: Find each derivative.
(a) $\dfrac{d}{dx}\left(\dfrac{5}{x^3}\right)$ (b) $\dfrac{d}{dx}\left(\dfrac{x^3+2x}{x}\right)$
Solution:
(a) Rewrite $\dfrac{5}{x^3}=5x^{-3}$. Then
$\begin{align*}&\dfrac{d}{dx}(5x^{-3})\\&=-15x^{-4}\\&=-\dfrac{15}{x^4}\end{align*}$
(b) Divide each term of the numerator by $x$ (for $x\ne 0$):
$\dfrac{x^3+2x}{x}=x^2+2$
So the derivative is $2x$ (for $x\ne 0$).
Both answers also come from the quotient rule, but with more steps.
Using values of $f$ and $g$
Sometimes we know only a few values of $f$, $g$, and their derivatives. The rules still work at a single point.
Example 6: Suppose that
$f(2)=3$, $f'(2)=-1$,
$g(2)=4$, $g'(2)=5$.
Find
(a) $(fg)'(2)$ (b) $\left(\dfrac{f}{g}\right)'(2)$
Solution:
(a) Use the product rule at $x=2$:
$\begin{align*}&(fg)'(2)\\&=f'(2)g(2)+f(2)g'(2)\\&=(-1)(4)+(3)(5)\\&=11\end{align*}$
(b) Use the quotient rule at $x=2$:
$\begin{align*}&\left(\dfrac{f}{g}\right)'(2)\\&=\dfrac{f'(2)g(2)-f(2)g'(2)}{[g(2)]^2}\\&=\dfrac{(-1)(4)-(3)(5)}{4^2}\\&=-\dfrac{19}{16}\end{align*}$
Summary
Here $f$ and $g$ are differentiable, $g(x)\ne 0$ in the quotient rule, and $n$ is a positive integer:
| Rule | Formula |
|---|---|
| Product | $\dfrac{d}{dx}[f(x)g(x)]=f'(x)g(x)+f(x)g'(x)$ |
| Quotient | $\dfrac{d}{dx}\left[\dfrac{f(x)}{g(x)}\right]=\dfrac{f'(x)g(x)-f(x)g'(x)}{[g(x)]^2}$ |
| Power (negative integer) | $\dfrac{d}{dx}(x^{-n})=-nx^{-n-1}$ |
← Basic differentiation rulesDerivatives of trigonometric functions →