This is the same as sinθ/cos²θ=p, sinθ=pcos²θ=p(1-sin²θ).
Let s=sinθ, then s=p(1-s²), ps²+s-p=0.
This quadratic can be solved using the formula: s=(-1±√(1+4p²))/(2p).
cosθ=√(1-s²)=√(1-(1+1+4p²±2√(1+4p²))/(4p²)).
cosθ=√(4p²-(2+4p²±2√(1+4p²)))/(2p)
cosθ=√(-2±2√(1+4p²))/(2p).
cosθ=√(2√(1+4p²)-2)/(2p) is the only real (non-complex) solution.