How to solve this integral with fractional part function? 
Let $[x]$ denote the largest integer not exceeding $x$ and $x - [x]$. Then $$ \int_0^{2012 }\frac{e^{\cos \pi\{x\}}}{e^{\cos \pi\{x\}} + e^{-\cos \pi\{x\}}}\; dx $$
  }is equal to 
  (A) 0 (B) 1006 (C) 2012 (D) 2012$\pi$

What I did:I simplified the function inside the integral into
$$
                             \frac{e^{2\cos\pi\{x\}}}{e^{2\cos(\pi\{x\}}+1} 
$$
I tried to solve the integral using substitution by putting $u=$denominator. But, while differentiating $u$ I finally encountered the $\{x\}$.I think $\{ \cdot\}$ function is not continuous and hence not differentiable. So, how to proceed further? 
 A: As already noted, the fractional part function $\{x\}$ is periodic with period $1$, so the integrand $\dfrac{e^{\cos \pi\{x\}}}{e^{\cos \pi\{x\}} + e^{-\cos \pi\{x\}}}$ also has period $1$, so
$$\int_0^{2012}\frac{e^{\cos \pi\{x\}}}{e^{\cos \pi\{x\}} + e^{-\cos \pi\{x\}}}\,dx = 2012 \int_0^1 \frac{e^{\cos \pi\{x\}}}{e^{\cos \pi\{x\}} + e^{-\cos \pi\{x\}}}\,dx.$$
On the interval $[0,1)$, we have $\{x\} = x$, so what remains is to find
$$\begin{align}
\int_0^1 \frac{e^{\cos \pi x}}{e^{\cos \pi x} + e^{-\cos \pi x}}\,dx &= \int_0^{\frac12} \frac{e^{\cos \pi x}}{e^{\cos \pi x} + e^{-\cos \pi x}}\,dx + \int_{\frac12}^1 \frac{e^{\cos \pi x}}{e^{\cos \pi x} + e^{-\cos \pi x}}\,dx\\
&= \int_0^{\frac12} \frac{e^{\cos \pi x}}{e^{\cos \pi x} + e^{-\cos \pi x}}\,dx
+ \underbrace{\int_0^{\frac12} \frac{e^{\cos \pi(1-u)}}{e^{\cos \pi(1-u)} + e^{-\cos \pi(1-u)}}\,du}_{x = 1-u}\\
&= \int_0^{\frac12} \frac{e^{\cos \pi x}}{e^{\cos \pi x} + e^{-\cos \pi x}}\,dx
+ \underbrace{\int_0^{\frac12} \frac{e^{-\cos \pi u}}{e^{-\cos \pi u}+ e^{\cos \pi u}}\,du}_{\cos \pi(1-u) = -\cos (-\pi u) = -\cos\pi u}\\
&= \int_0^{\frac12} \frac{e^{\cos \pi x}+e^{-\cos \pi x}}{e^{\cos \pi x} + e^{-\cos \pi x}}\,dx\\
&= \frac12.
\end{align}$$
A: $$I=\sum_{n=0}^{odd}\int_n^{n+1}\frac{dx}{1+e^{-2\cos\pi x}}$$
$$=\frac{1}{\pi}\sum_{n=0}^{odd}(-1)^n\int_0^1\frac{du}{(1-e^{-2u})\sqrt{1-u^2}}.$$
But, the $n-$sum is 0.
