# Complex Math Formula: Predict the value of variable if result is known

I have a very complex math formula/equation which involves exponential.

Formula: X + 2 = Y

*PS: The above is just an example to illustrate my problem. The real formula is way more complex than this.

There is no way for me to form an equation with X variable on the left like X = Y - 2. I tried professional Math software like Maxima and Mathematica to solve the equation but failed.

I was given the value of Y, how can I find/estimate the value of X?

My current idea is start looping X = 1 and increase X's value with a fixed increment in each loop and try to match my value Y. The only relationship I have now is that the greater value of X generates a smaller value of Y.

Is there any good algorithm out there for my problem?

• This is an algebra problem: solve for X. You need to refactor the equation to isolate Y, and then code that. In this case, X = Y -2. Commented Jun 11, 2016 at 4:42
• @MatthewFlynn I had solved this problem. Just to let you know that my formula is way complex than what you can think of. It involves x^2, x^6, x^-0.09, x^-0.21 and lots of sqrt. Anyway it's solved with root finding algorithm. Commented Jun 11, 2016 at 5:42