A−d(adjA)=(m−qdp(1+d)n(1+d)q−md)=O means, since det of this matrix is zero identically as A satisfies this:
(m−qd)(q−md)−np(1+d)2=0⇒mq−m2d−q2d+mqd2−np(1+d)2=0.
Using mq−np=d: d+d2⋅d−d(m2+q2)−np⋅2d=0 leads (after simplification, as in the source) to
\[1+d^2=(m+q)^2-2d \Rightarrow (1+d)^2=(m+q)^2.\]