# Derivative of $\cos nx$

How to calculate derivative of $\cos ax$? Do I need any formula for $\cos ax$?

The answer in my exercise book says it is $-a \sin ax$. But I don't know how to come to this result. Could you maybe explain it to me?

-
Have you learned the Chain Rule? – Amzoti Jan 20 '13 at 19:48

Hint: Apply the Chain Rule with $u=nx$.

Solution:

We have: $$u = nx$$ Applying the chain rule: $$\frac{\mathrm dy}{\mathrm dx} = \frac{\mathrm dy}{\mathrm du} \cdot \frac{\mathrm du}{\mathrm dx}$$

It is clear that $u' = n$. We now have: $$\left(\frac{\mathrm d}{\mathrm du} \cos u\right) \cdot n$$ $$-n \sin u$$

Substituting back $u = nx$:

$$-n \sin nx$$

-

As @Amzoti and @George noted, you can use the Chain rule. If $f(u)=y$ and $u=g(x)$ then: $$\frac{dy}{dx}=\frac{dy}{du}\times\frac{du}{dx}$$, so in your problem we have : $$(\cos nx)'=\frac{d(\cos(u))}{du}\times\frac{du}{dx}=-\sin(u)\times n$$ This is what you are supposed to get during another answer. What I want to add you here is that, you should always care about the variable and about the constants. For example if you want the derivative of $\cos nx$ such that $n$ is variable and $x$ is constant then we will have : $$(\cos nx)'=\frac{d(\cos(u))}{du}\times\frac{du}{dx}=-\sin(u)\times x=-\sin(nx)\times x$$

-
Nice point, Babak! – amWhy Jan 20 '13 at 20:05
@amWhy: Thanks for your kind words. ;-) – Babak S. Jan 20 '13 at 20:07