Gah! More math!

This is a discussion on Gah! More math! within the A Brief History of Cprogramming.com forums, part of the Community Boards category; I've looked everywhere! There has to be a special rule for finding the derivative of (x^x), because (x^x) is not ...

  1. #1
    BMJ
    BMJ is offline
    Banal internet user BMJ's Avatar
    Join Date
    Aug 2002
    Location
    Chicagoland
    Posts
    1,380

    Angry Gah! More math!

    I've looked everywhere!

    There has to be a special rule for finding the derivative of (x^x), because (x^x) is not an exponential expression, is it constant? No... can't be....

    gaah! Anyone good with math/calc help me!

  2. #2
    BMJ
    BMJ is offline
    Banal internet user BMJ's Avatar
    Join Date
    Aug 2002
    Location
    Chicagoland
    Posts
    1,380
    This isn't homework BTW; I'm working on some calculus algorithms

  3. #3
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,493
    the derivative of (x^x) is (ln(x) + 1) * x^x

    why? my calculator told me so.

  4. #4
    BMJ
    BMJ is offline
    Banal internet user BMJ's Avatar
    Join Date
    Aug 2002
    Location
    Chicagoland
    Posts
    1,380
    That doesn't help... I got the same thing on my calculator; I need to be able to get there, I cannot find any forumals, proof, identities... ANYTHING that helps me grrrr... this bites

  5. #5
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,493
    let's start off at the basics

    hmm...

    the derivative of a*n^r == a*r*n^(r-1)

    however, 1 * x^x == 1 * x * x^(x-1) == 1 * x^x

    hmm...

  6. #6
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,493

  7. #7
    Registered User
    Join Date
    Aug 2001
    Posts
    244
    Ahh good 'ol calculus...

    had to whip out my stuff from last year, but here you go: (It's called logarithmic differentiation, btw)

    y = x^x
    take natural log of both sides
    ln(y) = x*ln(x) < - this last part is a property of logarithms
    now take the derivative of both sides...
    (dy/dx)*ln(y) = (dy/dx)(x*ln(x))
    because taking the derivative of y gives dy/dx....
    (1/y)*(dy/dx) = 1*ln(x) + x*(1/x) < - product rule
    (1/y)*(dy/dx) = ln(x) + 1 <- just simplified the right side...
    multiply both sides by y...
    (dy/dx) = y(ln(x) + 1)
    and since we know y = x^x...
    (dy/dx) = x^x * (ln(x) + 1)

    and voila.

    I don't know how that would be programmed easily, but thats how you get there..

  8. #8
    Registered User
    Join Date
    Aug 2001
    Posts
    244
    Originally posted by ygfperson
    maybe this will help

    http://members.lycos.co.uk/kgsfs/xpwrx.html
    That gives an approximated numerical derivative... (like a calculator gives) perhaps not what he needs?

    [edit]

    and that drmath explanation.. kinda stinks. He is making it overly complicated by doing e^(log(x^x))...

  9. #9
    BMJ
    BMJ is offline
    Banal internet user BMJ's Avatar
    Join Date
    Aug 2002
    Location
    Chicagoland
    Posts
    1,380
    thanks guys... I figured it out before I checked back here.

    I just need to build a math function for the special case of (x^x) because it is neither a power expression nor an exponential expression...

    (d/dx)[x^x] = [(ln(x)+1)(x^x)] works great!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Math
    By knightjp in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 04-01-2009, 06:36 PM
  2. Help with C++ Math
    By aonic in forum C++ Programming
    Replies: 4
    Last Post: 01-29-2005, 04:40 AM
  3. Basic Math Problem. Undefined Math Functions
    By gsoft in forum C Programming
    Replies: 1
    Last Post: 12-28-2004, 03:14 AM
  4. Math Header?
    By Rune Hunter in forum C++ Programming
    Replies: 26
    Last Post: 09-17-2004, 07:39 AM
  5. toughest math course
    By axon in forum A Brief History of Cprogramming.com
    Replies: 12
    Last Post: 10-28-2003, 10:06 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21