Derivative for summation respect to the a floor function upper limit What is the derivative for the following function
$$\frac{d}{dw} \sum_{i=1}^{\lfloor\frac{K_o}{w} \rfloor} i^{-\gamma} \left(1-(1-w)e^{-a w}\right),\quad w \in \mathbb{R}^+ \text{ and } K_o,\gamma, \text{ and } a \text{ are positive constants}  $$
 A: As one could see, the problem is $$U(w):=\left\lfloor\frac{K_0}{w}\right\rfloor$$ since it is not a fixed number. So, let us examine the following cases:


*

*$w>K_0$. Then, we have that $\frac{K_0}{w}<1$, so $U(w)=0$ and the result is trivially $0$.

*$K_0\geq w>\frac{K_0}{2}$. Then, we have that $1\leq\frac{K_0}{w}<2$, so $U(w)=1$ and the result is
$$e^{-aw}+a(1-w)e^{-aw}=(1+a-w)e^{-aw}$$

*$\frac{K_0}{2}\geq w>\frac{K_0}{3}$. Then, we have that $2\leq\frac{K_0}{w}<3$, so $U(w)=2$ and we have to differentiate:
$$\sum_{i=1}^2i^{-\gamma}(1-(1-w)e^{-aw})=\left(1-(1-w)e^{-aw}\right)\sum_{i=1}^2i^{-\gamma}$$
Which is:
$$(1+a-w)e^{-aw}\left(1+\frac{1}{2^\gamma}\right)$$

*The general case $\frac{K_0}{n}\geq w>\frac{K_0}{n+1}$ where $U(w)=n$, so the all-wanted derivative is - this is simple to calculate:
$$(1+a-w)e^{-aw}\left(1+\frac{1}{2^\gamma}+\frac{1}{3^\gamma}+\dots+\frac{1}{n^\gamma}\right)$$


Also note that the given function may not be differentiable at the points $w_n=\frac{K_0}{n}$, for the most values of $a,K_0,\gamma$.
