I have to evaluate $$\int _0^2\:\frac{x-\left[x\right]}{2x-\left[x\right]+1}dx$$
Where $[x] = floor(x)$
I tend to write it like this, but I think i'm missing the point $x = 2$
$$\int _0^2\:\frac{x-\left[x\right]}{2x-\left[x\right]+1}dx=\int _0^1\:\frac{x}{2x+1}dx+\int _1^2\:\frac{x-1}{2x}dx = 1 - \frac{1}{4} \cdot \ln 3$$
The correct answer is $1 - \frac{1}{4} \cdot \ln 12$
$\endgroup$ 31 Answer
$\begingroup$That's correct, the value at the extremes of the interval is irrelevant, as long as the function can be extended by continuity at the end points. There would be more relaxed conditions, but in this case this is enough.
However $$ \int_0^1\frac{x}{2x+1}\,dx=\frac{1}{2}\int_0^1\frac{2x+1-1}{2x+1}\,dx =\frac{1}{2}\Bigl[x-\frac{1}{2}\ln(2x+1)\Bigr]_0^1= \frac{1}{2}\left(1-\frac{1}{2}\ln 3\right) $$ and $$ \int_1^2\frac{x-1}{2x}\,dx= \frac{1}{2}\int_1^2\left(1-\frac{1}{x}\right)dx= \frac{1}{2}\Bigl[x-\ln x\Bigr]_1^2=\frac{1}{2}(2-\ln2-1) $$ so your integral is $$ \frac{1}{2}-\frac{1}{4}\ln3+\frac{1}{2}-\frac{1}{2}\ln2=1-\frac{1}{4}\ln12 $$
$\endgroup$