Integral of $\cot^2 x$? How do you find $\int \cot^2 x \, dx$? Please keep this at a calc AB level. Thanks! 
 A: $$\int \cot^2(x) \, dx = \int (\csc^2(x) - 1) \, dx = \int \csc^2(x) \, dx - x +\text{const}$$
\begin{align}
\int \csc^2(x) \, dx & = \int \dfrac{dx}{\sin^2(x)}\\
& = \int \dfrac{\cos^2(x) + \sin^2(x)}{\sin^2(x)} \, dx\\
& = \int \dfrac{\cos(x) \, d (\sin(x)) - \sin(x) \, d(\cos(x))}{\sin^2(x)}\\
& = -\int d\left(\dfrac{\cos(x)}{\sin(x)}\right) = -\cot(x)
\end{align}
Hence,
$$\int \cot^2(x) \, dx = \int (\csc^2(x) - 1) \, dx = -\cot(x) - x +\text{const}$$
A: Since the integrand $$\cot^2 x=\frac{\cos^2 x}{\sin^2 x}$$ is a rational fraction of $\sin x,\, \cos x$, you could use a universal standard substitution  called the Weirstrasse substitution
$$
\begin{equation*}
\tan \frac{x }{2}=t,\qquad x =2\arctan t,\qquad dx =\frac{2}{1+t^{2}}dt
\end{equation*},
$$
which converts the integrand into a rational function of $t$ whose evaluation is by partial fractions expansion. From the double-angle formulas and the identity $\cos ^{2}\frac{x}{2}+\sin ^{2}\frac{x}{2}=1$ we get:
$$
\begin{eqnarray*}
\cos x &=&\cos \left(2\cdot\frac{x}{2}\right)=\cos ^{2}\frac{x}{2}-\sin ^{2}\frac{x}{2}=\frac{\frac{\cos ^{2}
\frac{x}{2}-\sin ^{2}\frac{x}{2}}{\cos ^{2}\frac{x}{2}}}{\frac{\cos ^{2}
\frac{x}{2}+\sin ^{2}\frac{x}{2}}{\cos ^{2}\frac{x}{2}}}=\frac{1-\tan ^{2}
\frac{x}{2}}{1+\tan ^{2}\frac{x}{2}}=\frac{1-t^2}{1+t^2}, \\
&& \\
\sin x &=&\sin \left(2\cdot\frac{x}{2}\right)=2\sin \frac{x}{2}\cos \frac{x}{2}=\frac{\frac{2\sin \frac{x}{2}
\cos \frac{x}{2}}{\cos ^{2}\frac{x}{2}}}{\frac{\cos ^{2}\frac{x}{2}+\sin ^{2}
\frac{x}{2}}{\cos ^{2}\frac{x}{2}}}=\frac{2\tan \frac{x}{2}}{1+\tan ^{2}
\frac{x}{2}}=\frac{2t}{1+t^2}.
\end{eqnarray*}
$$
Then
$$
\begin{eqnarray*}
\int \cot ^{2}xdx &=&\int \frac{\left( t^{2}-1\right) ^{2}}{2t^{2}\left(
1+t^{2}\right) }\,dt=\int \frac{1}{2}+\frac{1}{2t^{2}}-\frac{2}{1+t^{2}}dt \\
&=&\frac{1}{2}t-\frac{1}{2t}-2\arctan t+C \\
&=&\frac{1}{2}\tan \frac{x}{2}-\frac{1}{2\tan \frac{x}{2}}+C \\
&=&-\cot x+C,
\end{eqnarray*}
$$
because
$$
\begin{equation*}
\cot x=\frac{\cot ^{2}\frac{x}{2}-1}{2\cot \frac{x}{2}}=\frac{1}{2}\cot 
\frac{x}{2}-\frac{1}{2\cot \frac{x}{2}}=\frac{1}{2\tan \frac{x}{2}}-\frac{1}{2}\tan \frac{x}{2}.
\end{equation*}$$
A: We use the identity: $$\cot x = \pm \sqrt{\csc^2 x - 1} \implies \cot^2 x = \csc^2 x - 1$$
So we can rewrite the integral as follows:
$$\int \cot^2 x \,dx = \int \left(\csc^2x - 1\right)\, dx$$
$$ \int \left(\csc^2x - 1\right) dx \; = \; \int \csc^2 x \, dx\; -\; \int \,dx  \;\;= \;\;-\cot x - x + \text{constant}$$
Recall, $$\dfrac{d}{dx}\left(\cot x\right) = - \csc^2 x$$ hence $$\int \csc^2 x \,dx = -\cot x + C$$
