Root-finding algorithm: Difference between revisions

Content deleted Content added
Iterative methods: added fixed point iteration as one of the root finding algorithms.
Tags: Mobile edit Mobile app edit Android app edit
top: reformatted headings of fixed point iteration to be slightly more specific and clear
Tags: Mobile edit Mobile app edit Android app edit
Line 46:
We can use the [[fixed-point iteration]] to find the root of a function. Given a function which we have set to zero to find the root (<math> f(x)=0 </math>), we rewrite the equation in terms of <math> x </math> so that <math> f(x)=0 </math> becomes <math> x=g(x) </math> (note, there are often many <math> g(x)=0 </math> functions for each <math> f(x)=0 </math> function. Next, we relabel the each side of the equation as <math> x_{n+1}=g(x_{n}) </math> so that we can perform the iteration. Next, we pick a value for <math> x_{1} </math> and perform the iteration until it converges towards a root of the function. If the iteration converges, it will converge to a root. The iteration will only converge if <math> |g'(root)|<1 </math>.
 
IfAs an example of converting <math> f(x)=0 </math> to <math> x=g(x) </math>, if given the function <math> f(x)=x^2+x-1 </math>, we will rewrite it as one of the following equations.
==== Example ====
If given the function <math> f(x)=x^2+x-1 </math>, we will rewrite it as one of the following equations.
:<math> x_{n+1}=(1/x_n) - 1 </math>,
:<math> x_{n+1}=1/(x_n+1) </math>,