Use trigonometric identities and (if necessary) $u$ -substitution to integrate the function.
$$
\begin{array}{l}{\text { (a) } \int \frac{1}{\csc x} d x=} \\ {\text { (b) } \int \frac{1}{\cos ^{2} x} d x=}\end{array}
\begin{array}{l}{\text { (c) } \int\left(\cot ^{2} x+1\right) d x=} \\ {\text { (d) } \int \frac{1}{\sec x+\tan x} d x=}\end{array}
$$