# y-log(y)=x

• July 10th 2006, 07:28 AM
dan
y-log(y)=x
does any body know how to write an iteration to compute y in y-log(y)=x ?
thank's,
dan
• July 10th 2006, 08:08 AM
CaptainBlack
Quote:

Originally Posted by dan
does any body know how to write an iteration to compute y in y-log(y)=x ?
thank's,
dan

Is x a known constant or a variable?

RonL
• July 10th 2006, 09:09 AM
ThePerfectHacker
(I assume your question is on Newton's Method cuz that is what you asked the other time).

You want to solve,
$y-\ln y =x$
Which is equivalent to,
$y-\ln y-x=0$
The iteration sequence is,
$
a_{n+1}=a_n-\frac{f(a_n)}{f'(a_n)}
$

Where,
$f=y-\ln y-x$
Thus,
$f'=1-1/y$
Thus,
$f(a_n)=a_n-\ln a_n-x$
$f'(a_n)=1-1/a_n$
Thus,
$a_{n+1}=a_n-\frac{a_n-\ln a_n-x}{1-1/a_n}$
Simplfy,
$a_{n+1}=a_n-\frac{a_n-\ln a_n-x}{\left(\frac{a_n-1}{a_n} \right)}$
More simplfying,
$a_{n+1}=a_n-\frac{a_n^2-a_n\ln a_n-xa_n}{a_n-1}$
And yet one more time, (watch those signs :eek: )
$a_{n+1}=\frac{a_n^2-a_n-a_n^2+a_n\ln a_n -xa_n}{a_n-1}$
Finally we have,
$a_{n+1}=\frac{a_n(\ln a_n-x-1)}{a_n-1}$
• July 10th 2006, 10:00 AM
dan
y-log(y)=x
Ok ,
I think you might have lost me… I suppose the a with the little n (How do you write that anway?) is your initial value but you lost me on how to compute that.
Sorry about my slow mind :confused: .
dan
• July 10th 2006, 10:14 AM
CaptainBlack
Quote:

Originally Posted by dan
Ok ,
I think you might have lost me… I suppose the a with the little n (How do you write that anway?) is your initial value but you lost me on how to compute that.
Sorry about my slow mind :confused: .
dan

$a_0$ will be your initial guess, then the itteration formula gives
$a_{n+1}$ in terms of $a_n$, so you get a sequence:

$a_0,\ a_1,\ .. \ a_n,\ ..$,

which with luck will converge to the required solution.

RonL
• July 10th 2006, 12:47 PM
dan
y-log(y)=x
so...
a_0 =1-1/x ???? I think I'm lost. I need a way to calulate a_0 in relation to x...I think :confused: I gues they should't let people like me on calculus forums :rolleyes:
dan
• July 10th 2006, 01:02 PM
ThePerfectHacker
Quote:

Originally Posted by dan
so...
a_0 =1-1/x ???? I think I'm lost. I need a way to calulate a_0 in relation to x...I think :confused: I gues they should't let people like me on calculus forums :rolleyes:
dan

$a_0$ is the initial guess. You do not calculate you guess.
• July 10th 2006, 01:12 PM
dan
y-log(y)=x
Just any old random guess?? I know that some iterations have a formula for making that guess. But if x = 10 I could just guess 14 and it would still approach??
Dan
• July 10th 2006, 01:30 PM
CaptainBlack
Quote:

Originally Posted by dan
Just any old random guess?? I know that some iterations have a formula for making that guess. But if x = 10 I could just guess 14 and it would still approach??
Dan

With $x \gg 1$, then $a_0=x$ should be OK. But then experimenting with the
iteration as given by PH it appears to diverge with $x=10$, $a_0=10$ or $14$!

It must be a mistake in PH's algebra as the iteration (which is what PH had before he tried simplifying it):

$
a_{n+1}=a_n-\frac{a_n^2-a_n\ln(a_n)-xa_n}{a-1}
$

does converge with $x=10, a_0=10$, to $\approx 12.528$ after two iterations.

RonL
• July 10th 2006, 02:15 PM
Jameson
PH: Some slight errors in your algebra.

Starting from here: $
a_{n+1}=a_n-\frac{a_n^2-a_n\ln a_n-xa_n}{a_n-1}
$

For the next step you wrote:
Quote:

Originally Posted by ThePerfectHacker
$
a_{n+1}=\frac{a_n^2-a_n-a_n^2+a_n\ln a_n -xa_n}{a_n-1}
$

When I think it should be:

$a_{n+1}=\frac{a^2_{n}-a_{n}}{a_{n}-1}-\frac{(a_n^2-a_n\ln a_n-xa_n)}{a_{n}-1}$

$a_{n+1}=\frac{a^2_{n}-a_{n}-a^2_{n}+a_{n}\ln(a_{n})+xa_{n}}{a_{n}-1}$

And factoring: $a_{n+1}=\frac{a_n(\ln(a_n)+x-1)}{a_n-1}$
• July 10th 2006, 02:33 PM
ThePerfectHacker
I realized.
• July 10th 2006, 06:09 PM
malaygoel
Quote:

Originally Posted by dan
does any body know how to write an iteration to compute y in y-log(y)=x ?
thank's,
dan

I don't know whether it is an iteration formula or not.
You are given x
Guess any value of a(a is iterating variable, should be greater than x)
Find $\frac{a + loga + x}{2}$
You will get some value
this is your next value of a
Substitute it again in the above expression.
After some steps it will give the answer(when you the same value of a for two times)

Keep Smiling
Malay
• July 10th 2006, 07:36 PM
CaptainBlack
Quote:

Originally Posted by malaygoel
I don't know whether it is an iteration formula or not.
You are given x
Guess any value of a(a is iterating variable, should be greater than x)
Find $\frac{a + loga + x}{2}$
You will get some value
this is your next value of a
Substitute it again in the above expression.
After some steps it will give the answer(when you the same value of a for two times)

Keep Smiling
Malay

The more direct:

$a_{n+1}=\ln(a_n)+x$

seems to converge faster at least near x=10.
• July 11th 2006, 04:22 AM
malaygoel
Quote:

Originally Posted by malaygoel
I don't know whether it is an iteration formula or not.
You are given x
Guess any value of a(a is iterating variable, should be greater than x)
Find $\frac{a + loga + x}{2}$
You will get some value
this is your next value of a
Substitute it again in the above expression.
After some steps it will give the answer(when you the same value of a for two times)

Keep Smiling
Malay

I checked it.
It works
You could take any starting value of a

Keep Smiling
Malay
• July 11th 2006, 04:39 AM
CaptainBlack
Quote:

Originally Posted by malaygoel
I checked it.
It works
You could take any starting value of a

Keep Smiling
Malay

I did check it perhaps the comment the the other iteration converged
faster disguised the fact that I knew it converged for reasonable starting
values and values for x.

Try a_0=0.000001 with x=10 :p

RonL