Analytic solution $\underset{n} {\mathrm{argmin}} \frac{a}{r + ns} + \sum_{i=0}^{n-1}\frac{b}{r + is}$ [closed]

Could anyone provide some hints for solving:

$\underset{n} {\mathrm{argmin}} \frac{a}{r + ns} + \sum_{i=0}^{n-1}\frac{b}{r + is}$ for $n \in \{1,2,3,\ldots\}$

The problem is part of a coding exercise, but I was curious whether an analytic solution could be derived.

closed as off-topic by Stefan Kohl, Chris Godsil, Will Jagy, Stefan Waldmann, Denis SerreDec 4 '14 at 8:32

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

• "This question does not appear to be about research level mathematics within the scope defined in the help center." – Chris Godsil, Will Jagy, Stefan Waldmann, Denis Serre
If this question can be reworded to fit the rules in the help center, please edit the question.

• sry, I realize this is not a research level question. it is probably better suited for the 'Mathematics' forum. – means-to-meaning Dec 16 '14 at 13:51

Let $$F(n) = \dfrac{a}{r+ns} + \sum_{i=0}^{n-1} \dfrac{b}{r+is}$$ I'll assume $a,b,r,s > 0$. Note that $$F(n+1) - F(n) = \dfrac{bs n + b r+ bs - as}{(ns + r + s)(ns + r)}$$ So you want the least positive integer $n$ (if any) such that $b s n + br + bs - as \ge 0$, i.e. $n = \left\lceil \dfrac{a}{b} - \dfrac{r}{s} - 1\right\rceil$ if that is positive, otherwise $n=1$.
The summation equals: $$\frac{a}{n s+r}+\frac{b \psi ^{(0)}\left(n+\frac{r}{s}\right)-b \psi ^{(0)}\left(\frac{r}{s}\right)}{s},$$ and its derivative with respect to $n$ equals $$\frac{b \psi ^{(1)}\left(n+\frac{r}{s}\right)}{s}-\frac{a s}{(n s+r)^2}$$ ($\psi$ is the polygamma function). I would not expect a closed form for the solution of $$\frac{b \psi ^{(1)}\left(n+\frac{r}{s}\right)}{s}=\frac{a s}{(n s+r)^2},$$ but who can say...