Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've always assumed by graphical inspection that

$\int (x - \lfloor x\rfloor)\mathrm dx = \dfrac{(x - \lfloor x\rfloor)^2 + \lfloor x\rfloor}{2}$ (W|A) and

$\int \lfloor x\rfloor\mathrm dx = x\lfloor x\rfloor - \dfrac{\lfloor x\rfloor(\lfloor x\rfloor + 1)}{2}$ (W|A)

Why does Wolfram|Alpha say for each integral, "no result found in terms of standard mathematical functions"?

I also assumed that $\frac{\mathrm d}{\mathrm dx} \lfloor x \rfloor = 0$, yet according to Wolfram|Alpha $\frac{\mathrm d}{\mathrm dx} \lfloor x \rfloor = \mathop {\rm floor}'(x)$—which is not not explained, but the graph looks very strange. What is going on here?

share|cite|improve this question
Because, there are some functions which are difficult to integrate. For example take $f(x)=\sqrt{\sin{x}}$ you can't find an anti-derivative for this function. The best you can do is to approximate this function by using $\text{Simpson's 1/3 rule}$ but for using that you need your integral to be a definite integral. – user9413 Sep 10 '11 at 13:39
@Chandr: actually, there is a closed form for the integral of $\sqrt{\sin\,x}$, but I won't get into that here. But properly integrating the floor and fractional part functions is not so straightforward, I agree. – J. M. Sep 10 '11 at 13:42
Here is an apropos thread. – J. M. Sep 10 '11 at 13:49
up vote 6 down vote accepted

Let me start with the last question. $\lfloor x\rfloor$ is a piece-wise constant. It's is not differentiable at $x \in \mathbb{Z}$, which is why W|A gives Floor'[x] for an answer. Floor'[x] is a short form for Derivative[1][Floor][x], i.e. derivative remains unevaluated in agreement with Mathematica's evaluation principles.

When W|A says integral can not expressed in terms of known function, it means that Integrate could not provide a solution for your integral.

The expressions you wrote are correct for a definite integral, i.e. $$ \int_0^x \left( y - \lfloor y \rfloor \right) \mathrm{d} y = \frac{1}{2} \left( \left( x - \lfloor x \rfloor \right)^2 + \lfloor x \rfloor \right) $$ in doing so you completely fixed an additive piece-wise constant, ortherwise you should write $ \int \left( x - \lfloor x \rfloor \right) \mathrm{d} x = \frac{x^2}{2} - x \lfloor x \rfloor + C$.

share|cite|improve this answer
Also: Floor'[x] may mean a certain distribution, which is zero except at integers, and has delta-function properties at the integers. We need this to recover Floor[x] by integrating it. – GEdgar Sep 10 '11 at 14:56
I'm pretty sure that graph is discontinuous. He's not getting them through a definit integral, though. He's attempting to get a continuous answer. – TheGreatDuck Feb 2 at 19:44

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.