Evaluating $\int_0^1 \frac{x-x^2}{\sin \pi x} dx = \frac{7 \zeta(3)}{\pi^3}.$
I tried to use the series for $\sin \pi x$ and maybe find something related to $\zeta(3)$, but didn't work. I'm guessing this integral needs more than the little calculus that I know. \begin{equation} \int_0^1 \frac{x-x^2}{\sin \pi x} dx = \frac{7 \zeta(3)}{\pi^3}. \end{equation}
Solution 1:
First, denote the integral below as $I$$$I=\int\limits_0^1dx\space\frac {x(1-x)}{\sin\pi x}$$and through integration by parts on $u=x-x^2$, then we have
$$\begin{align*}I & =-\frac 1{\pi}(x-x^2)\log\cot\left(\frac {\pi x}2\right)\,\Biggr\rvert_0^1+\frac 1{\pi}\int\limits_0^1dx\, (1-2x)\log\cot\left(\frac {\pi x}2\right)\\ & =\frac 1{\pi}\int\limits_0^1dx\,\log\cot\left(\frac {\pi x}2\right)-\frac 2{\pi}\int\limits_0^1dx\, x\log\cot\left(\frac {\pi x}2\right)\\ & =-\frac 8{\pi^3}\int\limits_0^{\pi/2}dx\, x\log\cot x\tag1\end{align*}$$
where equation ($1$) comes from making the substitution $x\mapsto\frac {\pi x}2$. The latter integral can be evaluated by splitting up the natural log into two separate integrals and using the Fourier series for $\log\sin x$ and $\log\cos x$, which I have included below
$$\begin{align*}\log\cos x & =\sum\limits_{k\geq1}(-1)^{k-1}\frac {\cos2kx}{k}-\log 2\tag2\\\log\sin x & =-\sum\limits_{k\geq1}\frac {\cos 2kx}k-\log 2\tag3\end{align*}$$
Expanding ($1$) gives
$$I=-\frac 8{\pi^3}\underbrace{\int\limits_0^{\pi/2}dx\, x\log\cos x}_{I_1}+\frac 8{\pi^3}\underbrace{\int\limits_0^{\pi/2}dx\, x\log\sin x}_{I_2}\tag4$$
Call the first and second integrals $I_1$ and $I_2$ respectively. Using ($2$) and ($3$) gives the following two identities
$$\begin{align*}I_1 & =\int\limits_0^{\pi/2}dx\,\left(\sum\limits_{k\geq1}\frac {(-1)^{k-1}\cos 2kx}k-x\log 2\right)\\ & =\sum\limits_{k\geq1}\frac {(-1)^{k-1}}k\left[\frac {\pi}{4k^2}\sin\pi k+\frac 1{4k^3}\cos\pi k-\frac 1{4k^2}\right]-\frac {\pi^2}8\log2\\ & =\frac 14\sum\limits_{k\geq1}\frac {(-1)^{k-1}}{k^3}\cos\pi k-\frac 14\sum\limits_{k\geq1}\frac {(-1)^{k-1}}{k^3}-\frac {\pi^2}8\log 2\\ & \color{blue}{=-\frac 14\zeta(3)-\frac 3{16}\zeta(3)-\frac {\pi^2}8\log 2}\tag5\end{align*}$$
As a side note, the infinite sum with $\sin\pi k$ vanishes because $\sin\pi k=0$ for $k\in\mathbb{Z}$. In a similar manner, $I_2$ can be integrated as follows
$$\begin{align*}I_2 & =-\int\limits_0^{\pi/2}dx\,\left(\sum\limits_{k\geq1}\frac {\cos 2kx}k+x\log 2\right)\\ & =-\sum\limits_{k\geq1}\frac 1k\left[\frac {\pi}{4k}\sin\pi k+\frac 1{4k^2}\cos\pi k-\frac 1{4k^2}\right]-\frac {\pi^2}8\log 2\\ & =-\frac 14\sum\limits_{k\geq1}\frac {\cos\pi k}{k^3}+\frac 14\sum\limits_{k\geq1}\frac 1{k^3}-\frac {\pi^2}8\log 2\\ & \color{red}{=\frac 14\zeta(3)+\frac 3{16}\zeta(3)-\frac {\pi^2}8\log 2}\tag6\end{align*}$$
Substituting the results for ($5$) and ($6$) into ($4$) leaves us with
$$\begin{align*}I & =-\frac 8{\pi^3}\left[\color{blue}{-\frac 14\zeta(3)-\frac 3{16}\zeta(3)}\color{red}{-\frac 14\zeta(3)-\frac 3{16}\zeta(3)}\right]\\ & =\frac 7{\pi^3}\zeta(3)\end{align*}$$
Multiply by $-1$ to get the integral under question
$$\int\limits_0^1dx\space\frac {x^2-x}{\sin\pi x}\color{brown}{=-\frac 7{\pi^3}\zeta(3)}$$
Solution 2:
$\displaystyle f(a):=\int\limits_0^1 x e^{ax}dx = \frac{1+e^a(a-1)}{a^2}$
$\displaystyle g(a):=\int\limits_0^1 x^2 e^{ax}dx = \frac{-2+e^a(a^2-2a+2)}{a^3}$
$\displaystyle \int\limits_0^1 \frac{x^2-x}{\sin(\pi x)}dx = i2\int\limits_0^1\frac{x^2-x}{e^{i\pi x}-e^{-i\pi x}}dx = i2\sum\limits_{k=0}^\infty \int\limits_0^1 (x^2-x)e^{-i\pi x(2k+1)}dx $
$\displaystyle = i2\sum\limits_{k=0}^\infty (g(-i\pi(2k+1))-f(-i\pi(2k+1)))$
$\displaystyle = 2\sum\limits_{k=0}^\infty i\frac{-2+i\pi(2k+1) + e^{-i\pi(2k+1)}(2+i\pi(2k+1))}{(-i\pi(2k+1))^3} \enspace$ with $\enspace e^{-i\pi(2k+1)}=-1$
$\displaystyle = -8\sum\limits_{k=0}^\infty\frac{1}{(\pi(2k+1))^3}=-\frac{8}{\pi^3}(1-\frac{1}{2^3})\zeta(3)=-\frac{7\zeta(3)}{\pi^3}$
Solution 3:
Probably not an answer.
For the antiderivative $$I=2 \pi^3\int \frac{x^2-x}{\sin (\pi x)}\, dx$$ a CAS give the ugly $$I=-i \pi (2 x-1) \left(4 \text{Li}_2\left(e^{i \pi x}\right)-\text{Li}_2\left(e^{2 i \pi x}\right)\right)+8 \text{Li}_3\left(e^{i \pi x}\right)-\text{Li}_3\left(e^{2 i \pi x}\right)-$$ $$4 \pi ^2 (x-1) x \tanh ^{-1}\left(e^{i \pi x}\right)$$ $$\lim_{x\to 1} \, I=-7 \zeta (3)+i\frac{ \pi ^3}{2} \qquad \text{and} \qquad \lim_{x\to 0} \, I=7 \zeta (3)+i\frac{ \pi ^3}{2}$$
What is interesting is that a rather good approximation could be obtained using a $[2,2]$ Padé approximant built at $x=\frac 12$ making $$\frac{x^2-x}{\sin (\pi x)}=\frac{-\frac 14+ a(x-\frac 12)^2 }{1+ b(x-\frac 12)^2 }$$ where $$a=-\frac{384-48 \pi ^2+\pi ^4}{48 \left(\pi ^2-8\right)} \qquad \text{and} \qquad b=-\frac{5 \pi ^4-48 \pi ^2}{12 \left(\pi ^2-8\right)}$$ making the definite integral easy to solve (leading to a value of $\approx -0.271415$ while the exact value is $\approx -0.271377$).
Still more amazing (at least to me), the approximation $$\sin(y) \simeq \frac{16 (\pi -y) y}{5 \pi ^2-4 (\pi -y) y}\qquad (0\leq y\leq\pi)$$ proposed by Mahabhaskariya of Bhaskara I, a seventh-century Indian mathematician would lead to $-\frac{13}{48} \approx -0.270833$ .
Solution 4:
Following Frank W.,
$\begin{align} J&=\int_0^1 \frac{x^2-x}{\sin(\pi x)}\,dx\\ &=\frac 8{\pi^3}\int\limits_0^{\pi/2}x\log\cot x \,dx\end{align}$
Perform the change of variable $y=\tan x$,
$\begin{align}J&=-\frac 8{\pi^3}\int_0^{\infty}\frac{\ln x\arctan x}{1+x^2} \,dx\\ &=-\frac 8{\pi^3}\int_0^{1}\frac{\ln x\arctan x}{1+x^2} \,dx-\frac 8{\pi^3}\int_1^{\infty}\frac{\ln x\arctan x}{1+x^2} \,dx \\\end{align}$
In the second integral perform the change of variable $y=\dfrac{1}{x}$,
$\begin{align}J&=-\frac 8{\pi^3}\int_0^{1}\frac{\ln x\arctan x}{1+x^2} \,dx+\frac 8{\pi^3}\int_0^{1}\frac{\ln x\arctan\left( \frac{1}{x}\right)}{1+x^2} \,dx\\ &=-\frac 8{\pi^3}\int_0^{1}\frac{\ln x\arctan x}{1+x^2} \,dx+\frac 8{\pi^3}\int_0^{1}\frac{\left(\frac{\pi}{2}-\arctan x\right)\ln x}{1+x^2} \,dx\\ &-\frac {16}{\pi^3}\int_0^{1}\frac{\ln x\arctan x}{1+x^2} \,dx-\frac{4}{\pi^2}\text{G} \end{align}$
$\text{G}$ is the Catalan constant.
Let,
$\displaystyle K=\int_0^{1}\frac{\ln x\arctan x}{1+x^2} \,dx$
Define for $x\in [0;1]$,
$\begin{align}R(x)&=\int_0^x\frac{\ln t}{1+t^2}\,dt\\ &=\int_0^1 \frac{x\ln(xt)}{1+t^2x^2}\,dt \end{align}$
Observe that, $\displaystyle R(0)=0,R(1)=-\text{G}$.
Perform integration by parts,
$\begin{align}K&=\Big[R(x)\arctan x\Big]_0^1-\int_0^1 \frac{R(x)}{1+x^2}\,dx\\ &=-\frac{\pi}{4}\text{G}-\int_0^1 \int_0^1 \frac{x\ln(xt)}{(1+t^2x^2)(1+x^2)}\,dt\,dx \\ &=-\frac{\pi}{4}\text{G}-\int_0^1 \int_0^1 \frac{x\ln t}{(1+t^2x^2)(1+x^2)}\,dt\,dx-\int_0^1 \int_0^1 \frac{x\ln x}{(1+t^2x^2)(1+x^2)}\,dt\,dx\\ &=-\frac{\pi}{4}\text{G}-\frac{1}{2}\int_0^1 \left[\frac{\ln t}{1-t^2}\times \ln\left(\frac{1+x^2}{1+t^2x^2}\right)\right]_{x=0}^{x=1}\,dt-\int_0^1 \Big[\frac{\arctan(tx)\ln x}{1+x^2}\Big]_{t=0}^{t=1} \,dx\\ &=-\frac{\pi}{4}\text{G}-\frac{1}{2}\int_0^1 \frac{\ln\left( \frac{2}{1+t^2}\right)\ln t}{1-t^2}\,dt-K \end{align}$
Therefore,
$\begin{align} K&=-\frac{\pi}{8}\text{G}-\frac{1}{4}\int_0^1 \frac{\ln\left( \frac{2}{1+t^2}\right)\ln t}{1-t^2}\,dt\\ &=-\frac{\pi}{8}\text{G}-\frac{\ln 2}{4}\int_0^1 \frac{\ln t}{1-t^2}\,dt+\frac{1}{4}\int_0^1 \frac{\ln(1+t^2)\ln t}{1-t^2}\,dt \end{align}$
Let,
$\displaystyle L=\int_0^1 \frac{\ln(1+t^2)\ln t}{1-t^2}\,dt$
For $x\in [0;1]$ define,
$\begin{align}S(x)&=\int_0^x\frac{\ln t}{1-t^2}\,dt\\ &=\int_0^1 \frac{x\ln(tx)}{1-t^2x^2}\,dt \end{align}$
Perform integration by parts,
$\begin{align}L&=\Big[S(x)\ln(1+x^2)\Big]_0^1 -\int_0^1 \int_0^1\frac{2x^2\ln(tx)}{(1+x^2)(1-t^2x^2)}\,dt\,dx\\ &=S(1)\ln 2-\int_0^1 \int_0^1 \frac{2x^2\ln t}{(1+x^2)(1-t^2x^2)}\,dt\,dx-\int_0^1 \int_0^1\frac{2x^2\ln x}{(1+x^2)(1-t^2x^2)}\,dt\,dx\\ &=S(1)\ln 2-\int_0^1 \left[-\frac{t\ln t}{1+t^2}\ln\left(\frac{1+tx}{1-tx}\right)+\frac{\ln t}{t}\ln\left(\frac{1+tx}{1-tx}\right)-\frac{2\arctan x \ln t}{1+t^2}\right]_{x=0}^{x=1}\,dt-\\ &\int_0^1 \left[\frac{x\ln x}{1+x^2}\ln\left(\frac{1+tx}{1-tx}\right)\right]_{t=0}^{t=1}\,dx\\ &=S(1)\ln 2-\int_0^1 \left[\frac{\ln t}{t}\ln\left(\frac{1+tx}{1-tx}\right)-\frac{2\arctan x \ln t}{1+t^2}\right]_{x=0}^{x=1}\,dt\\ &=S(1)\ln 2-\int_0^1 \frac{\ln t}{t}\ln\left(\frac{1+t}{1-t}\right)\,dt+\frac{\pi}{2}\int_0^1 \frac{\ln t}{1+t^2}\,dt\\ &=S(1)\ln 2-\int_0^1 \frac{\ln t}{t}\ln\left(\frac{1+t}{1-t}\right)\,dt-\frac{1}{2}\pi\text{G} \end{align}$
Let,
$\displaystyle M=\int_0^1 \frac{\ln t}{t}\ln\left(\frac{1+t}{1-t}\right)\,dt$
Perform integration by parts,
$\begin{align}M&=\Big[\frac{1}{2}\ln^2 t \ln\left(\frac{1+t}{1-t}\right)\Big]_0^1-\int_0^1 \frac{\ln^2 t}{1-t^2}\,dt\\ &=-\int_0^1 \frac{\ln^2 t}{1-t^2}\,dt\\ \end{align}$
Using Taylor expansion,
$\displaystyle M=-\frac{7}{4}\zeta(3)$
Therefore,
$\displaystyle L=S(1)\ln 2+\frac{7}{4}\zeta(3)-\frac{1}{2}\pi\text{G}$
Therefore,
$\begin{align}K&=-\frac{\pi}{8}\text{G}-\frac{\ln 2}{4}S(1) +\frac{1}{4}L\\ &=-\frac{\pi}{8}\text{G}-\frac{\ln 2}{4}S(1) +\frac{1}{4}\left(S(1)\ln 2+\frac{7}{4}\zeta(3)-\frac{1}{2}\pi\text{G}\right)\\ &=\frac{7}{16}\zeta(3)-\frac{1}{4}\pi\text{G} \end{align}$
Therefore,
$\begin{align}J&=-\frac {16}{\pi^3}K-\frac{4}{\pi^2}\text{G}\\ &=-\frac {16}{\pi^3}\left(\frac{7}{16}\zeta(3)-\frac{1}{4}\pi\text{G}\right)-\frac{4}{\pi^2}\text{G}\\ &=\boxed{-\frac{7\zeta(3)}{\pi^3}} \end{align}$
Solution 5:
$\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,} \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace} \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack} \newcommand{\dd}{\mathrm{d}} \newcommand{\ds}[1]{\displaystyle{#1}} \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,} \newcommand{\ic}{\mathrm{i}} \newcommand{\mc}[1]{\mathcal{#1}} \newcommand{\mrm}[1]{\mathrm{#1}} \newcommand{\pars}[1]{\left(\,{#1}\,\right)} \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,} \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}} \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
$\ds{\int_{0}^{1}{x - x^{2} \over \sin\pars{\pi x}} \,\dd x = {7\zeta\pars{3} \over \pi^{3}}:\ {\LARGE ?}}$.
\begin{align} &\bbox[10px,#ffd]{\int_{0}^{1}{x - x^{2} \over \sin\pars{\pi x}}\,\dd x} \,\,\,\stackrel{x\ \mapsto\ x + 1/2}{=}\,\,\, \int_{-1/2}^{1/2}{1/4 - x^{2} \over \cos\pars{\pi x}}\,\dd x \\[5mm] = &\ {1 \over 2}\int_{0}^{1/2}{1 - 4x^{2} \over \cos\pars{\pi x}}\,\dd x \,\,\,\stackrel{\pi x\ \mapsto\ x}{=}\,\,\, {1 \over 2\pi^{3}}\int_{0}^{\pi/2}{\pi^{2} - 4x^{2} \over \cos\pars{x}}\,\dd x \\[5mm] = &\ \left. {1 \over 2\pi^{3}}\Re\int_{x\ =\ 0}^{x\ =\ \pi/2}{\pi^{2} - 4\bracks{-\ic\ln\pars{z}}^{2} \over \pars{z + 1/z}/2}\,{\dd z \over \ic z} \,\right\vert_{\ z\ =\ \exp\pars{\ic x}} \\[5mm] = &\ \left. {1 \over \pi^{3}}\,\Im\int_{x\ =\ 0}^{x\ =\ \pi/2}{\pi^{2} + 4\ln^{2}\pars{z} \over 1 + z^{2}}\,\dd z\,\right\vert_{\ z\ =\ \exp\pars{\ic x}} \\[5mm] = &\ -\,{1 \over \pi^{3}}\,\Im\int_{1}^{0}{\pi^{2} + 4\bracks{\ln\pars{y} + \ic\pi/2}^{\, 2} \over 1 + \pars{\ic y}^{2}}\,\ic\,\dd y \\[5mm] = &\ {4 \over \pi^{3}}\ \underbrace{\int_{0}^{1} {\ln^{2}\pars{y} \over 1 - y^{2}}\,\dd y} _{\ds{7\zeta\pars{3} \over 4}} = \bbx{7\zeta\pars{3} \over \pi^{3}} \approx 0.2714 \end{align}