Results 1 to 6 of 6

Math Help - Numerical Analysis. Bisection method.

  1. #1
    Junior Member
    Joined
    Oct 2012
    From
    USA
    Posts
    37

    Numerical Analysis. Bisection method.

    What will happen if the bisection method is used with the function f(x) = tan(x) and
    a) [3,4]
    b) [1,3]

    Attempt:

    Check the signs of the function:

    f(x) = tan(x)
    a) f(3)*f(4) = -0.165 <0 => the root is between 3 and
    b) f(1)*f(3)= -0.222<0 => the root is between 1 and 3 ,

    but this is obviously wrong.

    Please, help.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor
    Joined
    Sep 2012
    From
    Australia
    Posts
    4,169
    Thanks
    765

    Re: Numerical Analysis. Bisection method.

    Hey vercammen.

    Are you trying to find the root to f(x) = tan(x) = 0 with the bisection method?
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Super Member
    Joined
    Dec 2012
    From
    Athens, OH, USA
    Posts
    712
    Thanks
    297

    Re: Numerical Analysis. Bisection method.

    Remember, the bisection root finding method works for continuous functions on the interval. So the bisection method applied to tan(x) on [3,4] does fine. But tan(x) has an infinite discontinuity on [1,3] at x=pi/2. So there's no reason to suppose bisection will work; in fact tan(x) is never 0 on [1,3].
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Junior Member
    Joined
    Oct 2012
    From
    USA
    Posts
    37

    Re: Numerical Analysis. Bisection method.

    The question asks "What will happen if the bisection method is used with the function..." . I guess I need to answer that. I'm confused...
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Super Member
    Joined
    Dec 2012
    From
    Athens, OH, USA
    Posts
    712
    Thanks
    297

    Re: Numerical Analysis. Bisection method.

    If you apply the bisection method and get the sequence {xn}, then xn approaches pi/2 as n approaches infinity. I really don't want to give an analytic proof of this, but if you try it by hand, you'll see what is happening. Alternatively, write a little program to compute say the first 1000 terms to see what you get:

    #include <stdio.h>
    #include <math.h>

    double bisect(double (*f)(double),double x0, double x1, int n);

    int main(void) {
    double x0=1,x1=3,result;
    result=bisect(tan,x0,x1,1000);
    printf("After 1000 iterations, xn = %g with tan(xn) = %g\n",result,tan(result));
    return(0);
    }

    /* bare bones bisection method; not really a workable version since no
    tolerance is supplied, just do the method n times.
    */
    double bisect(double (*f)(double x), double x0, double x1, int n) {
    double m;
    int i;
    for (i=1;i<=n;i++) {
    m=(x0+x1)/2;
    if ((*f)(m)*(*f)(x0)<0) {
    x1=m;
    }
    else {
    x0=m;
    }
    }
    return(m);
    }

    The above program produces result 1.5708 (approximately pi/2) with
    tan(result)=1.63e+016, as expected a large value in magnitude.
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Member
    Joined
    Apr 2012
    From
    Erewhon
    Posts
    202
    Thanks
    133

    Re: Numerical Analysis. Bisection method.

    Quote Originally Posted by vercammen View Post
    The question asks "What will happen if the bisection method is used with the function..." . I guess I need to answer that. I'm confused...
    The bisection method finds points at which the function changes sign, which yours does do at the singular points, so if you start with an interval [1,3] it will converge to the singularity at \pi/2.

    .
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Replies: 3
    Last Post: March 31st 2010, 08:57 PM
  2. Numerical Analysis Bisection Method Problem
    Posted in the Calculus Forum
    Replies: 5
    Last Post: January 19th 2009, 12:46 PM
  3. Secant Method (Numerical Analysis)
    Posted in the Calculus Forum
    Replies: 1
    Last Post: October 27th 2008, 05:47 AM
  4. Newton's Method: Numerical Analysis
    Posted in the Advanced Applied Math Forum
    Replies: 3
    Last Post: June 12th 2008, 02:33 PM
  5. Replies: 3
    Last Post: November 3rd 2007, 02:43 PM

Search Tags


/mathhelpforum @mathhelpforum