$$TX^2 = OX^2-OT^2 =OM^2-OT^2 = (OQ+QM)(OP-QM)-OT^2$$ but since $OP\cdot OQ = OT^2$, $$ TX^2 = QM(OP-OQ)-QM^2 = 2 QM^2-QM^2 = QM^2 $$ as wanted.
$$TX^2 = OX^2-OT^2 =OM^2-OT^2 = (OQ+QM)(OP-QM)-OT^2$$ but since $OP\cdot OQ = OT^2$, $$ TX^2 = QM(OP-OQ)-QM^2 = 2 QM^2-QM^2 = QM^2 $$ as wanted.