How to integrate greatest integer and fractional part Integrate this function: $⌊x^2⌋ + \{x^2\}$ , from $0$ to $2$
I know that the first part is a step function, and every integer value, say, from 1 to 2, will be 1. But I can't understand how to integrate it. Also does the square matter if its outside the bracket or inside? 
 A: As Iulu stated in the comments, it does matter whether the square is on the outside or the inside, but as you've written the problem here, since $\lfloor z \rfloor +\{z\}=z$, we have $\lfloor x^2 \rfloor +\{x^2\}=x^2$. And thus we have
$$\int_0^2 \lfloor x^2 \rfloor +\{x^2\} \ dx = \int_0^2 x^2=\frac{x^3}{3}\bigg|_0^2 = \frac{8}{3}$$
What may be slightly more interesting, however, would be an evaluation of the two parts individually. For
$$\int_0^2 \lfloor x^2 \rfloor \ dx$$
we can split the integral into parts as follows. For $0<x<1$, we have $\lfloor x^2 \rfloor = 0$. For $1<x<\sqrt{2}$, we have $\lfloor x^2 \rfloor=1$, and in general we have for $\sqrt{n}<x<\sqrt{n+1}$, we have $\lfloor x^2 \rfloor =n$. So splitting up the integral we get
$$\int_0^2 \lfloor x^2 \rfloor \ dx = \sum_{n=0}^3 \int_{\sqrt{n}}^{\sqrt{n+1}} n 
 \ dx = \sum_{n=1}^{3}n(\sqrt{n+1}-\sqrt{n})=3\sqrt{4}-\sqrt{3}-\sqrt{2}-\sqrt{1}=5-\sqrt{3}-\sqrt{2}$$
Note that we can do  a similar splitting of the integral for the fractional part, but I'll leave that as an optional excercise.
