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

$$e^{\frac{90 + x}{5000}} = e^{\frac{75 - x(-2495)}{3000\cdot 5000}} - e^{\frac{105}{5000}}$$


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

  • 3
    $\begingroup$ You don't. Find a numerical answer. $\endgroup$ Jan 21, 2011 at 16:21
  • $\begingroup$ 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 $\endgroup$
    – Jiaaro
    Jan 21, 2011 at 16:29
  • 5
    $\begingroup$ 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. $\endgroup$
    – user856
    Jan 21, 2011 at 16:37
  • 2
    $\begingroup$ Thanks guys. Implemented Newtons method in my program :) $\endgroup$
    – Jiaaro
    Jan 21, 2011 at 16:59
  • 1
    $\begingroup$ 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$ $\endgroup$
    – Myself
    Jan 21, 2011 at 17:21

1 Answer 1


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.

  • $\begingroup$ the polynomial will have too many solutions, unnecessarily complicated! $\endgroup$
    – user1709
    Jan 21, 2011 at 21:10
  • $\begingroup$ @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. $\endgroup$
    – Aryabhata
    Jan 21, 2011 at 21:12
  • $\begingroup$ And if we require x to be positive, we look for solutions of the polynomial $\gt 1$. $\endgroup$
    – Aryabhata
    Jan 21, 2011 at 21:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .