Re: Best syntax for derivative

*To*: mathgroup at smc.vnet.net*Subject*: [mg96424] Re: [mg96386] Best syntax for derivative*From*: Murray Eisenberg <murray at math.umass.edu>*Date*: Fri, 13 Feb 2009 03:44:07 -0500 (EST)*Organization*: Mathematics & Statistics, Univ. of Mass./Amherst*References*: <200902121141.GAA08658@smc.vnet.net>*Reply-to*: murray at math.umass.edu

f[x_, y_, z_] := Sin[x y z] f2[x_, y_, z_] = D[f[x, y, z], y] Observe no ":" in the assignment for f2, since you want Set and not SetDelayed here (so that the formula for the derivative is calculated immediately for your f). This allows you readily to evaluate the partial derivative at specific numbers or algebraic expressions. For example: f2[1, 4, -Pi/2] f2[a+b, c, d/h] Aaron Fude wrote: > Hi, > > Suppose I have a function of three variables > > f[x_, y_, z_]:=Sin[x y z] > > And I want to construct g[x, y, z] which is the partial derivative of f > [] with respect to y. I do > > f[x_, y_, z_] := Sin[x y z] > g[x_, y_, z_] := D[f[x, temp, z], temp] /. temp -> y > > but I'm sure there is something better. Something along the lines of > > g = Partial[f, 2] > > Many thanks in advance. > > Aaron > -- Murray Eisenberg murray at math.umass.edu Mathematics & Statistics Dept. Lederle Graduate Research Tower phone 413 549-1020 (H) University of Massachusetts 413 545-2859 (W) 710 North Pleasant Street fax 413 545-1801 Amherst, MA 01003-9305

**References**:**Best syntax for derivative***From:*Aaron Fude <aaronfude@gmail.com>