Why Does WolframAlpha Give Different Results for Differentiating (cos(x))^x?

  • Thread starter Thread starter PeterPumpkin
  • Start date Start date
PeterPumpkin
Messages
34
Reaction score
0
I wanted to differentiate (cos(x))^x
Applying the chain rule I got -x(sinx)(cosx)^(x-1)

But when I go to WolframAlpha, they show
d/dx(cos^x(x)) = cos^x(x) (log(cos(x))-x tan(x))

Why the extra term? Why doesn't the simple chain rule apply?

I have got strange results from WolframAlpha before
eg try typing (-1)^(1/3)
You don't get -1 as a root.
 
Physics news on Phys.org
As for the derivative: power rule (x^n)'=nx^{n-1} applies for constant exponents only.
As for the root: there are 3 different complex numbers satisfying x^3=-1:
-1, (1/2)(1\pm i\sqrt{3}).
 
Last edited:
PeterPumpkin said:
I wanted to differentiate (cos(x))^x
Applying the chain rule I got -x(sinx)(cosx)^(x-1)

But when I go to WolframAlpha, they show
d/dx(cos^x(x)) = cos^x(x) (log(cos(x))-x tan(x))

Why the extra term? Why doesn't the simple chain rule apply?
.
Because you have differentiated wrongly.

Rewrite as follows:
\cos(x)^{x}=e^{x\ln(\cos(x))}
and differentiate properly.
 
Thanks.

a) So, the chain rule eg putting u=cosx and y=u^x doesn't work in this case? Is that because the power is not a constant? Or is there some other reason?

b) Yes, appreciate the cube root of -1 has complex roots. What puzzled me is that -1 didn't show as a valid root. I wondered why it didn't show. www.wolframalpha.com/input/?i=cube+root+of+-1
 
PeterPumpkin said:
What puzzled me is that -1 didn't show as a valid root.
You didn't ask "what are all of the cube roots of -1". You asked "what is the value of applying the cube root function to the number -1".

It's essentially the same idea as \sqrt{4} = 2.


Try "solve x^3 = -1" or "roots of x^3 + 1" or things like that.
 
That faces the same problem as differentiating x^x without modifying the expression.
 
Here is a simple method for dealing with such things.
<br /> y=\cos^{x}x<br />
Take logs to get:
<br /> \log y=x\log\cos x<br />
Now differentiate to arrive at:
<br /> \frac{1}{y}\frac{dy}{dx}=\log\cos x-\frac{x\sin x}{\cos x}<br />
Multiple and re-arrange to get the solution, that I will leave to you.

Mat
 
PeterPumpkin said:
Thanks.

a) So, the chain rule eg putting u=cosx and y=u^x doesn't work in this case? Is that because the power is not a constant? Or is there some other reason?

b) Yes, appreciate the cube root of -1 has complex roots. What puzzled me is that -1 didn't show as a valid root. I wondered why it didn't show. www.wolframalpha.com/input/?i=cube+root+of+-1
It is not that the "chain rule doesn't work", it is that you have differentiated u^x in correctly. If y= u^x then ln(y)= x ln(u) and then (1/y) dy/dx= ln(u)+ (x/u) du/dx so that du^x/dx= u^xln(u)+ u^{x-1}xdu/dx.
 
PeterPumpkin said:
Thanks.

a) So, the chain rule eg putting u=cosx and y=u^x doesn't work in this case? Is that because the power is not a constant? Or is there some other reason?

b) Yes, appreciate the cube root of -1 has complex roots. What puzzled me is that -1 didn't show as a valid root. I wondered why it didn't show. www.wolframalpha.com/input/?i=cube+root+of+-1
What Wolframalpha is showing is the "principal root".
 
Back
Top