If $\csc\theta = \sqrt{\frac{p+q}{p-q}}$ where $p>q>0$, then $|\cot (\frac{\pi}{4} + \frac{\theta}{2})|$ is equal to:
What I have tried:
Since, $$\cot (\frac{\pi}{4} +\frac{\theta}{2}) = \sqrt{\frac{1+\cos (\frac{\pi}{2} +\theta)}{1-\cos (\frac{\pi}{2} +\theta)}}$$ $$= \sqrt{\frac{1-\sin \theta}{1 + \sin \theta}}$$ $$= \sqrt {\frac{1-\frac{p-q}{p+q}}{1+\frac{p-q}{p+q}}}$$ $$=\sqrt{\frac{q}{p}}$$
This is what I got but the answer is $\sqrt{\frac{p}{q}}$. I don't where I have done wrong. Please help! Thank you!
I think the radicand must be $$\sqrt{\frac{1-\sqrt{\frac{p-q}{p+q}}}{1+\sqrt{\frac{p-q}{p+q}}}}$$