Re: How to calculate the partial derivative?

*To*: mathgroup at smc.vnet.net*Subject*: [mg128740] Re: How to calculate the partial derivative?*From*: Tang Laoya <tanglaoya1989 at gmail.com>*Date*: Thu, 22 Nov 2012 04:33:30 -0500 (EST)*Delivered-to*: l-mathgroup@mail-archive0.wolfram.com*Delivered-to*: l-mathgroup@wolfram.com*Delivered-to*: mathgroup-newout@smc.vnet.net*Delivered-to*: mathgroup-newsend@smc.vnet.net*References*: <k8jss7$5nl$1@smc.vnet.net>

Dear all, Sorry for my unsuitable example. My final program is as follows, could anyone please help me to take a look at it? Thanks, Tang Laoya Clear["Global`*"]; L1 = (a1 + b1 x + c1 y + d1 z)/6/V; L2 = (a2 + b2 x + c2 y + d2 z)/6/V; L3 = (a3 + b3 x + c3 y + d3 z)/6/V; L4 = (a4 + b4 x + c4 y + d4 z)/6/V; nod = 10; NN = Table[0, {nod}]; NN[[1]] = L1 (2 L1 - 1); NN[[2]] = L2 (2 L2 - 1); NN[[3]] = L3 (2 L3 - 1); NN[[4]] = L4 (2 L4 - 1); NN[[5]] = 4 L1 L2; NN[[6]] = 4 L2 L3; NN[[7]] = 4 L3 L1; NN[[8]] = 4 L3 L4; NN[[9]] = 4 L4 L1; NN[[10]] = 4 L2 L4; NNT = Flatten[Table[NN[[i]], {i, 1, nod}]]; Print["Dimensions of NNT:", Dimensions[NNT]]; DNx = D[NNT, x] (* How to do to let the DNx have such express? For example, DNx[[1]] = b1/6/V*(2*L1-1) + L1*b1/3/V *) DNy = D[NNT, y] DNz = D[NNT, z] DNxx = Transpose[{DNx}].{DNx}; DNyy = Transpose[{DNy}].{DNy}; DNzz = Transpose[{DNz}].{DNz}; Print["Dimensions of DNxx:", Dimensions[DNxx]]; K = DNxx + DNyy + DNzz; (* I wish to replace all express "L1^aa*L2^bb*L3^cc*L4^dd" in matrix K by "aa!*bb!*cc!dd!/((aa+bb+cc+dd+3)!)*6*V", how to do? in the express, the aa, bb, cc or dd could be ZERO *) K = Expand[K]; Print["Simplifying K"]; K = Simplify[K]