Re: Derivative help
- To: mathgroup at smc.vnet.net
- Subject: [mg39164] Re: Derivative help
- From: "Allan Hayes" <hay at haystack.demon.co.uk>
- Date: Fri, 31 Jan 2003 23:37:16 -0500 (EST)
- References: <b1dg35$7ar$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
"Steve Chiang" <stevezx at attbi.com> wrote in message news:b1dg35$7ar$1 at smc.vnet.net... > Hi, all. I'm new to Mathematica. I went to the help section for my > question but it only further confused me. I'm basically trying to take the > first derivative of (ln(x))^x. Here is my syntax: f = (ln(x))^x. But then > when I evaluate f ', it says nothing but ((ln(x))^x)' which is nothing new. > Is this because I didn't specify bounds and that the function may be > discontinuous over the default bounds in Mathematica? > > Thanks Steve, This is really to do with mathematics , but here we need to discus it with Mathematica syntax After f = Log[x]^x; f is defined to be the expression (formula) Log[x]^x; This can be differentiated with respect to x D[f,x] Log[x]^x*(1/Log[x] + Log[Log[x]]) Clear the definition for f. Clear[f] Define f[x_] = Log[x]^x; This defines f as a one-place function f[2] Log[2]^2 As such, f can be differentiated with respect to its first (and only) place and the resulting function can be evaluated at, for example, 2. f'[2] Log[2]^2*(1/Log[2] + Log[Log[2]]) The distinction between expessions and functions comes out more when we compare a formula in two variables with the corresponding functon with two places Start with an expression g= x^3 y; D[g,x] 3*x^2*y D[g,y] x^3 Clear[g] Now define the corresponding function g[x_,y_]=x^3 y; Differentiate g with respect to its first place and then with respect to its second place: Derivative[1,0][g][x,y] 3*x^2*y Derivative[0,1][g][x,y] x^3 ------------------- In fact f' carries its definition around in the form of a *pure function*. f' (Log[Log[#1]] + 1/Log[#1])*Log[#1]^#1 & And we could have defined f using a pure function in two ways Clear[f] (1) f= Function[x, Log[x]^x]; f[x] Log[x]^x f' Function[x, Log[x]^x*(1/Log[x] + Log[Log[x]])] f'[2] Log[2]^2*(1/Log[2] + Log[Log[2]]) Clear[f] (2) f= Log[#]^#&; f[x] Log[x]^x f' (Log[Log[#1]] + 1/Log[#1])*Log[#1]^#1 & f'[2] Log[2]^2*(1/Log[2] + Log[Log[2]]) -- Allan --------------------- Allan Hayes Mathematica Training and Consulting Leicester UK hay at haystack.demon.co.uk Voice: +44 (0)116 271 4198 Fax: +44 (0)870 164 0565