For quadratic expressions of the form
\[
ax^2+bx+c,
\]
find two numbers whose product is \(ac\) and whose sum is \(b\). Then use factorization by grouping.
Step 1: Treat \(\cot\theta\) as a variable and factor directly. Let \(u = \cot\theta\). Factor \(2u^2 - u - 3\): find two numbers with product \(2(-3)=-6\) and sum \(-1\): these are \(-3\) and \(2\). So \(2u^2 - u - 3 = 2u^2 - 3u + 2u - 3 = u(2u-3)+1(2u-3) = (2u-3)(u+1)\).