A Question from titchmarshs book about zeta function p.270 Let $x\geq 1, 0<\theta \leq 1/2, \eta >0$ and  $y\geq x\cdot\sqrt{\eta}$. Titchmarsh states that then $$\sum_{r\leq y/(x\sqrt{\eta})}r^{\theta -1}$$
is of the form $$\frac{1}{\theta}\left(\frac{y}{x\sqrt{\eta}}\right)^{\theta}-\frac{1}{\theta}+K(\theta) + \mathcal{O}\left\lbrace \left(\frac{y}{x\sqrt{\eta}}\right)^{\theta-1} \right\rbrace$$
for some bounded function $K(\theta)$.
I don't really see how to derive this. Since $\theta-1<0$ all terms in the sum are $\leq 1$ so that the sum is $\leq y/(x\sqrt{\eta})$. So I see how $K(\theta)$ deals with the terms for $r<y/(x\sqrt{\eta})$ but how can I choose $K(\theta)$ to deal with $\frac{1}{\theta}$ especially for $\theta$ close to $0$?
I don't know whether I am not familiar with a method to deal with this or I am just missing something obvious.
 A: such a result is a consequence of the very useful summation formula (due to Leonhard Euler): 
if $f$ is continuously differentiable on a closed interval $[a,b]$ then
$$
\sum_{a \lt n \le b} f(n) = \int_a^b f(t)dt + \int_a^b(t-[t])f'(t)dt -(b-[b])f(b) + (a-[a])f(a)
$$
which, for sums over positive integers becomes, (with $x$ replacing the upper bound $b$):
$$
\sum_{n \le x}f(n) = \int_1^x f(t)dt + \int_1^x(t-[t])f'(t)dt -(x-[x])f(x) + f(1)
$$
replacing $f(t)$ by $t^{\theta-1}$ we have:
$$
\int_1^xt^{\theta-1}dt = \frac{x^{\theta}}{\theta}-\frac1{\theta}
$$
to deal with the second integral note that $f'(t)=(\theta-1)t^{\theta-2}$. since $0\le t-[t] \le 1$ and $\theta-2 \le -\frac32$ the infinite integrals exist and we may write:
$$
\int_1^x (t-[t])f'(t)dt  = \int_1^{\infty}(t-[t])f'(t)dt - \int_x^{\infty}(t-[t])f'(t)dt
$$
the first does not depend on $x$ so we may write 
$$
 \int_1^{\infty}(t-[t])f'(t)dt = K(\theta)
$$
you can probably deal with the remaining estimates, and in place of $x$ in the above, obviously you require $\frac{y}{x\sqrt{\eta}}$
