Problem #4 solution
Let midpoint of $AB$ be $O$.
In right triangle $PON$ we have $ON = \dfrac{PN}{\tan\phi}$
In right triangle $PAN$ we have $AN = \dfrac{PN}{\tan\theta}$
Finally in right triangle $AON$ apply pythagoras : $$\begin{align} &OA^2+ON^2 = AN^2\\\ &a^2+\dfrac{PN^2}{\tan^2\phi} = \dfrac{PN^2}{\tan^2\theta}\\\ \end{align}$$
Isolate $PN$ and simplify.
![enter image description here](