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)$
Here is a reasonably nice way:
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.