# How to solve for x when it is in the exponent of 2 variables

I'm actually a programmer so I'm sorry if this is a stupid question.

I am trying to solve for $x$, but I got stuck at this step:

# $$e^{\frac{q1 + x}{b}} = e^{\frac{p - x\cdot o}{mb}} - e^{\frac{q2}{b}}$$

I'm not sure how to get x by itself because it's in the exponent in both places if I do: $\ln(e^{\cdots})$

I'll end up with only one $x$ being solved for :( ie.

# $$x = b\ln(e^{\frac{p - x\cdot o}{mb}} - e^{\frac{q2}{b}}) - q1$$

obviously that doesn't get me anywhere

I considered that there might be 2 (or more) answers to this problem (maybe one positive one negative?), but $x$ is guaranteed to be a positive number.

maybe I need to represent that in the problem somehow?

edit: more info

all values are known except for $x$; they are plugged into the equation by a computer program.

If it is possible to find x with arbitrary numbers plugged in for all the other values I'd like to see how to do that (I didn't see a way to solve it that way)

edit 2: realistic values

b = 5000
o = -2495
m = 3000
q1 = 90
q2 = 105
p = 75


reduced...

# $$e^{\frac{90 + x}{5000}} = e^{\frac{75 + 2495x}{15000000}} - e^{0.021}$$

• You don't. Find a numerical answer. – Qiaochu Yuan Jan 21 '11 at 16:21
• I don't actually know how to do that. all values are known except for x, but even plugging in values I wasn't able to solve for it... trying again – Jiaaro Jan 21 '11 at 16:29
• What Qiaochu is saying is that there is no closed form for the solution. You can set $f(x) := e^{(q_1+x)/b} - e^{(p-ox)/mb} + e^{q_2/b}$ and try to find a root by a numerical algorithm like the bisection method or Newton's method. – Rahul Jan 21 '11 at 16:37
• Thanks guys. Implemented Newtons method in my program :) – Jiaaro Jan 21 '11 at 16:59
• In your realistic values, the numerator is always small compared to the denominator, therefore it might be good enough to approximate $e^{x/a} \approx 1 + x/a$ – Myself Jan 21 '11 at 17:21

## 1 Answer

Set $$y = e^{x/15000000}$$

This gives us

$$Ay^{3000} = By^{2495} - C$$

Which is a polynomial, and I suppose can be solved easily using standard numerical methods.

Hope that helps.

• the polynomial will have too many solutions, unnecessarily complicated! – user1709 Jan 21 '11 at 21:10
• @SLowsolver: Well you need to find the positive roots. And each positive root of the polynomial will correspond to a root of the original equation. The equation I gave is not much different. It is just a different way to look at it. – Aryabhata Jan 21 '11 at 21:12
• And if we require x to be positive, we look for solutions of the polynomial $\gt 1$. – Aryabhata Jan 21 '11 at 21:42