TITLE: How do we solve $a \le b^{r}-r$ for $r$?
QUESTION [12 upvotes]: Given two values $a$ and $b$, how should one go about solving the following inequality for $r$:
$$a \le b^r -r .$$
Applying $\log_b$ on both sides of the inequality doesn't help me much since that yields the following:
$$\log_b a \le \log_b (b^r-r) .$$
I know that 
$$\log_z x  - \log_z y = \frac{\log_z x}{\log_z y} .$$
But that doesn't help me to eliminate the exponentiation and solve for $r$. 
It's been ages that I've done algebra, and now I'm back in grad school, and I'm finding this equation in a homework. Can't remember ever seeing a rule of logarithms involving such expressions. 
The actual homework (after simplification) involves $9 \le 2^r - r$ which is trivially solvable by just eyeballing it. 
But is there a methodical way to solve $a \le b^r-r$ for $r$ given any arbitrary numbers $a$ and $b$?

REPLY [9 votes]: The case of equality can be solved in terms of the Lambert W function.
It can be used to solve equations of the form $$p^{ax+b} = cx + d$$
(quoted from the wiki page).
$b^{r} -r$ is 'mostly' monotonic, so I suppose solving the equality will be enough to find the solutions to your inequality.

REPLY [5 votes]: You can also get a quick-and-dirty approximation for the equality case with the following approach, which should hold in most situations when $a, b > 1$.  
Rearrange the problem and take logarithms to rewrite it as $$\ln\left(1+ \frac{r}{a}\right) = r \ln b - \ln a.$$
Now, if $\frac{r}{a}$ is less than 1 (and it should be in most cases where $a, b > 1$), 
$$\ln\left(1+ \frac{r}{a}\right) \approx \frac{r}{a},$$
which gives you $$r \approx \frac{- \ln a}{1/a - \ln b}.$$
For your specific problem, this method yields $r \approx 3.78$, whereas the actual answer is closer to $3.66$.
You can improve this by using the quadratic approximation 
$$\ln\left(1+ \frac{r}{a}\right) \approx \frac{r}{a} - \frac{r^2}{2a^2},$$
which requires solving a quadratic equation.
(These approximations come from the Taylor expansion of $\ln (1+x)$.)

REPLY [3 votes]: If you don't have the W function, you need an iterative root finding type of solution.  Note that for your example r is somewhere between 3 and 4.  This equation is nicely behaved, so any of them will work.  See Root finding for a start