<s>[INST] If $\sec x=\frac{a}{b}$, find the exact value of $\cot x-\frac1{\sin x}$, for positive $a$ and $b$, and for $x\in(\frac{3\pi}{2},2\pi)$ 
If $\sec(x) = \frac{a}{b}$, find the exact value of
$$\cot(x) - \frac{1}{\sin(x)}$$ and $a$, $b$ are positive real values and $x\in(\frac{3\pi}{2},2\pi)$


*

*I know that $\sec(x) = \frac{1}{\cos(x)}, $ so:  $\cos(x) = \frac{b}{a}$

*I used the right angled triangle to find the third side, which is $\sqrt{a^2-b^2}$

*I used reciprocal functions of $\tan$ and $\sin$ to obtain the values:

$cosec(x) = \frac{a}{(\sqrt{a^2-b^2})}$ and $\cot(x) = \frac{b}{\sqrt{a^2-b^2}}$
and finally getting $\frac{(b-a)}{\sqrt{a^2-b^2}}$ as my answer. But that is not correct.
The correct answer is: $\frac{\sqrt{a^2-b^2}}{a+b}$. Now I am wondering how.
 [/INST] $$\cos x=\frac ba$$
$$\frac 1{\sin x}=\frac 1 {\sqrt{1-\frac{b^2}{a^2}}}=\frac a{\sqrt {a^2-b^2}}$$
$$\cot (x) =\frac {\cos x}{\sin x}=\frac{\frac ba}{\frac{\sqrt{a^2-b^2}}a}=\frac b{\sqrt {a^2-b^2}}$$
$\Rightarrow$ $$\cot (x)-\frac 1{\sin x}=\frac {a-b}{\sqrt{a^2-b^2}}$$
Multiplying numerator and denominator by $\sqrt{a^2-b^2=(a-b)(a+b)}$ we get:
$$\cot (x)-\frac 1{\sin x}=\frac {\sqrt{a^2-b^2}}{a+b}$$
</s>