Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

How to find the number of roots of the function?

  1. Apr 22, 2008 #1
    hi there
    h r u >?
    i am a high school physics teacher, and i write many software in vb.net for simulation and ...........
    the qustion
    i use newton raphson method to find a root of function but
    i want to determine the following
    1-is the function has a root or not, and then;

    2-how can i find the number of roots, and is it complex or is it real
    is there are a way or an alogrithems to find that
     
  2. jcsd
  3. Apr 22, 2008 #2

    Gib Z

    User Avatar
    Homework Helper

    Hello hamamo!

    Since you are using Newton Raphson iterative method to approximate the root of a function, I am going to assume that the functions you are dealing with here are continuous. Given that, by the "Intermediate Value Theorem", if you are given a value of x, say, 5, and the value of that function at x=5 is, suppose, -2, and also given a value of x, eg x=6, and the value of the function there is 1, then you know somewhere between x=5 and x=6 there is a root.

    More neatly stated, if f(a) < 0, and f(b) > 0, then f(x) = 0 for some value of x such that a< x < b. So if you have two values of the function, one negative and one positive, you know straight away there has to be at least 1 root in there somewhere.

    Finding the number of roots of a particular function can be a very hard task indeed. Do you have a particular type of function you are asking about? For instance, this question is well investigated and easier to answer for Polynomial functions.
     
  4. Apr 22, 2008 #3

    HallsofIvy

    User Avatar
    Staff Emeritus
    Science Advisor

    There is no way to determine the number of roots of a general function- except for the obvious: a polynomial of degree n has exactly n roots (counting multiple roots). If it has real coefficients, then the number of complex (i.e. not real) roots must be even.
     
  5. Apr 22, 2008 #4

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    You don't even know this! Just because f(a)<0 and f(b)>0 does not mean a zero exists between a and b. It means a zero or a discontinuity exists between a and b. For example, consider the function f(x)=1/x. Note that f(-1)=-1 and f(1)=1, but this function of course has no zeros. The problem here is that pesky discontinuity at x=0. If f(a)<0 and f(b)>0 and f is continuous on (a,b) then one can say that a zero does exist in (a,b).
     
  6. Apr 22, 2008 #5

    Gib Z

    User Avatar
    Homework Helper

    I said earlier in my post I was assuming the function was continuous, as he was using Newtons method on them.
     
  7. Apr 30, 2008 #6
    thanx alot
    i know that the function should be continuous
    and i need a way to do that for any function
    any ideas!
     
  8. May 1, 2008 #7

    Gib Z

    User Avatar
    Homework Helper

    For any general function, there is no general method.
     
  9. May 1, 2008 #8
    i'm sure mathematica could plot it on pretty much any interval
     
  10. May 1, 2008 #9

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    Find the zeros of sin(1/x) in the neighborhood of a small but non-zero value of x.
     
  11. May 1, 2008 #10

    HallsofIvy

    User Avatar
    Staff Emeritus
    Science Advisor

    Plot what?
     
  12. May 1, 2008 #11
    he didn't say enumerate them, he said find the number. and i'm pretty there are countably infinite zeroes for your function on that interval.

    his function.
     
  13. May 2, 2008 #12

    Gib Z

    User Avatar
    Homework Helper

    I think the point of DHs comment was that plotting a function in Mathematica doesn't always give the answer.
     
  14. May 2, 2008 #13

    CRGreathouse

    User Avatar
    Science Advisor
    Homework Helper

    [Histronic]
    Quelle horreur!
    [/Histronic]
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: How to find the number of roots of the function?
Loading...