False Position Method
Description: The False Position Method (also known as Regula False Method) is an iterative
numerical technique for finding the root of a real-valued function, specifically for equations of
the form f(x) = 0. The method starts with two initial guesses x 1 and x 2 , such that f( x 1)*f( x 2)<
0,ensuring a root exists between them.
The core idea is to draw a straight line between the points ( x 1,f( x 1)) and ( x 2,f( x 2)), and find
where this line crosses the x-axis. This point is then used as the new guess, refining the estimate
of the root with each iteration.
Formula:
f ( x 1 )∗(x 2−x 1)
x0 = x1 −
f ( x 2 )−f ( x 1 )
Algorithm for False Position Method
1. Define Function: f(x)= x 2 −x−2.
2. Input Values:
o Enter x 1, x 2
o Input number of iterations n.
3. Iterate:
For i=0 to n-1:
o Compute
f ( x 1 )∗(x 2−x 1)
x0 = x1 −
f ( x 2 )−f ( x 1 )
o If f ( x 0)=0, print root and exit.
o If f ( x 0)*f ( x 1)< 0, set x 2= x 0; otherwise, set x 1= x 0.
o Print iteration and x 0.
End.
Sample Input:
Sample Output: