artwork with multiple stairs representing Product Rule
Outlier Articles Home

Calculus

What Is the Product Rule? [With Examples]

07.25.2022 • 7 min read

Rachel McLean

Subject Matter Expert

What is the product rule? Learn how to use the product rule to calculate derivatives of products. Then, explore how we derive the product rule, and test your mastery with examples.

In This Article

  1. What Is the Product Rule?

  2. What Is the Product Rule Formula?

  3. Product Rule Proof

  4. Examples of the Product Rule

The product rule is a useful addition to your mathematical toolbox. Keep reading to learn how we use the product rule to simplify the differentiation process.

What Is the Product Rule?

The product rule is a handy tool for differentiating a product of functions. The term “product of functions” refers to the multiplication of two or more functions. The product rule allows us to calculate quickly the derivatives of products of functions that are not easily multiplied by hand—or that we can’t simplify any further.

Dr. Tim Chartier refers to the product rule as a game-changing derivative rule:

How do you know when to use the product rule? The product rule allows us to differentiate two differentiable functions that are being multiplied together. If we can express a function in the form f(x)g(x)f(x) \cdot g(x)—where ff and gg are both differentiable functions—then we can calculate its derivative using the product rule.

What Is the Product Rule Formula?

The product rule derivative formula tells us that the derivative of a product of two differentiable functions is equal to the first function multiplied by the second function’s derivative, plus the second function multiplied by the first function’s derivative. Phew, that's a mouthful!

So, if h(x)=f(x)g(x)h(x) = f(x) \cdot g(x), where both ff and gg are differentiable functions, then the product rule is:

h(x)=f(x)g(x)+g(x)f(x)h’(x) = f(x) \cdot g’(x) + g(x) \cdot f’(x)

We can also express the product rule formula using Leibniz’s notation.

ddx[h(x)]=f(x)ddx[g(x)]+g(x)ddx[f(x)]\frac{d}{dx}[h(x)] = f(x)\frac{d}{dx}[g(x)] + g(x)\frac{d}{dx}[f(x)]

So, the derivative of the product of functions f(x)g(x)f(x) \cdot g(x) is equal to f(x)f(x) multiplied by g(x)g’(x), plus g(x)g(x) multiplied by f(x)f’(x).

For example, let’s consider the function hh defined by h(x)=x4sin(x)h(x) = x^4\sin{(x)}. We express this function as the product of two functions, x4x^4 and sin(x)sin{(x)}.

Using the product rule formula to calculate the derivative of hh, we’ll let f(x)=x4f(x) = x^4 and g(x)=sin(x)g(x) = \sin{(x)}.

ddx[h(x)]=f(x)ddx[g(x)]+g(x)ddx[f(x)]\frac{d}{dx}[h(x)] = f(x)\frac{d}{dx}[g(x)] + g(x)\frac{d}{dx}[f(x)]
ddx[h(x)]=x4ddx[sin(x)]+sin(x)ddx[x4]\frac{d}{dx}[h(x)] = x^4 \cdot \frac{d}{dx}[\sin{(x)}] + \sin{(x)} \cdot \frac{d}{dx}[x^4]

To calculate ddx[sin(x)]\frac{d}{dx}[\sin{(x)}], we can refer to the derivative rules for the sine function, which tells us that ddx[sin(x)]=cos(x)\frac{d}{dx}[\sin{(x)}] = \cos{(x)}. To calculate ddx[x4]\frac{d}{dx}[x^4], we’ll need to use the power rule for derivatives, which tells us that ddx[x4]=4x3\frac{d}{dx}[x^4] = 4x^3.

Now, we can finish our calculation by plugging in these derivatives:

ddx[h(x)]=x4ddx[sin(x)]+sin(x)ddx[x4]\frac{d}{dx}[h(x)] = x^4 \cdot \frac{d}{dx}[\sin{(x)}] + \sin{(x)} \cdot \frac{d}{dx}[x^4]
ddx[h(x)]=x4cos(x)+4x3sin(x)\frac{d}{dx}[h(x)] = x^4 \cos{(x)} + 4x^3\sin{(x)}

Using the product rule, we’ve found that the derivative of h(x)=x4sin(x)h(x) = x^4\sin{(x)} is x4cos(x)+4x3sin(x)x^4 \cos{(x)} + 4x^3\sin{(x)}.

Be careful. The derivative of a product of functions is not equal to the product of each function’s derivatives.

ddx[f(x)g(x)]ddx[f(x)]ddx[g(x)]\frac{d}{dx}[f(x)\cdot g(x)] \neq \frac{d}{dx}[f(x)] \cdot \frac{d}{dx}[g(x)]

Consider the earlier example, h(x)=x4sin(x)h(x) = x^4\sin{(x)}. In this example, we define h(x)h(x) as the product of x4x^4 and sin(x)\sin{(x)}. The derivative of x4x^4 is 4x34x^3 and the derivative of sin(x)\sin{(x)} is cos(x)\cos{(x)}. The product of these derivatives is 4x3cos(x)4x^3 \cdot \cos{(x)}. Notice that this function is not equal to the derivative of h(x)h(x) that we calculated earlier: h(x)=x4cos(x)+4x3sin(x)h’(x) = x^4 \cos{(x)} + 4x^3\sin{(x)}. Be cautious of this common mistake when differentiating a product of functions.

Product Rule Proof

We’ll discuss two popular proofs of the product rule. The first involves using the first principle of derivatives. The second proof relies upon the chain rule. Proof Using the First Principle of Derivatives We formally define derivatives using limits. This relationship is often called the first principle of derivatives.

f(x)=limΔx0f(x+Δx)f(x)Δxf’(x) = \mathop{\lim }\limits_{\Delta{x} \to 0} \frac{{f\left( {x + \Delta{x} } \right) - f\left( x\right)}}{\Delta{x}}

To begin our proof of the product rule, we apply the above definition to a product of functions, where the function hh is defined by h(x)=f(x)g(x)h(x) = f(x) \cdot g(x).

h(x)=limΔx0f(x+Δx)g(x+Δx)f(x)g(x)Δxh’(x) = \mathop{\lim }\limits_{\Delta{x} \to 0} \frac{{f\left( {x + \Delta{x} } \right)g\left( {x + \Delta{x} } \right) - f\left( x\right)g\left( x\right)}}{\Delta{x}}

To move forward from this step, we’ll use some algebraic manipulation. First, we subtract f(x+Δx)g(x)f(x+\Delta{x})g(x) from the numerator. Follow this by immediately adding f(x+Δx)g(x)f(x+\Delta{x})g(x) to the numerator. This results in no change to the value of the numerator, since adding and subtracting the same number results in zero.

h(x)=limΔx0f(x+Δx)g(x+Δx)f(x+Δx)g(x)+f(x+Δx)g(x)f(x)g(x)Δxh’(x) = \mathop{\lim }\limits_{\Delta{x} \to 0} \frac{{f( x + \Delta{x})g(x + \Delta{x})- f(x+\Delta{x})g(x) + f(x+\Delta{x})g(x) - f(x)g(x)}}{\Delta{x}}

Adding and subtracting f(x+Δx)g(x)f(x+\Delta{x})g(x) allows us to factor cleverly the numerator. First, we’ll factor f(x+Δx)f(x+\Delta{x}) out of the first two expressions of the numerator. Then, we’ll factor g(x)g(x) out of the last two expressions of the numerator. We can also use the sum law for limits to separate our expression into a sum of limits.

h(x)=limΔx0f(x+Δx)[g(x+Δx)g(x)]+g(x)[f(x+Δx)f(x)]Δxh’(x) = \mathop{\lim }\limits_{\Delta{x} \to 0} \frac{f(x+\Delta{x})[g(x+\Delta{x})-g(x)] + g(x)[f(x+\Delta{x})-f(x)]}{\Delta{x}}

h(x)=limΔx0f(x+Δx)[g(x+Δx)g(x)]Δx+limΔx0g(x)[f(x+Δx)f(x)]Δxh’(x) = \mathop{\lim }\limits_{\Delta{x} \to 0} \frac{f(x+\Delta{x})[g(x+\Delta{x})-g(x)]}{\Delta{x}} + \mathop{\lim }\limits_{\Delta{x} \to 0} \frac{g(x)[f(x+\Delta{x})-f(x)]}{\Delta{x}}

h(x)=limΔx0f(x+Δx)g(x+Δx)g(x)Δx+limΔx0g(x)f(x+Δx)f(x)Δxh’(x) = \mathop{\lim }\limits_{\Delta{x} \to 0} f(x+\Delta{x})\frac{g(x+\Delta{x})-g(x)}{\Delta{x}} + \mathop{\lim }\limits_{\Delta{x} \to 0} g(x)\frac{f(x+\Delta{x})-f(x)}{\Delta{x}}

The product law for limits states that the limit of a product of two functions is the product of their limits. This law allows us to separate our expression into four limits:

h(x)=limΔx0f(x+Δx)+limΔx0g(x+Δx)g(x)Δx+limΔx0g(x)+limΔx0f(x+Δx)f(x)Δxh’(x) = \mathop{\lim }\limits_{\Delta{x} \to 0} f(x+\Delta{x}) + \mathop{\lim }\limits_{\Delta{x} \to 0} \frac{g(x+\Delta{x})-g(x)}{\Delta{x}} + \mathop{\lim }\limits_{\Delta{x} \to 0} g(x) + \mathop{\lim }\limits_{\Delta{x} \to 0} \frac{f(x+\Delta{x})-f(x)}{\Delta{x}}

Notice that limΔx0f(x+Δx)\mathop{\lim }\limits_{\Delta{x} \to 0} f(x+\Delta{x}) and limΔx0g(x)\mathop{\lim }\limits_{\Delta{x} \to 0} g(x) are simply equal to f(x)f(x) and g(x)g(x). Similarly, observe that limΔx0f(x+Δx)f(x)Δx\mathop{\lim }\limits_{\Delta{x} \to 0} \frac{f(x+\Delta{x})-f(x)}{\Delta{x}} and limΔx0g(x+Δx)g(x)Δx\mathop{\lim }\limits_{\Delta{x} \to 0} \frac{g(x+\Delta{x})-g(x)}{\Delta{x}} are simply the limit definitions of the derivatives of f(x)f(x) and g(x)g(x):

limΔx0f(x+Δx)=f(x)\mathop{\lim }\limits_{\Delta{x} \to 0} f(x+\Delta{x}) = f(x)
limΔx0g(x)=g(x)\mathop{\lim }\limits_{\Delta{x} \to 0} g(x) = g(x)
limΔx0f(x+Δx)f(x)Δx=f(x)\mathop{\lim }\limits_{\Delta{x} \to 0} \frac{f(x+\Delta{x})-f(x)}{\Delta{x}} = f’(x)
limΔx0g(x+Δx)g(x)Δx=g(x)\mathop{\lim }\limits_{\Delta{x} \to 0} \frac{g(x+\Delta{x})-g(x)}{\Delta{x}} = g’(x)

The last step is to plug in the above substitutions.

h(x)=limΔx0f(x+Δx)+limΔx0g(x+Δx)g(x)Δx+limΔx0g(x)+limΔx0f(x+Δx)f(x)Δxh’(x) = \mathop{\lim }\limits_{\Delta{x} \to 0} f(x+\Delta{x}) + \mathop{\lim }\limits_{\Delta{x} \to 0} \frac{g(x+\Delta{x})-g(x)}{\Delta{x}} + \mathop{\lim }\limits_{\Delta{x} \to 0} g(x) + \mathop{\lim }\limits_{\Delta{x} \to 0} \frac{f(x+\Delta{x})-f(x)}{\Delta{x}}

h(x)=f(x)g(x)+g(x)f(x)h’(x) = f(x)g’(x) + g(x)f’(x)

Through the first principle of derivatives, we’ve proved the product rule!

Proof Using the Chain Rule

We use the chain rule to differentiate compositions of functions. Define FF such that F(x)=f(g(x))F(x) = f(g(x)) for every xx, and let ff and gg be differentiable. Then:

F(x)=f(g(x))g(x)F’(x) = f’(g(x))g’(x)

To derive the product rule, we’ll consider the function hh defined by h(x)=[f(x)+g(x)]2h(x) = [f(x) + g(x)]^2, where ff and gg are differentiable functions.

For this proof of the product rule, we’ll differentiate hh in two different ways, and then equate the results in order to derive the formula for the product rule.

First, we’ll use the chain rule to differentiate. We’ll also need the sum rule and power rule for derivatives.

h(x)=2[f(x)+g(x)][f(x)+g(x)]h’(x) = 2[f(x) + g(x)][f’(x) + g’(x)]
h(x)=2f(x)f(x)+2f(x)g(x)+2g(x)f(x)+2g(x)g(x)h’(x)= 2f(x)f’(x) + 2f(x)g’(x) + 2g(x)f’(x) + 2g(x)g’(x)

Now, we’ll calculate the derivative a second way, by expanding h(x)=[f(x)+g(x)]2h(x) = [f(x) + g(x)]^2.

h(x)=[f(x)]2+2f(x)g(x)+[g(x)]2h(x) = [f(x)]^2 + 2f(x)g(x) + [g(x)]^2

Now, differentiating hh, we have:

h(x)=2f(x)f(x)+2[f(x)g(x)]+2g(x)g(x)h’(x) = 2f(x)f’(x) + 2[f(x)g(x)]’ + 2g(x)g’(x)

Now we have two different equations for h(x)h’(x). Notice that the second equation has the term 2[f(x)g(x)]2[f(x)g(x)]’. The inside term [f(x)g(x)][f(x)g(x)]’ represents the derivative of a product of functions. This is what we will solve for.

Since we have two equations for h(x)h’(x), we can equate the two and solve for [f(x)g(x)][f(x)g(x)]’.

2f(x)f(x)+2f(x)g(x)+2g(x)f(x)+2g(x)g(x)=2f(x)f(x)+2[f(x)g(x)]+2g(x)g(x)2f(x)f’(x) + 2f(x)g’(x) + 2g(x)f’(x) + 2g(x)g’(x) = 2f(x)f’(x) + 2[f(x)g(x)]’ + 2g(x)g’(x)

2f(x)g(x)+2g(x)f(x)=2[f(x)g(x)]2f(x)g’(x) + 2g(x)f’(x) = 2[f(x)g(x)]’

f(x)g(x)+g(x)f(x)=[f(x)g(x)]f(x)g’(x) + g(x)f’(x) = [f(x)g(x)]’

[f(x)g(x)]=f(x)g(x)+g(x)f(x) [f(x)g(x)]’ = f(x)g’(x) + g(x)f’(x)

Now, we’ve proved the product rule using the chain rule!

Examples of the Product Rule

Let’s walk through a few product rule examples.

Practice Problem 1

Calculate the derivative of f(x)=7xcos(x)f(x) = 7x\cos{(x)} using the product rule.

Solution

For this problem, we’ll use the derivative rule for the cosine function, as well as a special case of the power rule, where our exponent is 1. Using the product rule, we have:

ddx[f(x)]=f(x)ddx[g(x)]+g(x)ddx[f(x)]\frac{d}{dx}[f(x)] = f(x)\frac{d}{dx}[g(x)] + g(x)\frac{d}{dx}[f(x)]
ddx[f(x)]=7xddx[cos(x)]+cos(x)ddx[7x]\frac{d}{dx}[f(x)] = 7x\frac{d}{dx}[\cos{(x)}] + \cos{(x)}\frac{d}{dx}[7x]
ddx[f(x)]=7x(sin(x))+cos(x)7\frac{d}{dx}[f(x)] = 7x \cdot (-\sin{(x)}) + \cos{(x)} \cdot 7
ddx[f(x)]=7xsin(x))+7cos(x)\frac{d}{dx}[f(x)] = -7x\sin{(x)}) + 7\cos{(x)}
ddx[f(x)]=7cos(x)7xsin(x))\frac{d}{dx}[f(x)] = 7\cos{(x)} - 7x\sin{(x)})

Practice Problem 2

Calculate the derivative of f(x)=ln(x)e3xf(x) = \ln{(x)}e^{3x} using the product rule.

Solution

For this problem, we’ll use the differentiation rules for exponential functions and the natural log function, as well as the chain rule. Using the product rule formula, we have:

ddx[f(x)]=f(x)ddx[g(x)]+g(x)ddx[f(x)]\frac{d}{dx}[f(x)] = f(x)\frac{d}{dx}[g(x)] + g(x)\frac{d}{dx}[f(x)]
ddx[f(x)]=ln(x)ddx[e3x]+e3xddx[ln(x)]\frac{d}{dx}[f(x)] = \ln{(x)}\frac{d}{dx}[e^{3x}] + e^{3x}\frac{d}{dx}[\ln{(x)}]
ddx[f(x)]=ln(x)[e3x3]+e3x1x\frac{d}{dx}[f(x)] = \ln{(x)}[e^{3x}\cdot 3] + e^{3x}\cdot \frac{1}{x}
ddx[f(x)]=3e3xln(x)+e3xx\frac{d}{dx}[f(x)] = 3e^{3x}\ln{(x)} + \frac{e^{3x}}{x}

Practice Problem 3

Calculate the derivative of f(x)=xtan(7x2)f(x) = x\tan{(7x^2)} using the product rule.

Solution

For this problem, we’ll use the differentiation rule for the tangent function, as well as the power rule and chain rule. Using the product rule formula, we have:

ddx[f(x)]=f(x)ddx[g(x)]+g(x)ddx[f(x)]\frac{d}{dx}[f(x)] = f(x)\frac{d}{dx}[g(x)] + g(x)\frac{d}{dx}[f(x)]
ddx[f(x)]=xddx[tan(7x2)]+tan(7x2)ddx[x]\frac{d}{dx}[f(x)] = x\frac{d}{dx}[\tan{(7x^2)}] + \tan{(7x^2)}\frac{d}{dx}[x]
ddx[f(x)]=xsec2(7x2)14x+tan(7x2)1\frac{d}{dx}[f(x)] = x\sec ^2 {(7x^2)} \cdot 14x + \tan{(7x^2)} \cdot 1
ddx[f(x)]=14x2sec2(7x2)+tan(7x2)\frac{d}{dx}[f(x)] = 14x^2\sec ^2{(7x^2)} + \tan{(7x^2)}

The product rule comes in handy quite often. Other helpful rules to learn include the quotient rule, the chain rule, and the power rule. Once you have a grasp of the different derivative rules, you’re on your way to excelling in calculus.

Explore Outlier's Award-Winning For-Credit Courses

Outlier (from the co-founder of MasterClass) has brought together some of the world's best instructors, game designers, and filmmakers to create the future of online college.

Check out these related courses:

Calculus I

Calculus I

The mathematics of change.

Explore course
Intro to Statistics

Intro to Statistics

How data describes our world.

Explore course
Intro to Microeconomics

Intro to Microeconomics

Why small choices have big impact.

Explore course

Share