C.a.R. > Applications > Similarity and Angles> Chord Tangent Theorem
First we compute, that the blue angles are equals, using the midpoint angle. Then QAB and QPA are similar. We get QP/QA = QA/QB, Thus the chord tangent theorem QP*QB=QA^2.
Here is another proof.
Both expressions are computed in a text field using %...%.