Evaluating the Definite Integral $\int_{0}^{1}\frac{2 \sin \pi x \cos \pi x}{1+x^2}dx$ 
How can I find this integral
  $$I=\int_{0}^{1}\frac{2 \sin \pi x \cos \pi x}{1+x^2}dx$$

Any trick that could compute the definite integral is acceptable. However, it will be more challenging to find a primitive.
Any hint or help is appreciated.

My Work
I just wrote the integral as
$$I=\int_{0}^{1}\frac{\sin 2 \pi x}{1+x^2}dx$$
Then, I decided to introduce
$$J(\alpha)=\int_{0}^{1}\frac{\sin \alpha x}{1+x^2}dx$$
and solve a more general problem. Hence, we would have $I=J(2\pi)$ as a special result. But I don't know how to go further. I tried integration by parts and substitutions but to no avail!
 A: Let's try your last idea and start with :
$$J(\alpha):=\int_{0}^{1}\frac{\sin \alpha x}{1+x^2}dx$$
Then $\;\displaystyle J''(\alpha)=-\int_{0}^{1}\frac{x^2\;\sin \alpha x}{1+x^2}dx\;$ and we obtain this ODE :
$$J(\alpha)-J''(\alpha)=\frac {1-\cos(\alpha)}{\alpha}$$
The solution of the homogeneous ODE is simply $\;J(x)=ae^x+be^{-x}$.
Let's use variation of constant and start with $J(x)=a(x)e^x$ then :
\begin{align}
J(x)&=a(x)e^x\\
J'(x)&=(a'(x)+a(x))e^x\\
J''(x)&=(a''(x)+2a'(x)+a(x))e^x\\
J(x)-J''(x)&=-(a''(x)+2a'(x))e^x=\frac {1-\cos(x)}{x}\\
\end{align}
For $b(x):=-a'(x)\,$ we have 
\begin{align}
b'(x)+2b(x)&=\frac {1-\cos(x)}{x}e^{-x}\\
\end{align}
For $b(x):=c(x)e^{-2x}\,$ this becomes for $\operatorname{Ei}$ the exponential integral :
\begin{align}
c'(x)&=\frac {1-\cos(x)}{x}e^{x}\\
c(x)&=\int\frac {e^{x}}x\,dx-\int\frac {e^{x+ix}+e^{x-ix}}{2\,x}\,dx\\
c(x)&=C+\operatorname{Ei}(x)-\frac 12\operatorname{Ei}((1+i)x)-\frac 12\operatorname{Ei}((1-i)x)\\
\end{align}
Coming back to $a(x)$ :
\begin{align}
a'(x)&=-\left(C+\operatorname{Ei}(x)-\frac 12\operatorname{Ei}((1+i)x)-\frac 12\operatorname{Ei}((1-i)x)\right)e^{-2\,x}\\
\end{align}
Now $\ \displaystyle \int \operatorname{Ei}(u\,x)e^{-vx}\,dx=\frac 1v\left(\operatorname{Ei}((u-v)x)-e^{-vx}\operatorname{Ei}(u x)\right)\;$ from Wolfram functions so that for $\,v=2$ and $u=1,1+i,1-i$ :
$$a(x)=D-\frac 12\left(C_1\,e^{-2x}+\operatorname{Ei}(-x)-e^{-2x}\operatorname{Ei}(x)\\-\frac 12\left(\operatorname{Ei}((-1+i)x)-e^{-2x}\operatorname{Ei}((1+i)x)+\operatorname{Ei}((-1-i)x)-e^{-2x}\operatorname{Ei}((1-i)x)\right)\right)$$
Multiplying by $e^x$ we get the general formula for $J(x)$ :
$$J(x)=De^x+D_1\,e^{-x}-\frac {e^x\operatorname{Ei}(-x)-e^{-x}\operatorname{Ei}(x)}2\\+\frac {e^x\operatorname{Ei}((-1+i)x)-e^{-
x}\operatorname{Ei}((1+i)x)+e^x\operatorname{Ei}((-1-i)x)-e^{-x}\operatorname{Ei}((1-i)x)}4$$
(of course getting this with alpha is faster!)
Now we have to find $J(2\pi)$ knowing that $J(0)=0$ (I'll let you try too!).
A: I don't think you will get a simple answer judging by Mathematica's output:
Integrate[2 Sin[Pi x] Cos[Pi x]/(1 + x^2), {x, 0, 1}]
produces
Cosh[\[Pi]] (CosIntegral[(-2 + 2 I) \[Pi]] - 
    2 CosIntegral[2 I \[Pi]] + 
    CosIntegral[(2 + 2 I) \[Pi]]) Sinh[\[Pi]] + 
 1/2 Cosh[2 \[Pi]] (2 SinhIntegral[2 \[Pi]] + 
    I (SinIntegral[(-2 + 2 I) \[Pi]] + SinIntegral[(2 + 2 I) \[Pi]]))
Numerically,
NIntegrate[2 Sin[Pi x] Cos[Pi x]/(1 + x^2), {x, 0, 1}]
produces
0.0926961.
A: Let us consider $$I=\int \frac{\sin(2 \pi x)}{1+x^2} \,dx$$ Now, since $$\frac{1}{1+x^2}=\frac i 2\left( \frac{1}{x+i}-\frac{1}{x-i} \right)$$ hence $$I=\frac i 2\left(\int \frac{\sin(2 \pi x)}{x+i} \,dx-\int \frac{\sin(2 \pi x)}{x-i} \,dx\right)$$ Now, considering the first integral, writing $2\pi x=2\pi(x+i)-2i\pi$ and expanding $\sin(a-b)$ ,$$\sin(2 \pi x)=\cosh (2\pi ) \sin (2 \pi  (x+i))- i \sinh (2\pi)
    \cos (2 \pi  (x+i))$$ Now, change variable $2\pi(x+i)=t$ to make $$\int \frac{\sin(2 \pi x)}{x+i} \,dx=\cosh(2\pi)\int \frac{\sin(t)}{t} \,dt-i \sinh(2\pi)\int \frac{\cos(t)}{t} \,dt$$ and using $$\int \frac{\sin(t)}{t} \,dt=\text{Si}(t)\quad , \quad  \int \frac{\cos(t)}{t} \,dt=\text{Ci}(t)$$ Doing almost the same for the second integral, recombining and back to $x$ $$2I=\sinh (2 \pi ) (\text{Ci}(2 \pi  (i-x))+\text{Ci}(2 \pi  (i+x)))+i \cosh (2 \pi )
   (\text{Si}(2 \pi  (i+x))+\text{Si}(2 \pi (i- x))$$ from which you get  E.tsukerman's result.
Edit
Using the same approach for $$J=\int\frac{\sin (\alpha x)}{1+x^2}\,dx$$
$$2J=\sinh (\alpha ) (\text{Ci}(\alpha(i-x)  )+\text{Ci}(\alpha(i+x)  ))+i \cosh (\alpha )
   (\text{Si}(\alpha(i+x) )+\text{Si}( \alpha(i-x ))$$
Edit
Concerning the numerical value, it is awful (just as already said by other participants).
For $x=1$, the value is $\approx -0.077380457987+420.572696077718 i$
For $x=0$, the value is $\approx -0.170076586683+420.572696077718 i$
Edit
For the antiderivative, doing the same, it would have been faster to compute $$K=\int \frac{e^{i ax}}{1+x^2} \,dx=\frac i 2 \left( e^a \,\text{Ei}(a(ix-1))-e^{-a}\, \text{Ei}(a(i x+1))\right)$$
A: We need
$$I = \int_0^1 \dfrac{\sin(2\pi x)}{1+x^2}dx = \sum_{k=0}^{\infty} (-1)^k \int_0^1 x^{2k}\sin(2\pi x)dx$$
We have
\begin{align}
I_{k} & = \int_0^1 x^{2k}\sin(2\pi x) dx \\
&= -\dfrac1{2\pi} \int_0^1 x^{2k} d\left(\cos(2\pi x)\right) \\
&= -\dfrac1{2\pi}\left(1-2k\int_0^1 x^{2k-1}\cos(2\pi x)dx\right)\\
& = -\dfrac1{2\pi} \left(1-\dfrac{k}{\pi}\int_0^1x^{2k-1}d\left(\sin(2\pi x)\right)\right) \\
&= -\dfrac1{2\pi}\left(1+\dfrac{k(2k-1)}{\pi}I_{k-1}\right)
\end{align}
Hence, we obtain $$I = \sum_{k=0}^{\infty} (-1)^k I_k$$
where $I_k$ satisfies the recurrence $$I_k = -\dfrac1{2\pi}\left(1+\dfrac{k(2k-1)}{\pi}I_{k-1}\right)$$ with $I_0 = 0$.

Note for @ClaudeLeibovici: I just made sure that this is due to catastrophic cancellation in finite precision. You might already be familiar with this, but still. Below is the results I obtain using an adaptive Gaussian quadrature for $I_k$ accurate up to $14$ digits on a $64$ bit machine and using the recurrence done on a $64$ bit machine. One always needs to be careful evaluating even a simple recurrence as I have written here. The recurrence arising out of this question goes into my teaching list when I discuss evaluating recurrences in class the next time :-).

The C++ code evaluating the recurrence is shown below.
#include<iostream>
#include<iomanip>
#include<cstdlib>
#include<vector>

double PI   =   3.141592653589793238;

int main(int argc, char* argv[]) {
    int n   =   atoi(argv[1]);
    std::vector<double> I;
    I.push_back(0.0);
    for (int k=1; k<=n; ++k) {
        double temp =   -0.5/PI*(1.0+k*(2.0*k-1.0)/PI*I[k-1]);
        I.push_back(temp);
    }
    for (int j=0; j<=n; ++j) {
        std::cout << "Term " << j << " is: " << std::setprecision(15) << I[j] << "\n";
    }
    double S    =   0.0;
    for (int j=0; j<=n; j+=2) {
        S+=I[j];
    }
    for (int j=1; j<=n; j+=2) {
        S-=I[j];
    }
    std::cout << "\nThe integral is: " << S << "\n";
}

