# Trigonometry differentiation problem

1. Dec 22, 2009

### bryansonex

1. The problem statement, all variables and given/known data
Differentiate the following
$$cos^2 x$$

3. The attempt at a solution
$$\frac{d(cos^2 x)}{dx} = 2 (-sin^{2-1} x).\frac{dx}{dx} = 2 (-sin x).1 = -2 sin x$$

$$-2 cos x sin x$$

Can you please tell me what's wrong !!!!!!

2. Dec 22, 2009

### CompuChip

You should be more careful in applying the chain rule. There are many formulations, the way I prefer it is to let u = cos(x). Then you are asked for d(u2(x))/dx. According to the chain rule, this is
$$\frac{d}{dx} u(x)^2 = \frac{d(u^2)}{du} \cdot \frac{du}{dx}$$
The first factor is 2u = 2 sin(x), but then you need to multiply du/dx, not dx/dx.

3. Dec 22, 2009

### Mentallic

Or another rule of thumb which I prefer is to always take the derivative of what's inside... I'll show you what I mean:

If we are to take the derivative of $x^n$ we get $nx^{n-1}$
but behind the scenes you're also taking the derivative of x, but since this is 1, multiplying by 1 doesn't change anything.

Now if we let x be anything else, such as sinx then we have $(sinx)^n$ and taking the derivative of this is the same as before, but this time the derivative of what's inside (in this case, sinx) is cosx so this makes a difference: $n(sinx)^{n-1}.cosx$

But you also need to dig deeper and keep taking the derivative of what's inside, if there is something further inside.

e.g. $\left(sin(1/x)\right)^n$
Again, take the derivative by first applying the power rule, and then taking the derivative of sin(1/x) by using the trigo change, so cos(1/x) multiplies on the outside, but finally you also need to take the derivative of 1/x (this was also done behind the scenes in the 2nd example, we took the derivative of x, but again that's 1) so altogether we get:

$$n.\left(sin(1/x)\right)^{n-1}.cos(1/x).\frac{-1}{x^2}$$

And you can of course simplify. Anyway, I know this is terribly set out but I hope you understand it