# What is the derivative of floor function? [closed]

What is the derivative of the next equation?

$$f(x) = \left\lfloor\frac{c}{x}\right\rfloor\ \ \ \ \ \text{ where }\lfloor\cdot\rfloor\text{ is the floor function.}$$

• $c,x$ are positive integers
• floor is a function that convert float number to integer by removing everything after the dot. Sorry I do no know how else to explain it.

Does floor plays here any roll or it will be equal to derivative and then flooring the result.

## closed as off-topic by dustin, Will Jagy, MPW, Algebraic Pavel, Claude LeiboviciJan 24 '15 at 4:43

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question is missing context or other details: Please improve the question by providing additional context, which ideally includes your thoughts on the problem and any attempts you have made to solve it. This information helps others identify where you have difficulties and helps them write answers appropriate to your experience level." – dustin, MPW, Algebraic Pavel, Claude Leibovici
If this question can be reworded to fit the rules in the help center, please edit the question.

• Note that you have specified that both $c$ and $x$ are integers. In this case, the domain is discrete. Do you think the derivative is meaningful in such cases? – MPW Jan 24 '15 at 2:50
• @MPW sorry, what is domain and what is discrete? – Ilya Gazman Jan 24 '15 at 4:05
• Domain of $f$ is the set of values for which $f$ is defined. Discrete means it is a set of isolated points with gaps between. Derivative only makes sense on dense set. – MJD Jan 29 '15 at 15:00
• The derivative of floor(x) is universally equal to 0*(x%1/x%1). Unfortunately you cannot cancel as there are places where division by 0 occurs. If you ignore that discontinuity then derivative of any floor function is 0, which is about as useful as saying floor is a constant. – The Great Duck Mar 4 '16 at 5:57

## 2 Answers

$f'(x) = \begin{cases} \mathrm {not \quad differentiable , if\quad} x=\frac cn \quad \mathrm for\ some\ positive \ integer\ n \\ 0 , x = other \ points\end{cases}$

Hint: Just do it by the definition of derivative.( It is not difficult ,so I omit the proof.)

• The question is about the floor effect. Can you explain why do you think it will have no effect? – Ilya Gazman Jan 24 '15 at 2:40
• @Ilya Have you plotted this function? It should be fairly clear that it is composed of flat bits (with derivative $0$) and discontinuities (with no derivative) from a graph. – Milo Brandt Jan 24 '15 at 2:49
• @Ilya_Gazman Sorry,I don't get your point. what you means "have no effect".$f(x)=\frac cx$ is defferentiable everywhere on $(0,\infty )$ but floor function not. – Syuizen Jan 24 '15 at 2:49
• why floor is not deferential? And in the areas that it is deferential, will it provide the same result as if I apply it after the deferential? – Ilya Gazman Jan 24 '15 at 2:52

As Syuizen points out, $\lfloor x \rfloor$ is not differentiable as a function.

However, as a distribution, you can write the derivative of $\lfloor x \rfloor$ as an infinite sum of Dirac delta functions:

$$\frac{d}{dx} \lfloor x \rfloor = \sum_{n \in \mathbb Z} \delta_n(x).$$