Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I have a symbolic matrix

$$m = \begin{pmatrix}A1 & B1 & C1\\A2 & B2 & C2 \\ A3 & B3 & C3\end{pmatrix}$$

and I believe that Det[m] is always zero (i.e. [A3 B3 C3] is a linear combination of [A1 B1 C1] and [A2 B2 C2]).

The expressions for the A's, B's, and C's that I have are fairly complex, so by the time you multiply all the terms to get the determinant the expression is huge. I have tried substituting random numerical values for all of my symbols and the numerical result of the determinant is indeed very small (O(10^-12)), and graphically all of the lines that I've seen produced in this form intersect at the same point, so I'm quite convinced this should be zero, but I just want something to show me "yes, it is actually zero" before I proceed with this assumption in further work.

I'm not sure how to post a .nb file, so I've simplified what I have to plain text. Does anyone know how to show that det[m] = 0 without substituting numerical values for all of the symbols remaining (and obtaining very small, but unfortunately non-zero, values)?

A1 = x1*D23 + x2*D31 + x3*D12
B1 = y1*D23 + y2*D31 + y3*D12
C1 = -.5*(D12*D23*D31 + (x1^2 + y1^2)*D23 + (x2^2 + y2^2)*D31 + (x3^2 + y3^2)* D12)

A2 = x1*D24 + x2*D41 + x4*D12
B2 = y1*D24 + y2*D41 + y4*D12
C2 = -.5*(D12*D24*D41 + (x1^2 + y1^2)*D24 + (x2^2 + y2^2)*D41 + (x4^2 + y4^2)* D12)

A3 = x2*D34 + x3*D42 + x4*D23
B3 = y2*D34 + y3*D42 + y4*D23
C3 = -.5*(D23*D34*D42 + (x2^2 + y2^2)*D34 + (x3^2 + y3^2)*D42 + (x4^2 + y4^2)* D23)

m = {
     {A1, B1, C1},
     {A2, B2, C2},
     {A3, B3, C3}
    }

determinant = Det[m]

D12 = D2 - D1

D13 = D3 - D1

D14 = D4 - D1

D23 = D3 - D2

D24 = D4 - D2

D34 = D4 - D3

D21 = -D12

D31 = -D13

D32 = -D23

D41 = -D14

D42 = -D24

D43 = -D34

D1 = Sqrt[(x0 - x1)^2 + (y0 - y1)^2]

D2 = Sqrt[(x0 - x2)^2 + (y0 - y2)^2]

D3 = Sqrt[(x0 - x3)^2 + (y0 - y3)^2]

D4 = Sqrt[(x0 - x4)^2 + (y0 - y4)^2]

Random numerical substitutions

x1 = 3.4
y1 = 5.6
x2 = 7.8
y2 = 1.2
x3 = 8.3
y3 = 9.1
x4 = 7.2
y4 = 5.9
x0 = 14.08
y0 = 2.34

In[58]:= determinant

Out[58]= 7.27596*10^-12
share|improve this question
    
Have you tried Simplify[Det[m]] ? Even more satisfactorily, change 0.5 to 1/2. –  b.gatessucks Apr 18 '13 at 17:40
1  
PossibleZeroQ is not likely to get this wrong. And it confirms your belief. In[164]:= PossibleZeroQ[Rationalize[Det[m]]] Out[164]= True –  Daniel Lichtblau Apr 18 '13 at 17:51
    
Related : mathematica.stackexchange.com/questions/18381/… –  Artes Apr 18 '13 at 17:56
add comment

1 Answer

up vote 2 down vote accepted

I haven't seen that you want to replace more variables after the Det call. When I create your matrix completely, it can be shown that the determinant is zero

A1 = x1*D23 + x2*D31 + x3*D12;
B1 = y1*D23 + y2*D31 + y3*D12;
C1 = -1/2*(D12*D23*D31 + (x1^2 + y1^2)*D23 + (x2^2 + y2^2)*
      D31 + (x3^2 + y3^2)*D12);

A2 = x1*D24 + x2*D41 + x4*D12;
B2 = y1*D24 + y2*D41 + y4*D12;
C2 = -1/2*(D12*D24*D41 + (x1^2 + y1^2)*D24 + (x2^2 + y2^2)*
      D41 + (x4^2 + y4^2)*D12);

A3 = x2*D34 + x3*D42 + x4*D23;
B3 = y2*D34 + y3*D42 + y4*D23;
C3 = -1/2*(D23*D34*D42 + (x2^2 + y2^2)*D34 + (x3^2 + y3^2)*
      D42 + (x4^2 + y4^2)*D23);

m = ({{A1, B1, C1}, {A2, B2, C2}, {A3, B3, C3}}) //. {
   D12 -> D2 - D1, D13 -> D3 - D1, D14 -> D4 - D1, D23 -> D3 - D2,
   D24 -> D4 - D2, D34 -> D4 - D3, D21 -> -D12, D31 -> -D13, 
   D32 -> -D23, D41 -> -D14, D42 -> -D24, D43 -> -D34, 
   D1 -> Sqrt[(x0 - x1)^2 + (y0 - y1)^2],
   D2 -> Sqrt[(x0 - x2)^2 + (y0 - y2)^2],
   D3 -> Sqrt[(x0 - x3)^2 + (y0 - y3)^2],
   D4 -> Sqrt[(x0 - x4)^2 + (y0 - y4)^2]
   }

Simplify[Det[m] == 0]

give then True.

share|improve this answer
    
I guess (being very new to Mathematica) I don't understand why you have to explicitly request "Simplify[]"? The expression of det[m] is tens of lines (even though we now know it is equal to zero) - how would that ever be useful? –  David Doria Apr 18 '13 at 19:13
    
And I guess I'm not sure how to use this result. I can't really say in a paper "we see that this is zero because Mathematica Simplify[] outputs 0" :) I don't suppose there is a function that will show the substitutions/manipulations necessary to show the equality? –  David Doria Apr 18 '13 at 19:17
1  
@DavidDoria probably the reason Simplify doesn't get automatically applied is that it could take an arbitrarily long time. Maybe all you want to do is substitute numbers, and not waste time simplifying; so the result isn't useless. As for showing the manipulations, not really. –  acl Apr 18 '13 at 21:01
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.