How can I rearrange a formula containing both cot and cosec? I want to rearrange the following:
$$\cot{\theta}-\csc{\theta}=\dfrac{2B\mu}{bmg}$$
to get $\theta$.
I am unsure how to reduce a cot and cosec sum. Are there any maths tricks or identities that I am missing?

$$\cot\theta - \csc \theta = k$$
$$\cot\theta \pm \sqrt{\cot^2 \theta+1} = k$$
$$\pm \sqrt{\cot^2 \theta+1} = k-\cot\theta$$
$$\cot^2 \theta+1 = (k-\cot\theta)^2$$
$$\cot^2 \theta+1 = k^2-2k\cot\theta+\cot^2\theta$$
$$1 = k^2-2k\cot\theta$$
$$\cot\theta = \frac{k^2-1}{2k}$$
