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:
ids;
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?