Probably off topic, but still.

I'm trying to solve equation of the form $P^2 = \mathrm{id}$, where $P$ is a matrix with some unknown coefficients. The problem is, Maple looses some solutions, in particular $id$ and $-id$. I checked if they are special cases of any solutions Maple found, they aren't.

The code goes like this (I retyped it, so it may contain some minor errors):

# some preliminatires
Id := Matrix(6, shape=identity):
P := Matrix(6, ((i,j) -> p || i || j)):
B := Matrix(6, [[-4], [0, 4], [0, 0, -4], [0, 0, 0, 4], [0, 0, 0, 0, 4], [0, 0, 0, 0, 0, -4]]):
PB := Multiply(P, B) - Transpose(Multiply(P, B)):
P1 := eval(P, solve(convert(PB, set), convert(P, set)));
sols := [solve(convert(Multiply(P1, P1) - Id, set), convert(P, set)]:

# make solutions more readable
Ps := {}:
for i from 1 to nops(sols) do
  Ps := Ps union {eval(P1, sols[i])}:
end do:

# check if any solution has Id as a special case
ids := {};
for i from 1 to nops(Ps) do
  test := [solve(convert(Ps[i] - Id, set), convert(P, set)]:
  if test <> [] then
    ids := ids union {Ps[i]}:
  end if:
end do:

If I additionally make $P$ a (3,3)-block diagonal matrix, then Maple does find both $id$ and $-id$.

Is Maple known to silently lose solutions to such equations? Is there a mistake on my part?


1 Answer 1


Yes, solve sometimes loses solutions. You might try Solve in the Groebner package, but I don't know if it would work well on such a big problem: it will probably take a lot of time and memory.

  • $\begingroup$ Thank you, so far it seems to work, but it raises the problem of checking if all solutions were indeed found. $\endgroup$ Mar 21, 2011 at 6:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .