prove that $PM$ is perpendicular to $AB$ on a cyclic quadrilateral 
In the cyclic quadrilateral $ABCD$, the sides $AB, DC$ meet at $Q$, the side $AD,BC$ meet at $P$, $M$ is the midpoint of $BD$. If $\angle APQ = 90$°, prove that $PM$ is perpendicular to $AB$. 

I feel like this problem should be relatively simple in the end but I'm not getting it yet. So far I've noticed that $\angle DCB$ is equal to $\angle BAP$; $\angle ADC, \angle CBQ$ and $\angle PBA$ are equal; $\angle BAD$ and $\angle QCB$ too are equal. The triangles $QAD$ and $QCB$ are similar, and the triangles $APB$ and $CPD$ as well. triangles $DPM$ and $MPB$ should have the same area (although I believe M could play a more important role). I've looked for similar right triangles which didn't work for me, and have tried marking the intersection of $MP$ and $AB$ as $H$ and let $x=\angle PHA$ and $y=\angle PHB$ and tried to show $x=y$, but that hasn't worked either. Any help would really be appreciated! 

 A: 
From $\triangle ABP$ and $\triangle ADQ$,
$$ \frac {AP} {BP} = \frac {\sin \delta} {\sin \gamma} =
\frac {AQ} {DQ} \Rightarrow \\
\frac {DP \cos \gamma} {BP \cos \delta} =
\frac {DP \cdot AP/AQ} {BP \cdot DP/DQ} = 1.$$
From $\triangle DPM$ and $\triangle BPM$,
$$\frac {DP} {\sin \angle DMP} = \frac {DM} {\sin \phi}, \\
\frac {BP} {\sin \angle BMP} = \frac {BM} {\sin (\gamma +\delta + \phi)}, \\
\frac {DP} {BP} = \frac {\sin (\gamma + \delta + \phi)} {\sin \phi} =
\frac {\cos \delta} {\cos \gamma},$$
which simplifies to $\sin(\gamma + \delta) \cos(\gamma + \phi) = 0$, therefore $\phi = \pi/2 - \gamma$ and $PM \perp AB$.
A: Suppose circle $O$ is centered at $(0,0)$. WLOG, suppose $D$ and $C$ lie on the $x$-axis. Define the half circle $f(x):=\sqrt{r^2-x^2}$.


Now, $A,B,C,D$ are points defined as:
$$\{A=\bigl(p,f\left(p\right)\bigr),
B=\bigl(s,f(s)\bigr),C=\bigl(q,f(q)\bigr),D=\bigl(t,-f(t)\bigr)\}$$
However, since $C$ and $D$ lie on the $x$-axis, $q=r$ and $t=-r$. Writing the equations of the lines forming the cyclic quadrilateral should be easy.

Lines $AB$ and $CD$ intersect at $Q$:
$$Q=\left(\frac{\sqrt{r^2-p^2} \sqrt{r^2-s^2}+p s+r^2}{p+s},0\right)$$
While lines $AD$ and $BC$ intersect at $P$:
$$P=\left(\frac{-\sqrt{r^2-p^2} \sqrt{r^2-s^2}+p s+r^2}{p+s},\frac{2 r}{\frac{p+r}{\sqrt{r^2-p^2}}+\frac{\sqrt{(r-s) (r+s)}}{r+s}}\right)$$ 
Now the slope of $PQ$ is simply:
$$m_{PQ}=\frac{1}{2} \left(\frac{\sqrt{r^2-p^2}}{p+r}-\frac{r+s}{\sqrt{(r-s) (r+s)}}\right)$$
In order to ensure that $PQ$ is perpendicular to $AP$, the slopes of the respective lines must be the negative reciprocals of each other. The slope of $AD\to m_{AD}=\frac{\sqrt{r^2-p^2}}{p+r}$, therefore $m_{PQ}=-(m_{AD})^{-1}$:
$$\frac{1}{2} \left(\frac{\sqrt{r^2-p^2}}{p+r}-\frac{r+s}{\sqrt{(r-s) (r+s)}}\right)=-\frac{p+r}{\sqrt{r^2-p^2}}$$
For $s\geq \frac{7 r}{9}$, the equality is achieved when:
$$\left\{p\to \frac{1}{2} \left(\sqrt{-7 r^2+2 r s+9 s^2}-3 r+3 s\right)\right\}\tag{1}$$

Since $M$ is the midpoint between $BD$, then $M$ is (considering $t\to-r$):
$$M=\left(\frac{s+t}{2},\frac{f\left(s\right)-f\left(t\right)}{2}\right)$$
Therefore, the slope of $PM$ is:
$$m_{PM}=\frac{4 r \sqrt{r^2-p^2}+(s-3 p) \sqrt{(r-s) (r+s)}}{-3 s (p+r)+r (5 p+4 r)+s^2}$$
Meanwhile, the slope of $AB$ is:
$$m_{AB}=\frac{\sqrt{r^2-p^2}-\sqrt{r^2-s^2}}{p-s}$$

Thus, given $p$ from $(1)$, for $s\geq\frac{7r}9$ and $r \in \Bbb R^+$, $m_{AB}\cdot m_{PM}=-1$. 
$\therefore$ $PM \perp AB$


The proof is by no means rigorous or neat. Maybe you can prove it by showing the triangle formed by $Q$, the intersection between $PM$ and $CD$, and $PM$ and $AB$ is an inscribed triangle in a semicircle, invoking Thales' theorem.
You can use this Desmos implementation.
