# 3.7: Product Rule

$$\newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} }$$ $$\newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}}$$$$\newcommand{\id}{\mathrm{id}}$$ $$\newcommand{\Span}{\mathrm{span}}$$ $$\newcommand{\kernel}{\mathrm{null}\,}$$ $$\newcommand{\range}{\mathrm{range}\,}$$ $$\newcommand{\RealPart}{\mathrm{Re}}$$ $$\newcommand{\ImaginaryPart}{\mathrm{Im}}$$ $$\newcommand{\Argument}{\mathrm{Arg}}$$ $$\newcommand{\norm}[1]{\| #1 \|}$$ $$\newcommand{\inner}[2]{\langle #1, #2 \rangle}$$ $$\newcommand{\Span}{\mathrm{span}}$$ $$\newcommand{\id}{\mathrm{id}}$$ $$\newcommand{\Span}{\mathrm{span}}$$ $$\newcommand{\kernel}{\mathrm{null}\,}$$ $$\newcommand{\range}{\mathrm{range}\,}$$ $$\newcommand{\RealPart}{\mathrm{Re}}$$ $$\newcommand{\ImaginaryPart}{\mathrm{Im}}$$ $$\newcommand{\Argument}{\mathrm{Arg}}$$ $$\newcommand{\norm}[1]{\| #1 \|}$$ $$\newcommand{\inner}[2]{\langle #1, #2 \rangle}$$ $$\newcommand{\Span}{\mathrm{span}}$$$$\newcommand{\AA}{\unicode[.8,0]{x212B}}$$

Okay, but what about $$\frac{d}{dx} x \cdot e^x$$? Can we just take the derivative of each like this?

\begin{align*} \frac{d}{dx} x \cdot e^x & = \left( \frac{d}{dx} x \right) \cdot \left( \frac{d}{dx} e^x \right) \\ & = 1 \cdot e^x = e^x \end{align*}

Unfortunately, no. Just to be clear: the above calculation is false!

Think about $$\frac{d}{dx} x \cdot x$$. We know $$\frac{d}{dx} x = 1$$, so therefore you might think

$$\frac{d}{dx} x \cdot x = 1 \cdot 1 = 1$$

But we also know that $$\frac{d}{dx} x \cdot x = \frac{d}{dx} x^2 = 2x$$. So what do we make of this? Well, we just have to give up on the idea of “taking the derivative of each” with products. Luckily, there is a rule called the product rule that works great:

$$\boxed{\cfrac{d}{dx} f \cdot g = f g' + g f'}$$

The motto for this rule is “the first times the derivative of the second, plus the second times the derivative of the first.”

Where does this rule come from? Well, consider this picture:

Here we have a rectangle. The height is $$f$$, the width is $$g$$. The area of the rectangle is $$f \cdot g$$. If we were to make $$f$$ bigger by a little bit, by say $$\Delta f$$, and $$g$$ bigger by $$\Delta g$$, then the rectangle would become bigger too. We want to find out how quickly the area is increasing. So how quickly is it increasing? You can see in the picture we add three sections on: $$f \cdot \Delta g$$, $$g \cdot \Delta f$$, and $$\Delta f \cdot \Delta g$$. If you think of $$\Delta f$$ and $$\Delta g$$ as being really small, though, the $$\Delta f \cdot \Delta g$$ terms is incredibly tiny — so tiny it does not affect the answer in the limit. Therefore, the new area is $$f \cdot \Delta g + g \cdot \Delta f$$. This is where the product rule comes from — it’s how an area changes as you change each side length.

Let’s see this rule in action.

##### Product Rule with $$x e^x$$
Find $$\frac{d}{dx} x e^x$$.

In this case, we can attack this using the product rule with $${\color{blue} f = x}$$, and $${\color{red} g = e^x}$$. We can easily take the derivative of each part: $${\color{blue} f' = 1}$$, and $${\color{red} g' = e^x}$$. Hence, using the formula $$\frac{d}{dx} {\color{blue} f} {\color{red} g} = {\color{blue} f} {\color{red} g'} + {\color{red} g} {\color{blue} f'}$$, we have

$${\color{blue} f} {\color{red} g'} + {\color{red} g} {\color{blue} f'} = {\color{blue} x} {\color{red} e^x} + {\color{red} e^x} {\color{blue} (1)} = \boxed{x e^x + e^x}.$$

##### Another Product Rule
Find $$\frac{d}{dx} x^2 \cos(x)$$.

We see $${\color{red} f = x^2, f' = 2x}$$ and $${\color{blue} g = \cos(x), g' = -\sin(x)}$$. Hence, we have

\begin{align*} \frac{d}{dx} {\color{red} x^2} {\color{blue} \cos(x)} & = {\color{red} f} {\color{blue} g'} + {\color{blue} g} {\color{red} f'} \\ & = {\color{red} x^2} {\color{blue} (-\sin(x))} + {\color{blue} \cos(x)} {\color{red} 2x} \\ & = \boxed{-2x^2 \sin(x) + 2x \cos(x)}. \end{align*}

##### Product Rule with $$x \cdot x$$
Find $$\frac{d}{dx} x \cdot x$$ in two different ways: one way using the product rule, one way using the power rule.

Using the power rule, we see $$\frac{d}{dx} x \cdot x = \frac{d}{dx} x^2 = 2x$$. Using the product rule, we set $$f = x$$ and $$g = x$$. In which case, $$f' = 1$$ and $$g' = 1$$. Thus

$$f g' + g f' = (x)(1) + (x)(1) = \boxed{2x}.$$

Hurray! The same answer! Isn’t it great when math just plain works.

##### Another Product Rule
Find $$\frac{d}{dx} \sqrt{x} \ln(x)$$.

We see $$f = \sqrt{x}$$, $$g = \ln(x)$$. For $$f'$$, we rewrite $$f' = \frac{1}{2 \sqrt{x}}$$. As we saw in the exponents and logarithms section, $$g' = \frac{1}{x}$$. Hence

\begin{align*} \frac{d}{dx} \sqrt{x} \ln(x) & = f g' + g f' \\ & = \sqrt{x} \frac{1}{x} + \ln(x) \frac{1}{2 \sqrt{x}} \\ & = \frac{\sqrt{x}}{x} + \frac{\ln(x)}{2 \sqrt{x}} \end{align*}

Now if you want to be a bit fancy with the algebra, we can simplify $$\frac{\sqrt{x}}{x}$$ using rational exponents. It is equal to $$\frac{1}{\sqrt{x}}$$. From here, we can find a common denominator and add the two fractions.

\begin{align*} \frac{d}{dx} \sqrt{x} \ln(x) & = \frac{1}{\sqrt{x}} + \frac{\ln(x)}{2 \sqrt{x}} \\ & = \frac{2}{2 \sqrt{x}} + \frac{\ln(x)}{2 \sqrt{x}} \\ & = \boxed{\frac{\ln(x) + 2}{2 \sqrt{x}}}. \end{align*}

There you go.

This page titled 3.7: Product Rule is shared under a CC BY 4.0 license and was authored, remixed, and/or curated by Tyler Seacrest via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.