Integrate over a discontinuity Evaluate $$\int_{0}^{1} \dfrac{1}{1  + \left(1 - \dfrac{1}{x}\right)^{2015}} dx$$
Wolfram says it's 1/2 but I thought that you can't integrate this because there is a discontinuity at x = 0.
Progress: The inverse substitution $x$ = $\dfrac{1}{u+1}$ gave me this: http://www.wolframalpha.com/input/?i=integrate+1%2F((u%2B1)%5E2(1-u%5E2015))+from+0+to+infinity
 A: The Riemann integral does not exist at all!
Let's denote $f(x)=\frac{1}{1  + \left(1 - 1/x\right)^{2015}}$.
This function is not actually singular at $x=0$, but in fact $\lim_{x\to0}f(x)=0$.
If you define $f$ by the above formula for $x\neq0$ and $f(0)=0$, the function is indeed continuous at zero.
Redefining the value at a single point has no effect on the integral.
However, the function is ill-behaved at $x=\frac12$.
To see what the singularity looks like, you can do it by hand or ask 
WolframAlpha to do a series expansion at that point.
The singular part looks like $8060/(x-1/2)$.
This in fact implies that the function is not integrable: the integral $\int_0^1f(x)dx$ does not exist as a Riemann integral.
However, the principal value integral
$$
pv\int_0^1f(x)dx
=
\lim_{h\to0}
\left(
\int_0^{1/2-h}f(x)dx
+
\int_{1/2+h}^1f(x)dx
\right)
$$
does exist and the value is indeed $\frac12$ as explained in Khosrotash's answer.
Unless a principal value integral is meant, the integral does not exist.
That is, $\int_0^1f(x)dx=\frac12$ in the same sense as $\int_{-1}^1x^{-1}dx=0$.
Why should one expect trouble at $x=1/2$ but not at $x=0$, then?
As $x\to0$, we have indeed $1/x\to\infty$, and so the denominator of $f(x)$ goes to infinity and thus $f(x)$ goes to zero.
This is not an issue.
Issues arise if you need to divide by zero.
And indeed $1  + \left(1 - 1/x\right)^{2015}=0$ on the interval of interest if and only if $x=1/2$. Hence, the integral does not exist.
