Iteration for GCSE and A Level |
Aim: To use iteration to find an approximate solution to the equation x² - x - 5 = 0.
Step 1: Rearrange the equation to get the iterative form, x² = x + 5..
Step 2: Divide both sides of the equation by x to get x = 1 + 5/x - the iterative form.
Step 3: Now write it in this form: xn+1 = 1 + 5/xn
Step 4: Use an initial value to trigger off iteration such as x0 = 1.
Step 5: We can now use the iterative formula. We can start with an initial guess of x0=1 and then use the iterative formula to repeat, until we get a value that becomes relatively constant.
Step 6: Approximate the value to the required decimal places and it is a root of the quadratic equation.
x(0) = 1
x1 = 6.0 x2 = 1.83333333333
x3 = 3.72727272727
x4 = 2.34146341463
x5 = 3.13541666667
x6 = 2.59468438538
x7 = 2.92701664533
x8 = 2.708223972
x9 = 2.84622839606
x10 = 2.75671074286
x11 = 2.81375576416
x12 = 2.77698436505
x13 = 2.80051427834
x14) = 2.78538636231
x15 = 2.79508310504
x16 = 2.78885557677
x17 = 2.79285010011
x18 = 2.79028584449
x19 = 2.79193110623
x20 = 2.79087513616
As you can see, the solution/root is getting closer to 2.79. Therefore, the answer is x = 2.79 to 2 d.p.
You can practise the above interactively with the following Python programme:
0 comments:
Post a Comment