# Solve $\log\left(\frac{1.07^x}{1050-2.5x}\right)=\log\left(\frac{1.2}{828}\right)$ for $x$.

How do I solve for $x$:

$$\log\left(\frac{1.07^x}{1050-2.5x}\right)=\log\left(\frac{1.2}{828}\right)$$

If I raise both sides to the power of $10$, I get: $\dfrac{1.07^x}{1050-2.5x}=\frac{1}{690}$

Then I'm stuck. How do I solve this ?

As suggest by @Kevin, I have decided to add my take here:

One way I could solve this is using Linear Interpolation Approximation.

We have,

$\frac{1.07^x}{1050-2.5x}=\frac{1}{690}$

$1-690\frac{1.07^x}{1050-2.5x}=0$

We need to get the LHS as close to $0$ as possible.

At $x=5(A)$,

LHS $\simeq$ 0.067219 (a)

Since LHS at $x=5$ is greater than $0$, we try at $x=7(B)$

LHS $\simeq$ -0.07311 (b)

Since LHS at $x=7$ is less than $0$,

$5<x<7$

Thus by interpolation,

$x=[A+\frac{a}{a-b}(B-A)]=[5+\frac{0.067219}{0.067219-(-0.07311)}(7-5)]\simeq5.958$

• You will need the Lambert W function to solve this, or resort to numerical computation. – Yves Daoust Aug 23 '17 at 7:56
• It's a problem of the form $$A^x + Bx = C$$ it has no pretty solution, unfortunately. – Alvin Lepik Aug 23 '17 at 7:56
• I think that the equation has been arranged to yield $x=6$ (the constant $1.07$ should be $\sqrt{1.5}\approx 1.069913\cdots$. – Yves Daoust Aug 23 '17 at 10:35
• But for what course is this ? – Yves Daoust Aug 23 '17 at 10:38
• @YvesDaoust This is for investment analysis. It could be used for calculating Internal Rate of Return. In this particular case, I'm trying to estimate expected bond call date given the conversion value, call price and the call policy. – thethakuri Aug 23 '17 at 10:43

## 3 Answers

As said in comments, the solution is given in terms of Lambert function.

If you plot the function $$f(x)=\frac{1.07^x}{1050-2.5x}-\frac{1}{690}$$ you should notice that the solution is very close to $x=6$; this means that you could start Newton method and converge quite fast as shown below $$\left( \begin{array}{cc} n & x_n \\ 0 & 6\\ 1 & 5.993055006 \\ 2 & 5.993053313 \\ 3 & 5.993053313 \end{array} \right)$$ Sooner or later, you will lear than any equation which can write or rewrite as $$A+B x+C \log(D+Ex)=0$$ has solution(s) in terms of Lambert function.

After seeing the plot of the function, the orders of magnitude are such that in a first approximation the $x$ at the denominator can be ignored, and you get

$$x\approx\log_{1.07}\frac{1050}{690}=6.2054\cdots.$$

As said by Claude, next approximations are given by Newton, and two or three iterations should be enough.

After simplification the second approximations is

$$\frac{C\ln C}{C\ln A+B}=5.99452\cdots.$$

Not too bad.

The next approximation is probably good enough for practical applications, but is a little less "sexy" when expanded:

$$\frac{\left(\dfrac{C\ln C\ln A}{C\ln A+B}-1\right)A^{\frac{C\ln C}{C\ln A+B}}+C}{A^\frac{C\ln C}{C\ln A+B}\ln A+B}=5.99305338\cdots$$

It's convenient to rewrite the equation to be solved for $x$ as

$$690\cdot1.07^x+2.5x=1050$$

As others have indicated in comments and answers, equations of this form cannot, in general, be solved exactly; the best that can done is a numerical approximation. There are various ways to go about obtaining approximations, and depending on what you're trying to learn, it can be worth trying several of them to see how well they work (e.g., how quickly they get to an acceptable number of digits). If, however, you just want to get a few digits accuracy for this problem, and if you're willing to play around with a bit of computation (which in this day and age costs next to nothing), then a simple, intuitive approach may be all you need.

The key observation to make is that the left hand side of the equation defines a function, $f(x)=690\cdot1.07^x+2.5x$ that is strictly increasing.. That's because it's the sum of an exponential function, $690\cdot1.07^x$ and a linear function $2.5x$, each of which individually is strictly increasing. The importance of this is that if you try a value for $x$ and $f(x)\gt1050$, then you know you've tried a value that's too big, while if $f(x)\lt1050$, then you've tried a value that's too small. Moreover, if $f(x)\approx1050$, then you're close to the value you want.

With a little playing around, you're likely to find that

$$f(6)=1050.50394278\ldots$$

which is just barely too big, so it's worth computing

$$f(5.9)=1043.27151078\ldots$$

which is too small. This tells us that $5.9\lt x\lt6$ and is probably closer to $6$ than it is to $5.9$. A little more playing around gives

$$f(5.99)=1049.77857176\ldots$$

which is still too small, but if you're happy with two digits accuracy you might stop here and say $x\approx5.99$. If you want additional accuracy, some additional playing around reveals

$$f(5.993)=1049.99613331\ldots$$

which is probably as close as you need to get (for an investment analysis, at least, which is where the OP said in comments the problem comes from).

The "playing around" can be streamlined if you know about linear interpolation. It's worth noting, though, that linear interpolation involves its own separate calculation requiring four inputs: the value of $x$ that's too big, the value that's too small, and the function value of each. I found it easier to simply enter the expression "690*1.07^6+2.5*6" into Google, and then change the 6's into 5.9's, then 5.99's, etc. (That's also why I reported the $f(x)$ values to $8$ digits: it was as easy to cut and past the entire result as it was to cut and paste just a portion.) Actually I tried 5.995 before I tried 5.993; it was easier to try splitting the difference between 5.99 and 6 first than it was to think about which one gave a function value closer to $1050$.