Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Puzzled by WolframAlpha

  1. Jul 12, 2010 #1
    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.
  2. jcsd
  3. Jul 12, 2010 #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: Jul 12, 2010
  4. Jul 12, 2010 #3


    User Avatar
    Science Advisor
    Homework Helper
    Gold Member
    Dearly Missed

    Because you have differentiated wrongly.

    Rewrite as follows:
    and differentiate properly.
  5. Jul 12, 2010 #4

    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
  6. Jul 12, 2010 #5


    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    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.
  7. Jul 15, 2010 #6
    That faces the same problem as differentiating x^x without modifying the expression.
  8. Jul 15, 2010 #7


    User Avatar
    Homework Helper

    Here is a simple method for dealing with such things.
    Take logs to get:
    \log y=x\log\cos x
    Now differentiate to arrive at:
    \frac{1}{y}\frac{dy}{dx}=\log\cos x-\frac{x\sin x}{\cos x}
    Multiple and re-arrange to get the solution, that I will leave to you.

  9. Jul 17, 2010 #8


    User Avatar
    Science Advisor

    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].
  10. Jul 18, 2010 #9


    User Avatar
    Science Advisor

    What Wolframalpha is showing is the "principal root".
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook