# Thread: Differentiating with trig funtions

1. ## Differentiating with trig funtions

How does one go about differentiating x^cos(x) ?

tried doing it using chain rule. not sure though.

2. Originally Posted by pseizure2000
How does one go about differentiating x^cos(x) ?

tried doing it using chain rule. not sure though.
Let $\displaystyle y = x^{cos(x)}$

Then
$\displaystyle ln(y) = ln(x^{cos(x)}) = cos(x)~ln(x)$

Now take the derivative:
$\displaystyle \frac{1}{y} \frac{dy}{dx} = -sin(x)~ln(x) + cos(x) \cdot \frac{1}{x}$

So
$\displaystyle \frac{dy}{dx} = y \left ( \frac{cos(x)}{x} - sin(x)~ln(x) \right )$

and we know what y is so,
$\displaystyle \frac{dy}{dx} = (x^{cos(x)} ) \left ( \frac{cos(x)}{x} - sin(x)~ln(x) \right )$

-Dan

3. why is it negative x^cos(x) in the final answer?

4. Originally Posted by pseizure2000
why is it negative x^cos(x) in the final answer?
It isn't negative. When I typed it in the first time I had factored the negative out, but on second thought I decided not to. I evidently forgot to erase the negative sign in the final answer.

Sorry! (I have fixed the problem in the original post.)

-Dan