-1

I have this code :

enter image description here

factor(sqrt((diff(theta, x1))^2+(diff(theta, y1))^2+(diff(theta, z1))^2));

enter image description here

enter image description here enter image description here

The two equations are identicals but maple doesn't see it(the difference give me an awful equation ...). Is there a way for maple to be able de factorize the first equation ?

Kafka
  • 720
  • 6
  • 21

1 Answers1

0

When you write, "The two equations are identicals..." you seem to be indicating that you think that they are mathematically equivalent.

That is false.

Under the assumptions that all the unknowns are real, Maple can simplify the difference to zero.

Below, I give a counter-example where the two expressions are not equal.

It is bad etiquette here, to provide images of code instead of plaintext code.

restart;
with(VectorCalculus):
r1:=<x1,y1,z1>:
r2:=<x2,y2,z2>:
r3:=<x3,y3,z3>:
A:=r1 &x r2:
B:=r3 &x r2:

theta:=arccos(DotProduct(A,B)/(Norm(A)*Norm(B))):

sintheta1:=Norm(r1 &x r2)/(Norm(r1)*Norm(r2)):

expr1:=factor(sqrt((diff(theta, x1))^2+(diff(theta, y1))^2
              +(diff(theta, z1))^2)):

lprint(expr1);
    ((x2^2+y2^2+z2^2)/(x1^2*y2^2+x1^2*z2^2-2*x1*x2*y1*y2-
    2*x1*x2*z1*z2+x2^2*y1^2+x2^2*z1^2+y1^2*z2^2-
    2*y1*y2*z1*z2+y2^2*z1^2))^(1/2)

expr2:=1/(Norm(r1)*sintheta1):

lprint(expr2);
    (x2^2+y2^2+z2^2)^(1/2)/((y1*z2-y2*z1)^2
    +(-x1*z2+x2*z1)^2+(x1*y2-x2*y1)^2)^(1/2)

Now, under the assumptions that all the unknowns are real,

combine(expr2-expr1) assuming real;

                           0

Now, a counter-example with (some particular) complex values,

simplify(eval(expr2-expr1, [x1=I, x2=1, y1=0, y2=1, z1=0, z2=1]));

                        (1/2)  (1/2)
                    -I 2      3  
acer
  • 6,671
  • 15
  • 15
  • ok, I didn't think about the fact that this equations are not equal with complex ... I didn't know combine too. Thank you – Kafka Jan 06 '19 at 15:46