0% found this document useful (0 votes)
7 views6 pages

Exp 1 Bisection Method

The Bisection Method is a bracketing technique used to find the roots of a function by starting with two initial guesses that bracket the root. It involves successively halving the interval and updating the guesses based on the sign of the function values until the desired accuracy is achieved. An example C program demonstrates the method using the function f(x) = x^3 - 9x + 1, resulting in an approximated root of x2 = 0.1113 after 9 iterations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views6 pages

Exp 1 Bisection Method

The Bisection Method is a bracketing technique used to find the roots of a function by starting with two initial guesses that bracket the root. It involves successively halving the interval and updating the guesses based on the sign of the function values until the desired accuracy is achieved. An example C program demonstrates the method using the function f(x) = x^3 - 9x + 1, resulting in an approximated root of x2 = 0.1113 after 9 iterations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 6

ROOTS OF THE

EQUATION:BRACK
ETING
METHODS(BISECTI
ON)
BISECTION METHOD
Bisection is a bracketing method and starts with two
initial guesses say x0 and x1 such that x0 and x1
brackets the root i.e; f(x0).f(x1)<0
To find out the root of f(x)=0 , we have to consider intervals
in such a way that it satisfies intermediate value theorem.

Intermediate value theorem :


Consider x0, f(x0) negative
Consider x1,f(x1) positive
f(x0).f(x1)<0
The root lies between x0 and x1.
Root is obtained in bisection method by successive halving the interval i.e; if x0 and
x1 are two initial guesses then we compute new approximated root as :

x2 = (x0 +x1)/2

Now we have two following conditions:

• If f(x0).f(x2)<0 then root lies between x0 and x2. Then, x1=x2.

• If f(x0).f(x2)>0 then root lies between x1 and x2 . Then, x0=x2.

And then process is repeated untill we find the root within the desired accuracy.
ALGORITHM
1. start
2. Define function
3. Define desired accuracy e
4. Choose initial guesses x0 and x1 such that f(x0).f(x1)<0
5. Calculate new approximated root as x2=(x0+x1)/2
6. Calculate f(x0)f(x2)
a. If f(x0)f(x2)<0, then x0=x0 and x1=x2
b. If f(x0)f(x2)>0, then x0=x2 and x1=x1
7. If |f(x2)|>e then go to (5) otherwise go to (8)
8. Display x2 as root
9. Stop
C PROGRAMME FOR
BISECTION METHOD
Suppose a function f(x)= x3-9x+1 is given. We have to complie a C-
programme to find the roots of this function. So we can compile the
programme as follows:
Output :
ANALYSIS
After two initial values for which the given function satisfies the intermediate
value theorem i.e; f(x0).f(x1)<0 is given as input in the programme and thus
we see from the 1st iteration, the function value is negative and as given
condition in 2nd iteration x1 replaces x2 and x0 remains the same while, in
the 4th iteration, the function value becomes positive and x0 replaces x2 and
x1 remains the same. Thus for a desired accuracy defined e=0.001, the 9th
iteration shows the function value f2=-0.000573 which is accurate upto
three decimal points and whose absolute value that is defined by fabs in the
programme less than e. So, the function is terminated here after 9th iteration
and we get the approximated root x2=0.1113 (upto 4 decimal points).

You might also like