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

  • Thread starter PeterPumpkin
  • Start date
In summary: For a complex number, this is defined as the root with the largest argument. In this case, the principal root of -1 is (1/2)(1+i√3). This is why -1 is not shown as a valid root. As for the chain rule, it still applies, but the differentiation is more complicated because the power is not a constant. This is why the extra term appears in the result from Wolframalpha. In summary, when differentiating (cos(x))^x, the chain rule still applies but the differentiation is more complicated due to the power not being a constant. Additionally, the value of -1 is not shown as a valid root when using the cube root function in Wolframalpha because it is
  • #1
PeterPumpkin
34
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
  • #2
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:
  • #3
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.
 
  • #4
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
 
  • #5
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.
 
  • #6
That faces the same problem as differentiating x^x without modifying the expression.
 
  • #7
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
 
  • #8
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].
 
  • #9
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".
 

1. What is WolframAlpha and what does it do?

WolframAlpha is a computational knowledge engine designed to answer questions and perform calculations using a vast collection of data and algorithms. It can provide information on a wide range of topics, including mathematics, science, history, and current events.

2. How is WolframAlpha different from other search engines?

Unlike traditional search engines that provide a list of web pages, WolframAlpha generates direct answers to specific questions by processing and analyzing data from its curated knowledge base. It also allows for more complex queries and can perform computations and visualizations.

3. Can WolframAlpha solve any type of problem?

WolframAlpha is not a general-purpose AI and cannot solve every type of problem. It is designed to answer factual and computational questions using its curated data and algorithms. It may not be able to provide answers to opinion-based or speculative questions.

4. Is WolframAlpha free to use?

WolframAlpha offers both free and paid versions. The free version provides limited access to its features and data, while the paid version, called WolframAlpha Pro, offers more comprehensive data and additional features for a subscription fee.

5. Can WolframAlpha be used for academic or research purposes?

Yes, WolframAlpha can be a valuable tool for academic and research purposes. It can provide accurate and reliable data, perform complex calculations and visualizations, and assist in data analysis. However, it should not be used as a sole source of information and should be used in conjunction with other resources.

Similar threads

Replies
3
Views
1K
Replies
3
Views
1K
Replies
8
Views
125
  • Calculus and Beyond Homework Help
Replies
3
Views
326
Replies
4
Views
301
Replies
14
Views
1K
  • Calculus and Beyond Homework Help
Replies
6
Views
936
Replies
4
Views
931
  • Calculus and Beyond Homework Help
Replies
10
Views
931
Replies
2
Views
1K
Back
Top