
Re: How to calculate the partial derivative?
Posted:
Nov 23, 2012 3:30 AM


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
Hi, Tang,
Try the following.
This is your definition and I denote the derivative result by expr:
L1=a1+b1*x+c1*y; L2=a2+b2*x+c2*y; L3=a3+b3*x+c3*y;
NN=L1*L2;
expr=DNx=D[NN,x]//Simplify
a2 b1+a1 b2+2 b1 b2 x+b2 c1 y+b1 c2 y
What you want is to exclude x and y from the final expression. Let us denote L1 and L2 by l1 and l2, and find x and y from the first and the second equations:
sol = Solve[{l2 == a2 + b2*x + c2*y, a1 + b1*x + c1*y == l1}, {x, y}][[1]]
{x > ((a2 c1  a1 c2 + c2 l1  c1 l2)/(b2 c1  b1 c2)), y > ((a2 b1 + a1 b2  b2 l1 + b1 l2)/(b2 c1  b1 c2))}
Now substitute it into the result:
expr /. sol // Simplify
b2 l1 + b1 l2
Have fun, Alexei
Alexei BOULBITCH, Dr., habil. IEE S.A. ZAE Weiergewan, 11, rue Edmond Reuter, L5326 Contern, LUXEMBOURG
Office phone : +35224542566 Office fax: +35224543566 mobile phone: +49 151 52 40 66 44
email: alexei.boulbitch@iee.lu

