Rearranging the equation f(x)=0 into the form x=g(x)
If I want to solve the equation x3-x2-3x+0.5=0 we can draw a graph and read off the points where it crosses the x axis. But we can also solve it by rearranging the equation and finding where the 2 graphs cross. Both ways find the root.
x3-x2-3x+0.5=0 3x=x3-x2+0.5 x=(x3-x2+0.5)/3 So we can now plot the graphs of the 2 functions y=x and y=(x3-x2+0.5)/3 Iterative formula used to find the root.
y=x3-2x2-3x+0.5 All the same roots y=x y=(x3-2x2+0.5)/3
Using the iterative formula From the graph you can tell that there is root in the interval [0,1]. I will let my starting value x1=1 and then find x2 by substitution. x g(x) 1 2 0.166666667 3 0.158950617 4 0.159583545 5 0.159532397 6 0.159536536 7 0.159536201 8 0.159536228
What does this look like on the graph? What to do Choose a value of x, x1. Find corresponding value of g(x1). Take value g(x1) as new x, x2. Find value of g(x2). What this looks like Take starting point on x axis. Move vertically to curve. Move across to line.
What it looks like on a graph. STAIRCASE
COBWEB
Failure This method fails if at the root of y=g(x) and y=x the gradient is>1 or <-1. You need to show failure using excel too
If g ‘(x) is small then we get rapid convergence. If g ‘(x) is close to ±1 then we get slow convergence. If g ‘(x) is > ±1 then we get failure. ie divergence. You can also get failure when you find another root from what you wanted to find.