# Maximizing the value of an implicit function

I have $R$ as an implicit function of $N, K$ as defined in the following equation:

$$\left(1+K\frac{N}{12}\right)=\frac{R}{1+(1+R)^{-N}}$$

For those interested, this equation came about as a result of my answer to the following question: Most efficient method for converting flat rate interest to APR.

I would like to find, for fixed $K$, what value of $N$ maximizes $R$.

Unfortunately, implicit partial differentiation yields something quite ugly, as such:

$$\frac{\delta R}{\delta N}\left(\frac{RN}{1+R}-(1+R)^{N}-1)\right)=-R\ln{(1+R)}-\frac{K}{12}\left(1+(1+R)^{-N})^{2}\right)(1+R)^N$$

Is there any method to find the maximum value of $R$ using this approach, or is it the wrong one?

-
Just use a numerical root-finding algorithm on the derivative. Use a symbolic algebra package to get the derivative (if you want to use Newton's method), it will get worse ;-) – vonbrand Feb 28 '13 at 17:03
okay, I'm just slightly curious as to why $R$ is not maximized as $N$ is, because the financial intuition seems to suggest that it should be. Will look at a numerical root-finding algorithm then! – Vincent Tjeng Feb 28 '13 at 17:07
A simple one is the secant method, almost as fast (in terms of steps) than Newton's, but as it doesn't require messy derivatives it could turn out faster in practice. Or just look for numerical methods for finding maxima/minima. – vonbrand Feb 28 '13 at 17:14