$\sec\theta+\tan\theta=p$ and $\sec\theta\tan\theta=q$. Eliminate $\theta$ to form a equation between $p$ and $q$. $\sec\theta+\tan\theta=p$ and $\sec\theta\tan\theta=q$. Eliminate $\theta$ to form a equation between $p$ and $q$.

$\sec\theta+\tan\theta=p$
$(\sec\theta+\tan\theta)^2=p^2$
$\sec^2\theta+\tan^2\theta+2\tan\theta\sec\theta=p^2$
$\sec^2\theta+\tan^2\theta+2q=p^2$
$1+2\tan^2\theta+2q=p^2$
I am stuck here. Please help me. Thanks.
 A: Notice, we have $$\sec\theta+\tan\theta=p\tag 1$$
 $$\sec\theta\tan\theta=q\tag 2$$
$$(\sec\theta-\tan\theta)^2=(\sec\theta+\tan\theta)^2-4\sec\theta\tan\theta$$
$$(\sec\theta-\tan\theta)^2=p^2-4q$$
$$\sec\theta-\tan\theta=\sqrt{p^2-4q}\tag 3$$
adding (1) & (3), $$2\sec\theta=p+\sqrt{p^2-4q}\tag 4$$
& subtracting (3)from (1), $$2\tan\theta=p-\sqrt{p^2-4q}\tag 5$$
Now, squaring & subtracting (5) from (4), one should have 
$$4\sec^2\theta-4\tan^2\theta=\left(p+\sqrt{p^2-4q}\right)^2-\left(p-\sqrt{p^2-4q}\right)^2$$ 
$$4(\sec^2\theta-\tan^2\theta)=\left(p+\sqrt{p^2-4q}+p-\sqrt{p^2-4q}\right)\left(p+\sqrt{p^2-4q}-p+\sqrt{p^2-4q}\right)$$ 
$$4(1)=\left(2p\right)\left(2\sqrt{p^2-4q}\right)$$ 
$$p\sqrt{p^2-4q}=1$$
$$\color{red}{p^2(p^2-4q)=1}$$
A: $$\sec\theta+\tan\theta=p\iff\sec\theta-\tan\theta=\dfrac1p$$
Now $(\sec\theta+\tan\theta)^2-(\sec\theta-\tan\theta)^2=4\sec\theta\tan\theta$
Replace the values of $\sec\theta+\tan\theta,\sec\theta-\tan\theta, \sec\theta\tan\theta$
A: Notice that
$$p^2-4q=(\sec\theta-\tan\theta)^2\;.$$
Now $p^2=(\sec\theta+\tan\theta)^2$, so
$$p^2(p^2-4q)=(\sec\theta+\tan\theta)^2(\sec\theta-\tan\theta)^2=(\sec^2\theta-\tan^2\theta)^2=1\;.$$
This probably seems a bit like magic. I actually first noticed that $p^2-2q=\sec^2\theta+\tan^2\theta$. Unfortunately, that didn’t seem to go anywhere. Then I noticed that subtracting another $2q$ would still give me something fairly nice, and the rest just fell into place.
A: Now, $\sec^2\theta \tan^2\theta=q^2$. 
So, $(1+\tan^2\theta)\tan^2\theta=q^2$. 
You have got that $1+2\tan^2\theta+2q=p^2$. 
So, $\tan^2\theta=\frac{p^2-1-2q}{2}$. 
Now plug in this $\tan^2\theta$ in the equation got above.
