0

I need help creating a method for a program I'm making. I've worked on this countless hours and I can not seem to figure it out. what I need: A method that returns $x$. My variables ( initialized to a given number ):

double initial, initial2, initial3, 
    Kab, coefficient1, coefficient2, coefficient3 

Equation:

kab = ((initial2+coefficient2*X)^coefficient2 *
       (initial3+coefficient3*X)^coefficient3)  / 
      (initial-coefficient1*X)^coefficient1

I have tried binary search in order to solve it and that didn't work.

Please be patient with me. I am a high school student and I haven't had much advanced math in order to solve these kinds of problems.

Thank you so much!

mvw
  • 34,562
Basam
  • 1
  • 2
    Thus, you want to solve $$(x+a)^n\cdot(x+b)^m=e\cdot(x+c)^p$$ for some given (positive?) parameters $(a,b,c,e,n,m,p)$. In the general case, only numerical methods are available. – Did May 21 '16 at 21:16
  • what I need is something similar to what you suggested. But how do I go on solving it ? – Basam May 21 '16 at 21:38
  • ?? You realize it is next to impossible to know what you mean by this comment? – Did May 22 '16 at 06:52

1 Answers1

-1

Knowing nothing about your parameters, except that they are real numbers I would suggest to use $$ F(x) =\frac{(i_2 + c_2 x)^{c_2}(i_3 + c_3 x)^{c_3}}{(i - c_1 x)^{c_1}} $$ and solve numerically for zeros of $$ f(x) = F(x) - k_{ab} $$ This is possible e.g. by bisection, or by using Newton-Raphson iteration.

mvw
  • 34,562