# Find root of non-continuous function using a numerical method

Given the formula (source) $$M = P \times \frac{J}{1 - (1 + J)^{-N}}$$ Assume $P$ and $J$ remain constant. I want to be able to find $N$ for given $M.$

Could you please give an example of a numeric method (like secant to solve the same)? [My] problem is how to find initial 2 values for the secant formula.

-

## 1 Answer

If I understood your question correctly, we're given, $M,P,J$ and we're trying to find $N.$

Well, we have $$1 - (1+J)^{-N} = \frac{PJ}{M} \\ (1+J)^{-N} = 1 - \frac{PJ}{M}$$ Take $\log$ both sides: $$-N \log{(1+J)} = \log{(1 - \frac{PJ}{M})} \\ N = - \frac{\log{(1 - \frac{PJ}{M})}}{\log{(1+J)}}$$ Since $M, P, J$ are given, we can very well compute the RHS, and hence compute $N.$

Did I mis-understood your question?

-

Of course, assuming $\dfrac{PJ}{M} < 1$ and $J > -1.$ – user2468 Mar 25 '12 at 5:47
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 11, "mathjax_display_tex": 3, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.8716879487037659, "perplexity_flag": "head"}