# Trouble with combination of product rule and chain rule

Here is what I need to find:

$\frac{d}{dx}\left(5\cos\left(4x\right)\right)$

I know I can find $\frac{d}{dx}\left(\cos\left(4x\right)\right)$ easily with the chain rule, but the 5 in the front throws me off. What do I with that? Is it $0$, like other constants, or would that only be the case if the problem was:

$\frac{d}{dx}\left(5+\cos\left(4x\right)\right)$?

Do I treat it almost like I would the derivative of $10x^2$, like a coefficient before $x$?

If I apply the chain rule, I get $-4\sin\left(4x\right)$, right?

• Treat it just like the derivative of $10x^2$, yes - treat the $4$ as just a coefficient, it gets pulled out front – Rob Bland Oct 19 '16 at 19:27

$$\frac { d }{ dx } \left( 5\cos\left( 4x \right) \right) =\frac { d }{ dx } \left( 5 \right) \cos\left( 4x \right) +5\frac { d }{ dx } \left( \cos\left( 4x \right) \right) \\=0+5\frac { d }{ dx } \left( \cos\left( 4x \right) \right) \frac { d }{ dx } \left( 4x \right) =-20\sin { (4x) }$$

• So this is essentially the product and chain rule together, if I'm reading this right? – Chris T Oct 19 '16 at 19:36
• @ChrisT yes indeed – haqnatural Oct 19 '16 at 19:40

You can simply take it outside the derivative, like so:

$$\frac{d}{dx}(af(x))=a\cdot \frac{d}{dx}(f(x))$$

Here's why it works:

\begin{align} \frac{d}{dx}(af(x)) &= \frac{d}{dx}(a)\cdot f(x) + a\cdot \frac{d}{dx}(f(x)) \\ &= 0\cdot f(x) + a\cdot \frac{d}{dx} (f(x)) \\ &= a\cdot \frac{d}{dx}(f(x)) \\ \end{align}

• This correctly applies the product rule. You can also apply the chain rule. Let $g(u)=ku$. Then $g'(u)=k$, and this will lead the same direction. – Dean C Wills Oct 19 '16 at 23:20

The constant comes out: $\frac{d k f(x)}{dx}=k\frac{d f(x)}{dx}$.