Wish to evaluate $\int_{0}^{1}\frac{x^4-3x^2+2x}{\sin(\pi x)} dx$ We want to evaluate this integral,$\newcommand{\cosec}{\operatorname{cosec}}$
$$\int_{0}^{1}\frac{x^4-3x^2+2x}{\sin(\pi x)}\mathrm dx\tag1$$
$$\int_{0}^{1}[x^4\cosec(\pi x)-3x^2\cosec(\pi x)+2x\cosec(\pi x)]\mathrm dx$$
Apply integration by parts, first part:
$$\int x^4\cosec(\pi x)\mathrm dx=-\frac{x^4}{\pi}\ln[\cot(\pi x/2)]-\frac{4}{\pi}\int x^3\ln[\cot(\pi x/2)]\mathrm dx$$ again we apply integration by parts to this remaining integral,
$$\int x^3\ln[\cot(\pi x/2)]\mathrm dx$$
Integrate this part it is very difficult $\int \ln[\cot(\pi x/2)]\mathrm dx$
I am stuck at this point. I guess there must be another method to deal with this integral $(1)$.
I am looking forward to see how you would go about to evaluates $(1)$
 A: Here is a reasonably nice way:

Claim:
  \begin{align*}
\int_0^1 x^{n-2}\frac{x^2-x}{\sin\pi x}\,\mathrm{d}x
&=
\begin{cases}
93\frac{\zeta(5)}{\pi^5}-21\frac{\zeta(3)}{\pi^3} & n=4\\
-\frac72\frac{\zeta(3)}{\pi^3} & n=3\\
-7\frac{\zeta(3)}{\pi^3} & n=2
\end{cases}.
\end{align*}

Proof (sketch):
Define
$$
f_n(a):=\int_0^1 x^n e^{ax}\,\mathrm{d}x=\frac{\mathrm{d}^n}{\mathrm{d}a^n}\left(\frac{e^a-1}{a}\right)
$$
so
$$
\label{eq:fn1}
f_n(a)=
\begin{cases}
\frac{1+e^a(a-1)}{a^2}&n=1\\
\frac{-2+e^a(a^2-2a+2)}{a^3}&n=2\\
\frac{6+e^a(a^3-3a+6a-6)}{a^4}&n=3\\
\frac{-24+e^a(a^4-4a^3+12a^2-24a+24)}{a^5}&n=4
\end{cases}\tag{2}
$$
Hence
\begin{align*}
I_n&:=\int_0^1 x^{n-2}\frac{x^2-x}{\sin\pi x}\,\mathrm{d}x\\
&=2i\int_0^1 x^{n-2}\frac{x^2-x}{e^{i\pi x}-e^{-i\pi x}}\,\mathrm{d}x\\
&=2i\int_0^1 (x^n-x^{n-1})\sum_{k=0}^\infty e^{-i(2k+1)\pi x}\,\mathrm{d}x\\
&=2i\sum_{k=0}^\infty f_n(-i(2k+1)\pi)-f_{n-1}(-i(2k+1)\pi)\\
\end{align*}
and simplify using \eqref{eq:fn1}, noting $e^{i\pi(2k+1)}=-1$ and
$$
\sum_{k=0}^\infty\frac{1}{(2k+1)^n}=\left(1-\frac1{2^n}\right)\zeta(n).\qquad\square
$$
Now take suitable linear combinations to finish off.

The motivation behind using $\frac{x^2-x}{\sin\pi x}$ is to make sure the integrand stays finite at $x=0,1$ so we don't have to worry about convergence issues.
A: you are on the right track. apply integration part to your whole integral like you did to one part to get
$$\int_0^1 (x^4-3x^2+2x)\csc(x) \text{dx}= -\dfrac{(x^4-3x^2+2x)}{\pi}\ln(\cot(\pi x/2))|_0^1+\dfrac{1}{\pi}\int_0^1 (4x^3-6x+2)\ln(\cot(\pi x/2))\text{dx}\\=
\dfrac{4}{\pi} \int_0^1 x^3\ln(\cot(\pi x/2)) \text{dx}-\dfrac{6}{\pi} \int_0^1 x\ln(\cot(\pi x/2)) \text{dx}+\dfrac{2}{\pi} \int_0^1 \ln(\cot(\pi x/2)) \text{dx}$$
 the way to solve the integrals would be to use the fourier series
$$\ln(2\sin(x)) = -\sum_{n=1}^\infty \dfrac{\cos(2nx)}{n} \to \ln(2\cos(x))=-\sum_{n=1}^\infty \dfrac{\cos(2n(\pi/2-x))}{n} =-\sum_{n=1}^\infty \dfrac{(-1)^n\cos(2nx)}{n}$$
by subtracting the two, we get a series for the log of cotangent:
$$\ln(\cot(x))= \sum_{n=1}^\infty \dfrac{2\cos((4n-2)x)}{2n-1}\to \ln(\cot(\pi x/2))=\sum_{n=1}^\infty \dfrac{2\cos((2n-1)\pi x)}{2n-1} $$
by plugging in the series the integral will be
$$\sum_{n=1}^\infty \dfrac{4}{\pi (2n-1)} \left(2\int_0^1 x^3\cos((2n-1) \pi x)\text{dx}-3\int_0^1 x\cos((2n-1) \pi x)\text{dx}+2\int_0^1 \cos((2n-1) \pi x)\text{dx} \right) $$
by using integration by parts(or directly integrating) we can conclude the following
$$ \int_0^1 \cos((2n-1) \pi x)\text{dx}=0\\
\int_0^1 x\cos((2n-1) \pi x)\text{dx} = \dfrac{-2}{\pi^2 (2n-1)^2}\\
\int_0^1 x^3\cos((2n-1) \pi x)\text{dx} = \dfrac{12}{\pi^4(2n-1)^4}-\dfrac{3}{\pi^2(2n-1)^2}$$
i will leave it as an exercise to the user to prove these.
this means the total integral which is
$$\sum_{n=1}^\infty \dfrac{4}{\pi (2n-1)} \left(2\left(\dfrac{12}{\pi^4(2n-1)^4}-\dfrac{3}{\pi^2(2n-1)^2}\right)-3\left(\dfrac{-2}{\pi^2 (2n-1)^2}\right) +2\left(0\right) \right)\\
=\sum_{n=1}^\infty \dfrac{96}{\pi^5 (2n-1)^5} = \dfrac{96}{\pi^5} \zeta(5)\left(1-\dfrac{1}{2^5}\right)=\boxed{\dfrac{93}{\pi^5}\zeta(5)} $$
A: Too long for comments.
@user10354138 provided a very nice solution for the problem.
Since similar questions would probably happen, I tabulated the expressions of
$$I_n=\int_0^1 x^{n-2}\,\frac{x^2-x}{\sin(\pi x)}\,dx$$
$$\left(
\begin{array}{cc}
n & I_n \\
 2 & -\frac{7 \zeta (3)}{\pi ^3} \\
 3 & -\frac{7 \zeta (3)}{2 \pi ^3} \\
 4 & -\frac{21 \zeta (3)}{2 \pi ^3}+\frac{93 \zeta (5)}{\pi ^5} \\
 5 & -\frac{14 \zeta (3)}{\pi ^3}+\frac{279 \zeta (5)}{2 \pi ^5} \\
 6 & -\frac{35 \zeta (3)}{2 \pi ^3}+\frac{465 \zeta (5)}{\pi ^5}-\frac{5715 \zeta
   (7)}{2 \pi ^7} \\
 7 & -\frac{21 \zeta (3)}{\pi ^3}+\frac{930 \zeta (5)}{\pi ^5}-\frac{28575 \zeta
   (7)}{4 \pi ^7} \\
 8 & -\frac{49 \zeta (3)}{2 \pi ^3}+\frac{3255 \zeta (5)}{2 \pi ^5}-\frac{120015
   \zeta (7)}{4 \pi ^7}+\frac{160965 \zeta (9)}{\pi ^9} \\
 9 & -\frac{28 \zeta (3)}{\pi ^3}+\frac{2604 \zeta (5)}{\pi ^5}-\frac{80010 \zeta
   (7)}{\pi ^7}+\frac{1126755 \zeta (9)}{2 \pi ^9} \\
 10 & -\frac{63 \zeta (3)}{2 \pi ^3}+\frac{3906 \zeta (5)}{\pi ^5}-\frac{360045
   \zeta (7)}{2 \pi ^7}+\frac{2897370 \zeta (9)}{\pi ^9}-\frac{29016225 \zeta
   (11)}{2 \pi ^{11}}
\end{array}
\right)$$
and we see how linear combinations of the $I_n$'s can lead to nice simplifications by cancellations.
