Okay, let’s talk about [latex]\frac{d}{dx} \ e^{x^2 + x} \sin(x)[/latex]. If you’re thinking this looks like a product rule, but it also looks like a chain rule, you’re right. To compute this derivative, we need to do the chain rule and the product rule. This is because it is a multirule problem. Let’s do this example
The way I like to break this down is to consider a little rule and a big rule. In this case, the little rule is the chain rule problem [latex]\frac{d}{dx} \ e^{x^2 + x}[/latex]. If we do this problem, we see that [latex]f = e^x[/latex], [latex]f' = e^x[/latex], [latex]g = x^2 + x[/latex] and [latex]g' = 2x + 1[/latex]. So we have
\begin{equation}
\label{eq:little}
\frac{d}{dx} \ e^{x^2 + x} = {\color{red} e^{x^2 + x} (2x + 1)}.
\end{equation}
Now we are ready to do the big rule, which is the product rule. At this point we go back to the original problem [latex]\frac{d}{dx} \ e^{x^2 + x} \sin(x)[/latex]. For this product rule, we see [latex]f = e^{x^2 + x}[/latex], [latex]g = \sin(x)[/latex], [latex]g' = \cos(x)[/latex]. What is [latex]{\color{red} f'}[/latex]? Why, that’s what we just computed in the equation above! So [latex]{\color{red} f' = e^{x^2 + x}(2x+1)}[/latex]. Putting this all together with the product rule [latex]f g' + g f'[/latex], we have
\begin{align*}
\frac{d}{dx} \ e^{x^2 + x} \sin(x) & = f g’ + g {\color{red} f’} \\
& = \boxed{e^{x^2 + x} \cos(x) + \sin(x) {\color{red} e^{x^2 + x} (2x + 1)}} .
\end{align*}
little chain rule: [latex]\frac{d}{dx} \sin(x^2 + x)[/latex]
[latex]\begin{array}{ll} f = \sin(x) & g = x^2 + x \\ f' = \cos(x) & g' = 2x + 1 \end{array}[/latex]
Result: [latex]{\color{red} \cos(x^2 + x) \cdot (2x+1)}[/latex]
Big quotient rule (aka the whole problem):[latex]\frac{d}{dx} \frac{x}{\sin(x^2 + x)}[/latex]
[latex]\begin{array}{ll} f = x & g = \sin(x^2 + x) \\ f' = 1 & g' = {\color{red} \cos(x^2 + x) \cdot (2x+1)} \end{array}[/latex]
Result: [latex]\boxed{\frac{\sin(x^2 + x) \cdot 1 - x \cos(x^2 + x) \cdot (2x+1)}{(\sin(x^2+x))^2}}[/latex]