Let $\theta \geq 0$ and consider the sum $$\sum\_{n \leq x} \left\lfloor \frac{x}{n} \right\rfloor^{-\theta}.$$. 


I have seen the claim that there is a constant $c(\theta)$ (depending on $\theta$!) such that this sum equals $$c(\theta)x+O(1),$$ where the implicit constants inside of the $O$ sign are independent of $\theta.$ Why is this true? 


This is from an exercise in a book on Number Theory, and in the first part of the exercise, one was asked to prove the identity  

$$\sum\_{n \leq x} f(n) G(x/n) = \sum\_{m \leq x} (G(m)-G(m-1))F(x/m)$$ where $F$ is the summatory function of an arithmetic function $f$ and $G$ the summatory function of some arithmetic function $g.$ This is probably relevant, but I do not see why.



An asymptotic formula for a sum involving powers of floor functions
The function
$f(x) = \sum\_{1\leq n \leq x} \lfloor \frac x n \rfloor ^{-\theta} $
can be expressed as
$$f(x) = \sum\_k k^{-\theta} \cdot\#\{n : \lfloor \frac x n \rfloor = k\}$$
$$ = \sum\_k k^{-\theta} \left(\lfloor \frac x k\rfloor - \lfloor \frac x {k+1}\rfloor \right)$$
$$ = \sum\_k k^{-\theta}\left( \frac{x}{k^2+k} + O(1)\right)$$
so the constant 
$c(\theta)= \displaystyle\sum\_{k\geq 1} \frac{k^{-\theta}}{k^2 + k}$.
Here the implied error is bounded by
$\sum\_{ k\leq x} 2k^{-\theta}$.


To get a better bound on the error term, we can regroup terms
$$f(x) = \lfloor x\rfloor - \sum\_{k\geq2} ((k-1)^{-\theta}-k^{-\theta})\lfloor \frac{x}{k} \rfloor$$
so the error from ignoring the ''floor'' signs is
$$ |c(\theta)x - f(x)| = \left| (x-\lfloor x\rfloor) - \sum\_{k\geq2} ((k-1)^{-\theta}-k^{-\theta})\left( \frac{x}{k} - \lfloor \frac{x}{k}\rfloor\right) \right|$$
$$\leq 1 + \sum\_{k \geq 2}((k-1)^{-\theta}-k^{-\theta}) = 2.$$


