Thank you very much for your kindly reply. I tested your code, it works! Howerver, I still didn't understand your code, could you give me some more explains? In addition, I write similar code according to your format, it doesn't work, could you please help me to take a look at it?
Thanks, Tang Laoya
Clear["Global`*"]; eq1 = L1 == (a1 + b1 x + c1 y + d1 z)/6/V; eq2 = L2 == (a2 + b2 x + c2 y + d2 z)/6/V; eq3 = L3 == (a3 + b3 x + c3 y + d3 z)/6/V; eq4 = L4 == (a4 + b4 x + c4 y + d4 z)/6/V; lhs[eq_] := eq /. (lhs_ == rhs_) -> lhs; rhs[eq_] := eq /. (lhs_ == rhs_) -> rhs;
On Wednesday, November 21, 2012 2:15:07 PM UTC+8, Tang Laoya wrote: > Dear all, > > > > I am trying to calculate the partial derivative by mathematica, I have the following commands: > > L1=a1+b1*x+c1*y; > > L2=a2+b2*x+c2*y; > > L3=a3+b3*x+c3*y; > > > > NN=L1*L2; > > > > DNx=D[NN,x]; > > > > I got the following result: > > DNex=b2 (a1+b1 x+c1 y)+b1 (a2+b2 x+c2 y) > > > > How to do to have the following result? > > > > DNex=b2*L1 + b1 * L2 > > > > > > Thanks, > > Tang Laoya