# On f(x)=x

1. Mar 27, 2005

### hedlund

Suppose f is a function. How can we solve the equation f = x? I think I've found an interesting new way, I'm not sure it's correct however. Say we want to solve the equation cos(x)=x, then a suitable way to solve this equation is to use Newton-Raphson to get a solution. But I think I've found a method that also converges, not as quickly however. Make a guess x0 for cos(x)=x. Calculate cos(x0) = x1, calculate cos(x1) = x2, calculate cos(x2) = x3 and so on. So we use x_(n + 1) = f(n). To demonstrate this method I solve the following equation:

1. cos(x)=x, start with a seed, I chose x0=-100 just to show that it does in deed seem to converge. This gives with the first 10 calculations:

0.84598898198358890274
0.78815472769682836497
0.76151115452367370362
0.74929854146798181945
0.74372766089317781727
0.74119341653274063166
0.74004213182177068154
0.73951944851492685807
0.73928222045897252958
0.73917456532965709331

cos(x)-x=0.00011648598787101138

2. ln(x)=x, start with a seed, I chose x0 = 1000. This gives:

0.31725931762133114611+1.33153507953496342211i
0.31718629567450052325+1.34014616816598811224i
0.31927011778936558593+1.33608733612343809223i
0.31731905625121883267+1.3375069028202560968i
0.3185799875460203639+1.33730100833347268442i
0.3179351563786906755+1.3370979004383313528i
0.31819146448512503102+1.33734761595800791012i
0.31812984714983422095+1.33716852678175367383i
0.31811627833445380074+1.33726784220316782635i
0.31814636098265470986+1.33722414212673179521i

This is quite good x-ln(x) = 0.00095307601525015884-0.01187533532322322971i

3. cos(x)^2=x, seed x=1000, gives:
~0.90326410456638764967
~0.86019033654796716573
~0.82962596896246371156
~0.80621728441276723759
~0.78742570290033394307
~0.77185503812233617185
~0.75865872241297805902
~0.74728626630218568701
~0.73736019802076276074
~0.72861058786690100970

This isn't good, since cos(x)^2-x = -0.1719 ..., however calculating more terms, like 100 terms gives cos(x)^2 - x = 0.00004448970614357726

I want to know if this is new and if it does in fact converge to a root of the equation?

Last edited: Mar 27, 2005
2. Mar 27, 2005

### CrankFan

have you tried this method for $$f(x) = x^2$$

3. Mar 27, 2005

### arildno

hedlund:
What you're doing is well known; cool that you discovered it on your own.

4. Mar 27, 2005

### Zurtex

Oh right I see, I was a silly confused what he was applying there.

I suggest you try this itteration mathod:

$$x_n = x_{n-1} + A(\cos x_{n-1} - x_{n-1})$$

For different values of A to try and see which ones converge quickly, some converge at a very fast rate, some converge at a slow rate like your example (some diverge at a very fast rate)

5. Mar 27, 2005

### hedlund

CrankFan:

I doesn't converge to a root if |x0| > 1. If I choose |x0| < 1 it does in fact converge to a root. So it's basicially useless for polynomials, since you need to know how big the seed needs to be for it to converge.

Zurtex:

I'm aware of the fact that it is slow. However I was just playing around with some functions and noticed it seemed to converge. To:

"What do you know about these sort of algorithms? What kind of methods do you think are most effective? I struggle to belive the Newton-Raphson method appropriately used converges so close, have you tried checking the gradient of the function around the area to make sure it's appropriate?"

I hardly understand half of the words you use, I don't know what methods are the most effective methods. I don't know what a gradient is (at least I don't know what the word means in English, I might know it in Swedish however).

arildno:

So this isn't new? I thought it was, since I had never seen it before. Do you know the name of this method for solving equations? I would like to read more, to actually see why it works. I might not understand why it works, but I would like to have a look at it. I agree with you that it's cool to discover things, and I often discover things by just playing around.

6. Mar 27, 2005

### Muzza

Looks a lot like fixed point iteration.

7. Mar 27, 2005

### arildno

hedlund:
If I remember correctly, the convergence criterion should be
$$|f(x_{n})-f(x_{n-1})|<k|x_{n}-x_{n-1}|<1, n=1,\cdots$$
something like that, anyways.

Last edited: Mar 28, 2005
8. Mar 27, 2005

### Zurtex

I'm sorry but my Swedish isn't that brilliant, I'll ask one of my friends in a couple of days in my maths class if any of them can type in swedish, I'm sure I remember one or 2 of them being able to.

9. Mar 27, 2005