In triangle $ABC$, $AP$ is the angle bisector In triangle $ABC$, $AP$ is the angle bisector of $\measuredangle A$. If $BP=16,CP=20$ and the center of the circumcircle of $\triangle ABP$ lies on $AC$, find $AB$ and $AC$.

$AP$ is the angle bisector of $\measuredangle BAC$ which means that $\measuredangle BAP=\measuredangle CAP=\alpha$. On the other hand, $OA=OP=R_{\triangle ABP}=R$, so $\measuredangle PAO=\measuredangle APO=\alpha$. This makes $OP\parallel AB$. I am trying to figure out the best way to use that parallelity.
The most straightforward think we can note is $\triangle OPC\sim\triangle ABC$. I don't see if this can be helpful, though.
Another true thing is $\dfrac{BP}{PC}=\dfrac{AB}{AC}=\dfrac{16}{20}=\dfrac{4}{5}$.

Let $AB =  4x, AC = 5x$ from the angle bisector theorem. Using the cosine rule on $\Delta ABC$, $36^2 = (4x)^2 + (5x)^2 - 2(4x)(5x) \cos 2a$ $ = x^2 (41 - 40 \cos 2a)$.
Now $\angle AOP = 180º - 2a$, so the reflex angle at the centre is twice the angle at the circumference, or $\angle ABP = \frac{1}{2}(360º - (180º - 2a)) = 90º + a$. Using the sine rule:
$$\frac{\sin(90º + a)}{5x} = \frac{\sin 2a}{36}$$
$$36 \cos a = 5x \cdot 2 \sin a \cos a, \ 18 = 5x \sin a.$$
Substituting this  value of $x$ gives:
$$36^2 = \frac{18^2}{25 \sin^2 a} (41 - 40 \cos 2a)$$
$$100 \sin^2 a = 41 - 40(2 \cos^2 a - 1)$$
$$100 - 100 \cos^2 a = 81 - 80 \cos^2 a$$
$$19 = 20 \cos^2 a$$
thus $\cos 2a = 2 \cos^2 a - 1 = \frac{9}{10}$ and $x^2 = \frac{36^2}{41 - 40 (9/10)} = \frac{36^2}{5}, x = \frac{36}{\sqrt5}$. Hence $AB = 4x = \frac{144}{\sqrt5}$, $AC = 5x = 36 \sqrt{5}$.
