Evaluate the integrals $\int \sin{x} \cot^2{x} \,dx$ and $\int \cos{x} \cot^2{x} \,dx$. Can you please show how to evaluate the integrals $$\int \sin{x} \cot^2{x} \,dx$$ and $$\int \cos{x} \cot^2{x} \,dx.$$
I know that $\cot x=\dfrac{\cos x}{\sin x}$, which can simplify the integrands a bit. 
$$\sin x\cot^2x = \frac{\cos^2x}{\sin x}\\
\cos x\cot^2x = \frac{\cos^3x}{\sin^2 x}$$
But I still do not know where to continue from there.
 A: Hint :
\begin{align}
\int\sin x\cot^2x\ dx&=\int\sin x\cdot\frac{\cos^2x}{\sin^2x}\ dx\\
&=\int\frac{\cos^2x}{\sin x}\ dx\\
&=\int\frac{1-\sin^2x}{\sin x}\ dx\\
&=\int \frac1{\sin x}\ dx-\int\sin x\ dx\\
&=\color{red}{\int \frac{\sin x}{1-\cos^2 x}\ dx}-\int\sin x\ dx\tag1
\end{align}
and
\begin{align}
\int\cos x\cot^2x\ dx&=\int\cos x\cdot\frac{\cos^2x}{\sin^2x}\ dx\\
&=\int\cos x\cdot\frac{1-\sin^2x}{\sin^2x}\ dx\tag2
\end{align}
For $(1)$ take substitution $\color{red}{u=\cos x}$ and for $(2)$ take substitution $v=\sin x$.
A: HINT:
$$\sin x\cot^2x=\frac{\cos^2x}{\sin x}=\frac{1-\sin^2x}{\sin x}=\csc x-\sin x$$
$$\cos x\cot^2x=\frac{\cos^3x}{\sin^2x}=\frac{\cos^3x-\cos x+\cos x}{1-\cos^2x}=-\cos x+\frac{\cos x}{\sin^2x}$$
A: $$\int \sin{x} \cot^2{x} \,dx = \int \sin{x} \frac{\cos^2{x}}{\sin^2x} \,dx = \int \ \frac{\sin x - \sin^3x}{\sin^2x} \,dx = \int  -\sin{x}dx + \int \frac{1}{\sin x}dx = \cos(x)- 0.5 \cdot \ln  \left|   \frac{1+\cos x}{1-\cos x}\right| +c $$
Note that integrating $\int\frac{1}{\sin x} dx$ is based on a process much similar to what is shown here: http://en.wikipedia.org/wiki/Integral_of_the_secant_function
as for your second integral it can be rewritten as $$\int \frac{\cos x}{\sin^2x} -\cos xdx$$
which is relatively easy only that $$\int \frac{\cos x}{\sin^2x}dx $$ should be evaluated using substitution so that $\sin x = u, \cos xdx=du$ from where it should be fairly simple...
hope this helps!
A: Hint:-
For the first integral,
$$\displaystyle\int\sin x\cot^2 x\ dx=\displaystyle\int\sin x\csc^2 x\ dx-\displaystyle\int\sin x\ dx=\displaystyle\int\csc x\ dx-\displaystyle\int\sin x\ dx$$
For the second, $\displaystyle\int\cos x\cot^2 x\ dx$ use Integration by Parts assuming $\cos x=u$ and $\cot^2 x=v$.
