Evaluate the integral $\int_{\pi/4}^{3\pi/4} x \cdot \cot(x) \cdot \csc(x) \mathop{dx}$ $$  \int_{\pi/4}^{3\pi/4}  x \cdot \cot(x) \cdot \csc(x) \mathop{dx}
$$
Some working
Evaluate the indefinite integral first
Let $u = \csc(x)$ , then $\frac{du}{- \csc(x) \cdot \cot(x)} = dx$, and
$\csc^{-1} u = x$
This gives
\begin{equation*}
  \begin{aligned}
    \int x \cdot \frac{\cot(x) \cdot \csc(x) }{\cot(x) \cdot \csc(x)} \cdot (-1) \mathop{du}
    &= 
    \int \csc^{-1} (u) (-1) \mathop{du}
    \\
    &= 
    - \int \csc^{-1} (u)  \mathop{du}
  \end{aligned}
\end{equation*}
Then using integration by parts
\begin{equation*}
  \begin{aligned}
    - \int \csc^{-1} (u)  \mathop{du}
    &=
    - \left(
      u \cdot \csc^{-1}(u) - \int u \cdot \frac{1}{u \sqrt{u^2 - 1}}
    \right)
    \\
    &=
    - u \cdot \csc^{-1}(u) + \int u \cdot \frac{1}{u \sqrt{u^2 - 1}}
    \\
    &=
    - u \cdot \csc^{-1}(u) + \int  \frac{1}{\sqrt{u^2 - 1}}
  \end{aligned}
\end{equation*}
For the integral $\int  \frac{1}{\sqrt{u^2 - 1}}$  let $k = u^2$, then
$\frac{dk}{2u} = du$ 
\begin{equation*}
  \begin{aligned}
    \int \frac{1}{\sqrt{ u^2 - 1}} &=
    \int \frac{1}{\sqrt{k - 1}}  \cdot \frac{1}{2 \sqrt{k}} \mathop{dk}
    \\
    &=
    \frac{1}{2}
    \int \frac{1}{ \sqrt{ k}  \sqrt{k - 1}} \mathop{dk}
    \\
    &=
    \frac{1}{2} \sec^{-1} \left( \sqrt{ k}  \right)
    \\
    &=
    \frac{1}{2} \sec^{-1} \left( u \right)
  \end{aligned}
\end{equation*}
.
.
.
I'm not sure what's going wrong - the rest of the working is messy, and I can't seem to find the error by checking or using CAS. 

HINT:
Integrate by parts with $u=x$ and $v=-\csc(x)$.  This yields
$$\int_{\pi/4}^{3\pi/4} x\cot(x)\csc(x)\,dx= \left.\left (-x\csc(x)\right)\right|_{\pi/4}^{3\pi/4}+\int_{\pi/4}^{3\pi/4}\csc(x)\,dx$$
Can you finish?
