Given a right angled triangle ABC, where AP is the median and Q is a point on AB then find AQ in terms of given. 
Problem: In a triangle $ABC$, right angled at $B$, $AP$ is the median. $Q$ is a point taken on side $AB$ such that $\angle ACQ =\alpha $ and $\angle APQ =\beta $ and let $CP = BP = x$, Find $AQ$ in terms of the given parameters. 

What I have tried is draw perpendiculars from $Q$ on $AC$ and on $AP$ to get some trigonometry going but I am unable to proceed so I graphed it on the coordinate plane but I'm unable to proceed there too. So I looked at the options (its a multiple choice) and all of them seem to include $\cot \alpha$  and $\cot \beta$.
Rough Figure: 

Edit: Thanks for the help everyone. Also, I am sorry to learn that I forgot to mention that I had assumed the distance $|AB|$ and it isn't given in the question itself. 



Given $\angle QCA=\phi$, $\angle QPA=\psi$ and $x=|BP|=|CP|$,  find
  $c=|AB|$ and $q=|AQ|$.

Let $|AC|=b,\ |AP|=u,\ |CQ|=v,\ |PQ|=w$.
\begin{align} 
b^2&=4\,x^2+c^2
,\quad
v^2=4\,x^2+(c-q)^2
,\\
u^2&=\phantom{4\,}x^2+c^2
,\quad
w^2=\phantom{4\,}x^2+(c-q)^2
,\\
b^2-u^2&=
v^2-w^2=3\,x^2
,\\
b^2-v^2&=u^2-w^2
=2\,c\,q-q^2
.
\end{align}
Considering squared areas of $\triangle CAQ$
$\triangle PAQ$, which share the same base $|AQ|=q$
and $h_{CAQ}=2h_{PAQ}$, we have
\begin{align} 
v^2\,b^2\,\sin^2\phi
&=
4\,u^2\,w^2\,\sin^2\psi
\tag{1}\label{1}
.
\end{align}
\begin{align} 
\triangle CAQ:\quad
2\,x\,q&=
b\,v\,\sin\phi
\tag{2}\label{2}
,\\
\triangle PAQ:\quad
\phantom{2\,}x\,q&=
u\,w\,\sin\psi
\tag{3}\label{3}
,\\
u\,w&=
b\,v\,\frac{\sin\phi}{2\,\sin\psi}
\tag{4}\label{4}
.
\end{align}
By cosine rule
\begin{align} 
\triangle CAQ:\quad
q^2&=
b^2+v^2-2\,b\,v\,\cos\phi
\tag{5}\label{5}
,\\
\triangle CAQ:\quad
q^2&=
u^2+w^2-2\,u\,w\,\cos\psi
\tag{6a}\label{6a}
\\
&=u^2+w^2-b\,v\,\sin\phi\,\cot\psi
\tag{6b}\label{6b}
,\\
b\,v&=
\frac{b^2+v^2-u^2-w^2}{2\,\cos\phi-\sin\phi\cot\psi}
\tag{7}\label{7}
,\\
b\,v&= \frac{6\,x^2}{2\,\cos\phi-\sin\phi\cot\psi}
\tag{8}\label{8}
,\\
u\,w&=
\frac{3\,x^2}{2\,\sin\psi\,\cot\phi-\cos\psi}
\tag{9}\label{9}
.
\end{align}
From $\triangle PAQ$
\begin{align} 
2\,x\,q&=
b\,v\sin\phi
\tag{10}\label{10}
,\\
q&=\frac{b\,v\sin\phi}{2\,x}
=
\frac{3\,x\,\sin\phi}{2\,\cos\phi-\sin\phi\cot\psi}
=
\frac{3\,x}{2\,\cot\phi-\cot\psi}
\tag{11}\label{11}
.
\end{align}
\begin{align} 
b^2+v^2&=
q^2+2\,b\,v\,\cos\phi
\tag{12}\label{12}
,\\
b^2+v^2&=
q^2
+\frac{12\,x^2}{2\cos\phi-\sin\phi\cot\psi}
\tag{13}\label{13}
\end{align}
Substitution of \eqref{1} gives a quadratic equation in $c$:
\begin{align} 
c^2-q\,c+4\,x^2-\frac{6\,x^2\,\cos\phi}{2\,\cos\phi-\sin\phi\cot\psi}
&=0
\tag{14}\label{14}
,\\
c^2-q\,c+\tfrac23\,q\,x\,(\cot\phi-2\,\cot\psi)&=0
\tag{15}\label{15}
\end{align}
with a suitable root
\begin{align} 
c&=\frac{q}{2}\,\left(1
+\sqrt{1-\frac{8\,x}{3\,q}\,(\cot\phi-2\,\cot\psi)}
\right)
\tag{16}\label{16}
,\\
c&=\frac x2\cdot\frac{3+\sqrt{9+8\,\cot\phi\cot\psi-16\,(\cot\phi-\cot\psi)^2}}
{2\,\cot\phi-\cot\psi}
\tag{17}\label{17}
.
\end{align}
