# What technique should I apply to find the derivative of a ceiling or floor function e.g d/dx(x*⌈x⌉) and d/dx(x*⌊x⌋)?

May I know the technique to apply to find the derivative, whenever I see a ceiling function of floor function. Thank You!

e.g $$\frac{d}{dx}(x*\lceil x \rceil )$$ and $$\frac{d}{dx}(x*\lfloor x \rfloor )$$

Is there a solution to $\frac{d}{dx}(x*\lceil x \rceil )$ ?

Usually for a ceiling function it can be written as function by cases. For example, if $f(x)=x* \lceil x \rceil$, then taking $f$ defined on the interval $]0,5[$, the $f$ can be written as $$f(x)=\begin{cases} x \quad \text{ if } \quad 0<x \leq 1 \\ 2x \quad \text{ if } \quad 1<x \leq 2 \\ 3x \quad \text{ if } \quad 2<x\leq 3 \\ 4x \quad \text{ if } \quad 3<x\leq 4 \\ 5x \quad \text{ if } \quad 4<x< 5 \\ \end{cases}$$ And as we can see, $f$ is even not continuous at $1,2,3,4$ , ingeneral such $f$ will not be conyinuous at any inetger even if it is defined on $\mathbb{R}$. Hence, it is not differentiable at any inetger, and thus no derivative exists at any $x=n$ with $n$ integer. On the other hand, if $x$ is not an integer, as we can see from the above example we can deal with $f$ depending its value in each open interval $]n,n+1[$. So for the above example we can see
$$f'(x)=\begin{cases} 1 \quad \text{ if } \quad 0<x <1 \\ 2 \quad \text{ if } \quad 1<x <2 \\ 3 \quad \text{ if } \quad 2<x< 3 \\ 4 \quad \text{ if } \quad 3<x< 4 \\ 5 \quad \text{ if } \quad 4<x< 5 \\ \end{cases}$$
So $f'(x)=\lceil x \rceil$ if $x$ is not an integer, and $f'(x)$ is not defined if $x$ is an integer.