is drawn without including the horizontal lines back to the y-axis, a diagram known as the cobweb diagram is formed, where a spiral has points which get closer to the fixed point. From the graphs, I discovered that the x values get closer and closer to the fixed point, or converge.
- Repeat the process, but this time let g(x) = 2cosx. Comment on your results and interpret them graphically.
Here, the calculations are still the same, and the fact that x1 = 1 still applies. Therefore, we do the same steps and get the results as shown below.
1st iteration, n = 1 2nd iteration, n = 2 3rd iteration, n = 3
x1+1 = g(x1) x2+1 = g(x2) x3+1 = g(x3)
x2 = 2cos x1 x3 = 2cos x2 x4 = 2cos x3
x2 = 2cos 1 ≈ 1.081 x3 = 2cos 1.081 ≈ 0.941 x4 = 2cos 0.941 ≈ 1.178
4th iteration, n = 4 5th iteration, n = 5
x4+1 = g(x4) x5+1 = g(x5)
x5 = 2cos x4 x6 = 2cos x5
x5 = 2cos 1.178 ≈ 0.766 x6 = 2cos 0.766 ≈ 1.441
When this is graphed, it can be seen that instead of converging closer into the fixed point, it diverges out. This is interesting because it is caused just by the coefficient added to the cosine, and also because it shows that the coefficient, apart from changing where cosine crosses the y-axis, also has a different role to play. At this point, only the hypothesis that the steepness/coefficient of the cosine line is what causes the difference between whether the function converges to or diverges against the fixed point.
-
Repeat this process for g(x) = a cos x, using some other values between a = 1 and a = 2 to discover which converge to a positive fixed point for g(x). Suggest why this only happens for some values of a.
For this, the value of x1 was still assumed to equal 1, while the value of a that was chosen to begin with was a = 1.1. Then, it was decided that the value of a would keep on increasing until 0.1 until the point where a divergence happened.
Half way through doing this, I was able to deduce that the smaller the coefficient, the further the points are to the fixed point. However, when a = 1.4, it was realized that somewhere in between that point and a = 1.3 was the point where it stopped converging and started to diverge. Thus, I decided to focus in between these two points.
From this table, it is evident that the numbers that are lesser than 1.33 and some in between 1.32 and 1.33 converge to a fixed point for g(x). This happens probably due to the steepness of the cosine line.
-
Determine for which value of a the iteration will converge for g(x) = a sin x starting with a=1.2. Comment on differences in the graphical representation of this iteration compared to those earlier.
Here, we do the exact same thing as before, except that instead of using cosine, we use sine.
From a = 1.2 to a = 2.2, the points that are formed all converge towards the fixed point. For some of them, mainly those from 1.2 - 1.6, the x values are extremely close to each other and therefore their graphs would not show their differences and convergences clearly. However, starting from a = 1.8, it is interesting to see how the points formed actually do converge, despite the drop in the middle. This is interesting, and is due to the curve of the sine line. They are mainly different from the cosine iterations in graphical representation in that they do not form a spiral shape. The diagrams below represent the graphs when a = 1.8, a = 2, and a = 2.2.
a = 1.8 (on the right, and bottom)
a = 2
a = 2.2
Part 2
-
Show that the equation f(x) = 0 can be rearranged in the form x = x3- 1 and use an iteration to try to find the root of the equation. Describe and explain what happened.
The original equation that was given was x3- x - 1 = 0. To make it in the form that is stated in the question, all that needs to be done is just to add x to both sides of the equation. So now,
g(x) = x = x3- 1. This would then mean that g(xn) = xn+1, and that xn+1 = xn3- 1. Therefore, that would be the iteration. And if we stick with x1 = 1, the calculations would be as followed.
n = 1 → x2 = x13 – 1 → x2 = 13 – 1 = 0 n = 2 → x3 = x23 – 1 → x3 = 03 – 1 = -1
n = 3 → x4 = x33 – 1 → x4 = -13 – 1 = -2 n = 4 → x5 = x43 – 1 → x5 = -23 – 1 = -9
n = 5 → x6 = x53 – 1 → x6 = -93 – 1 = -730
In order to see if any interesting patterns had happened, I started from the point (1, 0), and I noticed that that was also the point where the function and x = 0 intersect. Then, I traced that back to the y = x line. At their intersection, I traveled directly down, and that led me to where the function and x = -1 intersected. I then traced that back to the y = x line again and traveled directly down. This also led me to where the function and x = -2 intersected. This was continued with the fourth root, and I realized that the roots diverged from the fixed point, but at the same time, they formed a very visible ladder-shape pattern. The x = -730 line is not visible in this graph because was too far apart, but the ladder-shape pattern would have continued even with that being far away from x = -9.
- Rearrange the equation in different ways in the form x = g(x) and try new iterations, to discover which converge on the root. Explain graphically why they converge.
In order to rearrange the equation in different ways, the first thing that could be done is to add one to both sides, making the equation x3- x = 1. Then, the x on the left side of the equation can be factored out, making it, x (x2- 1) = 1, and so that only x is on one side of the equation, we divide 1 by the quantity (x2- 1), giving us x = 1/(x2- 1). Thus from here, we repeat how g(xn) = xn+1 = 1/(xn2-1), however, this time we will be changing x1 = 2. The calculations are as follows.
n = 1 → x2 = 1/(x12 –1) → x2 = 1/(22 –1) → x2 = 1/3 ≈ 0.333
n = 2 → x3 = 1/(x22 –1) → x3 = 1/((1/3)2 –1) → x3 = -9/8 ≈ -1.125
n = 3 → x4 = 1/(x32 –1) → x4 = 1/((-9/8)2 –1) → x4 = 64/17 ≈ 3.365
n = 4 → x5 = 1/(x42 –1) → x5 = 1/((64/17)2 –1) → x5 = 289/3807 ≈ 0.076
n = 5 → x6 = 1/(x52 –1) → x6 = 1/((289/3807)2 –1) → x6 ≈ -1.006
Unfortunately, this did not end up working at all, and the graph did not show any kind of pattern, relationships between the lines, or signs of convergence.
c) Repeat steps (a) and (b) for the following equations: (i) x5 – x – 2 =0 (ii) x3 –2x – 4 =0
-
Add x to both sides of the equation to get x5 – 2 = x. This would result it to be
g(xn) = xn+1 = xn5- 2, where x1 = 1. The results would then be as follows.
n = 1 → x2 = x15 – 2 → x2 = 15 – 2 = -1 n = 2 → x3 = x25 – 2 → x3 = -15 – 2 = -3
n = 3 → x4 = x35 – 2 → x4 = -35 – 2 = -245
And yet again, the ladder pattern appears, and although the graph does not show all five iterations, the two x values that have been graphed are sufficient to show that the ladder pattern will continue, and that the points diverge instead of converge.
Now, in order to rewrite the equation again, we add 2 to both sides of the equation to make it
x5 – x = 2, and then factor out an x on the left side of the equation, giving us x( x4-1) = 2. Finally, we divide both sides by the quantity (x4-1) to make x = 2/(x4-1). Then, again create the iteration
xn = 2/(xn4-1) using x1 = 2.
n = 1 → x2 = 2/(x14-1) → x2 = 2/(24-1) = 2/15 = 0.133
n = 2 → x3 = 2/(x24-1) → x3 = 2/((2/15)4-1) = -2.001
n = 3 → x4 = 2/(x34-1) → x4 = 2/((-2.001)4-1) = -0.117
n = 4 → x5 = 2/(x44-1) → x5 = 2/((-0.117)4-1) = -2.000
n = 5 → x6 = 2/(x54-1) → x6 = 2/((-2)4-1) = 0.133
However, like it was the previous time, this iteration did not work and did not produce a graph that showed us the convergence.
-
x3 – 2x – 4 = 0. Add 2x to both sides of the equation to make it x3– 4 = 2x. Then, divide both sides by two, which will then make the equation (x3– 4)/2 = x. That is then changed into the iteration xn+1 = (xn3- 4)/2, and we will solve this by using x1 = 1.
n = 1 → x2 = (x13-4)/2 → x2 = (13 – 4)/2 = -3/2 = -1.5
n = 2 → x3 = (x23-4)/2 → x3 = (-1.53 – 4)/2 = -3.688
n = 3 → x4 = (x33-4)/2 → x4 = (-3.6883 – 4)/2 = -27.081
Like the previous two, this graph also contains a divergence, and the ladder-shape pattern.
So, to form a different iteration, we could add 2x + 4 on both sides to make the equation
x3 = 2x + 4. Then, the cubed root can be taken, to give the equation x = (2x + 4)1/3. This would then lead to xn+1 = (2xn + 4)1/3 , with using x1 = 1.
n = 1 → x2 = (2x1 + 4)1/3 → x2 = (2 ∙1 + 4)1/3 = 1.817
n = 2 → x3 = (2x2 + 4)1/3 → x3 = (2 ∙1.817 + 4)1/3 = 1.969
n = 3 → x4 = (2x3 + 4)1/3 → x4 = (2 ∙1.969 + 4)1/3 = 1.995
n = 4 → x5 = (2x4 + 4)1/3 → x5 = (2 ∙1.995+ 4)1/3 = 1.999
n = 5 → x6 = (2x5 + 4)1/3 → x6 = (2 ∙1.999 + 4)1/3 = 2.000