4
$\begingroup$

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}}$$

reduced...

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

  • 3
    You don't. Find a numerical answer.2011-01-21
  • 0
    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*2011-01-21
  • 0
    try newtons method. Let us know if you need an example of newtons method.2011-01-21
  • 5
    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](http://en.wikipedia.org/wiki/Bisection_method) or [Newton's method](http://en.wikipedia.org/wiki/Newton%27s_method).2011-01-21
  • 2
    Thanks guys. Implemented Newtons method in my program :)2011-01-21
  • 1
    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$2011-01-21
  • 0
    @Myself: Depends on the magnitude of $x$. For these values, the linear approximation gives $x \approx -3\times 10^4$.2011-01-21
  • 0
    Also, it looks like the equation has no solution for your values. Here's a semi-log plot: http://www.wolframalpha.com/input/?i=plot+log%28exp%28%2890%2Bx%29%2F5000%29+%2B+exp%280.021%29%29%2C+log%28exp%28%2875%2B2495x%29%2F15000000%29%29+for+x%3D-40000..400002011-01-21
  • 0
    No closed form solution. And (I suspect) no solution for those values.2011-01-21

1 Answers 1

3

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.

  • 0
    the polynomial will have too many solutions, unnecessarily complicated!2011-01-21
  • 0
    @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.2011-01-21
  • 0
    And if we require x to be positive, we look for solutions of the polynomial $\gt 1$.2011-01-21