How to solve log(x)-x+2=0 for x?

  • Context: Undergrad 
  • Thread starter Thread starter rukawakaede
  • Start date Start date
Click For Summary

Discussion Overview

The discussion revolves around solving the equation log(x) - x + 2 = 0, and more generally log(x) - x + c = 0, where c is a constant. Participants explore various methods for finding solutions, including graphical approximations and the use of the Lambert W function, while also considering the nature of the solutions (real vs. complex).

Discussion Character

  • Exploratory
  • Technical explanation
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • Some participants suggest that there are no elementary solutions and recommend graphing as a practical approach.
  • Others propose that a closed-form solution can be obtained using the Lambert W function, noting that there are two solutions when c > 1.
  • One participant describes a transformation of the equation into a form suitable for applying the W function, indicating that while there are infinitely many complex solutions, only two are real.
  • Another participant introduces fixed point iteration as a method to find real solutions without using the Lambert W function, explaining how to set up the iteration scheme.
  • Some participants express a view that the problem has deeper implications and suggest exploring complex solutions as a more enriching approach.

Areas of Agreement / Disagreement

Participants generally agree that there are no elementary solutions and that the Lambert W function is relevant, but there is disagreement on the focus of the discussion, with some emphasizing real solutions and others advocating for the exploration of complex solutions.

Contextual Notes

Participants mention the limitations of finding implementations of the Lambert W function outside specific software environments, and the convergence properties of fixed point iteration methods are noted as potentially slow.

Who May Find This Useful

This discussion may be useful for those interested in advanced mathematical methods for solving transcendental equations, particularly in the context of real and complex analysis.

rukawakaede
Messages
58
Reaction score
0
Hi,

Could anyone give me some ideas on how to solve the following question:

log (x) - x + 2 = 0

or generally

log (x) -x + c = 0 where c is a constant.

I know how to approximate this by graphing but is there any general method(s) to obtain an exact solution for equations of this type?

Thanks!
 
Mathematics news on Phys.org
There are no elementary solutions for this problem. The easiest thing to do is to graph it. To get a "closed" form solution will require the Product Log function:

http://mathworld.wolfram.com/LambertW-Function.html

Also note that there are two solutions to your equation.
 
Nevermind...
 
DivisionByZro said:
There are no elementary solutions for this problem. The easiest thing to do is to graph it. To get a "closed" form solution will require the Product Log function:

http://mathworld.wolfram.com/LambertW-Function.html

Also note that there are two solutions to your equation.

Yes, there are two solutions if c > 1.
Thanks, I will look at the product log function stuff.
 
JG89 said:
Nevermind...

No worries.
 
rukawakaede said:
but is there any general method(s) to obtain an exact solution for equations of this type?

Thanks!

\log(x)=x-2

x e^{2-x}=1

-xe^{-x}=-\frac{1}{e^2}

Now take the W function of both sides:

x=-W(-\frac{1}{e^2})

Now, the W-function is infinitely valued and so there are an infinite number of solutions to this equation.
 
jackmell said:
Now, the W-function is infinitely valued and so there are an infinite number of solutions to this equation.
<br /> While there an infinite number of solutions in the complex numbers, there are only two solutions in the reals.
 
Hi rukawukaede. The W(x) function has infinitely many complex solutions, but only zero, one or two real solutions (x,W(x) real).

- For -1/e < x < 0 it has two real solutions (your case).

- For x < -1/e it has no real solutions.

- otherwise it has a unique real solution.
 
Without use of the Lambert W function (you will be hard put to find implementations outside of Mathematica, Maple, or Matlab) there is a very simple technique you can use to find the real solutions to

x - \log x = c,\,\,c&gt;=1

Fixed point iteration can be used to find both solutions. Note that the above is equivalent to x=\log x + c. Writing this as a fixed point iteration scheme,

x_{n+1} = \log x_n + c

Simply start with some initial guess x_0 and iteratively generate x_1, x_2, etc. using the above. If the sequence {x_0, x_1, x_2, \cdots} does converge, it will converge at one of the solution points. An initial guess of 1 will always converge. It will take a while if c is fairly close to 1. Fixed point iteration is very simple but it can be very slow to converge.

In fact, this will only find the larger of the two solutions. So how to find the other solution? Since exp(x) is a bijection, we can go from x-\log x = c to \exp(x)/x = \exp(c), or x = \exp(x-c). This suggests another fixed point iteration scheme,

x_{n+1} = \exp(x_n-c)

If this sequence converges it will converge to the smaller of the two solutions, and once again, an initial value of 1 will always result in a convergent sequence. Once again the convergence is rather slow when c is just slightly larger than 1.
 
  • Like
Likes   Reactions: Ian Heath
  • #10
Oh man, you guys are missin' the beauty of this problem by using "real" blinders and he didn't say anything about real solutions neither. It's like just the tip of the iceberg; whole nother world down below the surface which makes crystal-clear many problems above. I say not only solve it, but draw it, then pick out the (complex) solutions like ornaments on an (upside-down) christmas tree. That to me is one of the real beauties of mathematics. Yeah, that's the assignment then, figure out how this problem is like a christmas tree turned upside-down.
 

Similar threads

  • · Replies 16 ·
Replies
16
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 4 ·
Replies
4
Views
2K