# Homework Help: How to Differentiate Cos^2 x?

1. Aug 10, 2015

### basty

1. The problem statement, all variables and given/known data

What is $\frac{d}{dx}(cos^2 x)$?

2. Relevant equations

3. The attempt at a solution

u = cos x
$\frac{du}{dx} = -\sin x$
$\frac{d}{dx}(cos^2 x) = \frac{d}{du}(u^2) \ \frac{du}{dx}$
$= 2u \ \frac{du}{dx}$
$= 2 \cos x (-\sin x)$
$= -2 \cos x \sin x$

Is it correct?

2. Aug 10, 2015

### Staff: Mentor

3. Aug 10, 2015

### Orodruin

Staff Emeritus
Yes. You may simplify it further using $2\sin(a)\cos(a) = \sin(2a)$.

4. Aug 10, 2015

### DiracPool

That is correct

5. Aug 10, 2015

### basty

Why the result is different when I integrate -2 cos x sin x back?

$\int -2 \cos x \sin x \ dx$

u = sin x

$\frac{du}{dx} = \cos x$
$du = \cos x \ dx$

$\int -2 \cos x \sin x \ dx$
$= \int -2 \sin x (\cos x \ dx)$
$= \int -2u \ du$
$= -\frac{2}{1+1}u^{1+1} + c$
$= -\frac{2}{2} u^2 + c$
$= -u^2 + c$
$= -(\sin x)^2 + c$
$= - \sin^2 x + c$

6. Aug 10, 2015

### Staff: Mentor

It's possible for $\int f(x)$ to be equal to $\int g(x)dx$, even though f and g aren't the same. However, they can differ by most a constant. In your case $\cos^2(x) = -\sin^2(x) + 1$. In other words, these two functions differ by 1.