I have a matrix
M = {{-num11/(2*den), num12/den}, {num12/den, num22/(2*den)}};
with
den=4*x1^2*x7^2 + 8*I*x1*x2*x7^2 - 4*x2^2*x7^2 + (I*x5 + 4*I*x3*x7 - 4*x4*x7 + 2*x8 + 2*x9)*(I*x6 + 2*(x10 + x9));
num11=16*x1^2*x7^2*(-2*x4*x7 + x8) + 8*x1*x2*x7^2*(x5 + 4*x3*x7 - 4*I*x4*x7 + 2*I*x8 - 2*I*x9) +
8*x2^2*x7^2*(I*(x5 + 4*x3*x7) + 2*x9) + ((-I)*x5 - 4*I*x3*x7 - 4*x4*x7 + 2*x8 - 2*x9)*
(I*x5 + 4*I*x3*x7 - 4*x4*x7 + 2*x8 + 2*x9)*(I*x6 + 2*(x10 + x9));
num12=(I*x1 + x2)*x7*(8*x1^2*x7^2 + 16*I*x1*x2*x7^2 - 8*x2^2*x7^2 + (I*x5 + 4*I*x3*x7 - 4*x4*x7 + 2*x8 + 2*x9)*
(I*x6 + 2*(x10 + x9)));
num22=-16*x1^2*x10*x7^2 - 8*I*x2^2*x7^2*(x6 - 2*I*x9) + (-4*x10^2 - (x6 - 2*I*x9)^2)*
(I*x5 + 4*I*x3*x7 - 4*x4*x7 + 2*x8 + 2*x9) - 8*x1*x2*x7^2*(x6 - 2*I*(-x10 + x9));
I want to find (some) real values for $x_1, x_2, \dots, x_{10}$ such that $$ \det \rm M = 0,\quad \rm tr\, \rm M=0, $$ are simultaneously satisfied under the following constraints:
- All variables $x_1, \dots, x_{10}$ are real.
- $x_5, x_6, x_7, x_8, x_9, x_{10} > 0$ (strictly positive).
- $x_1, x_2, x_3, x_4$ can be negative.
- $x_1$ and $x_2$ cannot be simultaneously zero.
- $x_3$ and $x_4$ cannot be simultaneously zero.
I tried working with the FindInstance but it doesn't seem to lead to what I'm looking for:
Following the excellent answer by @azerbajdzan this question, I tried the following:
det = Det[M] // Factor // Numerator // ReIm // ComplexExpand;
trace = Tr[M] // Factor // Numerator // ReIm // ComplexExpand;
Cases[{Thread[
DeleteCases[{x1, x4, x5, x6, x7, x8, x9, x10},
Alternatives @@ {x5, x8}] -> #],
Solve[det == 0 && trace == 0 /.
Join[{x2 -> 0, x3 -> 0},
Thread[DeleteCases[{x1, x4, x5, x6, x7, x8, x9, x10},
Alternatives @@ {x5, x8}] -> #]], PositiveRationals]} & /@
Tuples[{1, 2, 3}, {6}], Except[{___, {}}]];
Sort /@ Join @@@
Flatten[Tuples[{{#[[1]]}, #[[2]], {{x2 -> 0, x3 -> 0}}}] & /@ %, 1]
Unfortunately, it doesn't lead to any values. Is this approach fine or I am missing something?


PositiveRationalsbecause I wanted the most simple solution but maybe with your additional equation no rational solution exists so useRealsorPositiveRealsinstead. Also since you have4equations instead of2you should use, say{x5, x8, x6, x10}instead of{x5, x8}andTuples[{1, 2, 3}, {4}]instead ofTuples[{1, 2, 3}, {6}]. But still solution may not exist. $\endgroup$Join[det, trace] /. Thread[{x1, x2, x3, x4, x5, x6, x7, x8, x9, x10} -> {2, 2, -1, 2, 1/5 (12 - 2 Sqrt[31]), -8 + 2 Sqrt[31], 1, 2, 3, 2}] // RootReduceAll positive exceptx3->-1but this is allowed in your constraints. $\endgroup$denbecause $\mathrm{det} M = \mathrm{Tr} M = 0$ is equivalent to $\mathrm{det} N = \mathrm{Tr} N = 0$. Here, $N = \mathrm{den}\, M$ and $\mathrm{den}\neq 0$. $\endgroup${{a*b, a^2}, {-b^2, -a*b}}or its negative. Maybe you can guess your result from this. $\endgroup$