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

  • Context: Undergrad 
  • Thread starter Thread starter PeterPumpkin
  • Start date Start date
Click For Summary

Discussion Overview

The discussion revolves around the differentiation of the function (cos(x))^x and the discrepancies between the results obtained through manual differentiation using the chain rule and those provided by WolframAlpha. Participants explore the implications of using the chain rule in this context and also touch upon the topic of cube roots of negative numbers.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant applies the chain rule to differentiate (cos(x))^x and arrives at -x(sinx)(cosx)^(x-1), questioning the additional term in WolframAlpha's result.
  • Another participant notes that the power rule applies only for constant exponents, suggesting that the differentiation approach may be flawed due to the variable exponent.
  • Some participants propose rewriting the function as e^(x ln(cos(x))) to differentiate correctly, indicating that the chain rule can still be applied but requires careful handling of the variable exponent.
  • There is a discussion about the cube root of -1, with one participant expressing confusion over why -1 is not shown as a valid root in WolframAlpha, leading to clarifications about how the cube root function is interpreted.
  • Several participants emphasize that the chain rule does work but must be applied correctly, with one providing a detailed logarithmic differentiation method to clarify the process.

Areas of Agreement / Disagreement

Participants express differing views on the application of the chain rule in this context, with some asserting that it can be applied correctly while others suggest that the initial differentiation was incorrect. The discussion remains unresolved regarding the best approach to differentiate the function.

Contextual Notes

Participants highlight the importance of correctly applying differentiation techniques, especially when dealing with variable exponents. There is also mention of the principal root in the context of cube roots, which may affect interpretations of results from computational tools.

Who May Find This Useful

This discussion may be useful for students and practitioners in mathematics and physics who are exploring differentiation techniques, particularly in cases involving variable exponents and complex numbers.

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 [tex](x^n)'=nx^{n-1}[/tex] applies for constant exponents only.
As for the root: there are 3 different complex numbers satisfying [tex]x^3=-1[/tex]:
[tex]-1[/tex], [tex](1/2)(1\pm i\sqrt{3})[/tex].
 
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:
[tex]\cos(x)^{x}=e^{x\ln(\cos(x))}[/tex]
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 [itex]\sqrt{4} = 2[/itex].


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.
[tex] y=\cos^{x}x[/tex]
Take logs to get:
[tex] \log y=x\log\cos x[/tex]
Now differentiate to arrive at:
[tex] \frac{1}{y}\frac{dy}{dx}=\log\cos x-\frac{x\sin x}{\cos x}[/tex]
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 [itex]u^x[/itex] in correctly. If [itex]y= u^x[/itex] then [itex]ln(y)= x ln(u)[/itex] and then [itex](1/y) dy/dx= ln(u)+ (x/u) du/dx[/itex] so that [itex]du^x/dx= u^xln(u)+ u^{x-1}xdu/dx[/itex].
 
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".
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 8 ·
Replies
8
Views
4K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 15 ·
Replies
15
Views
4K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 14 ·
Replies
14
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K