MATH

Here, $P(x)=\cot x$ and $Q(x)=\cos x$

IF MATH

Now MATH

Apply the formula:

MATH

MATH

The integral needs a simple substitution: u = sin x, du = cos x dx

MATH

Divide throughout by sin x:

MATH